|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Yesterday @ 11:15 PM
Points: 145,
Visits: 173
|
|
george sibbald (3/20/2013) to everyone out there, attach with rebuild log is a last resort, please don't replace restores with it.
Apart that only a restore can replace a damaged mdf file, is there any other reason you wouldn't use it?
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 3:23 PM
Points: 5,264,
Visits: 11,191
|
|
in this situation its totally unnecessary, a restore will overwrite the database as you want it.
why start detaching production databases and then not using the log file when you don't have to? No proper database recovery phase can take place without the original log file. Rebuild log is a last resort command if you don't have a log file or a suitable backup, it should be followed by a dbcc checkdb to check no corruptions. This is a method of restoring a database from production to development that is asking for trouble and I would not recommend.
---------------------------------------------------------------------
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Yesterday @ 11:15 PM
Points: 145,
Visits: 173
|
|
| I see your point. Thanks for the comment!
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Yesterday @ 11:15 PM
Points: 145,
Visits: 173
|
|
Hi folks,
I just want to point out that although I have been ranting on about the benefits of attach/detach for a database test machine, I have to concede I have missed to many valid points out to be able to validate my arguments anymore. In particular:
When I use FOR ATTACH_REBUILD_LOG I obviously no longer have a logfile. To that end there is no ability to rollback inconsistent or uncommitted transactions on startup, hence an inconsistent state. I was warned of that several times here but didn't think deeply enough.
To that end, there is truly no replacement for a good backup and recovery strategy and my own environment now reflects that.
Many thanks to all for your constructive comments (even if sometimes they were the result of an enormous amount of patience!).
Kev
|
|
|
|