Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

Restoring database from production to Dev Expand / Collapse
Author
Message
Posted Wednesday, March 20, 2013 8:48 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 6:40 AM
Points: 324, Visits: 534
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?
Post #1433270
Posted Wednesday, March 20, 2013 9:03 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:38 AM
Points: 5,879, Visits: 13,010
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.


---------------------------------------------------------------------

Post #1433283
Posted Wednesday, March 20, 2013 9:16 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 6:40 AM
Points: 324, Visits: 534
I see your point. Thanks for the comment!
Post #1433299
Posted Thursday, March 21, 2013 3:46 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 6:40 AM
Points: 324, Visits: 534
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
Post #1433673
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse