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 ««12

Rolling Back a Restore Expand / Collapse
Author
Message
Posted Monday, March 22, 2010 10:28 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, September 19, 2012 8:39 AM
Points: 595, Visits: 1,226
As an option, I don't think this would be a bad thing, but for some, it could become a crutch.

Before I start a restore action, I always triple-check all my settings before I go. There are some things we do that have serious consequences for mistakes and this is one of them.

But anything that can make it safer would be a positive.


Converting oxygen into carbon dioxide, since 1955.

Post #887489
Posted Monday, March 22, 2010 11:22 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, August 31, 2010 10:40 AM
Points: 4, Visits: 11
I think, it would be a great thing.

It does not happen very often that the real live database has to be overwritten, so if a proved Script / Command can help to make it less dangerous it is a great thing
Post #887525
Posted Monday, March 22, 2010 12:58 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 3:45 AM
Points: 8,681, Visits: 9,206
An option to rename the existing db instead of overwriting it might bevery nice, provided it would deal automatically with the required filename changes (can't have two DBs using the same filenames). (So of course would any other way of rolling back restore, prob=vided you could still do it a while after the restore was finished rather than not just until then).

We did something like that when rolling out upgrades (of databases that were read only on customer sites) using DTS (to copy whole databases), and it's clearly applicable in the restore case too. As DTS over a slow internet connection (which some of our customers had) was slow (and even over a fast connection was sufficiently slow to cause noticeable downtime) we always had DTS create a new DB; this also eliminated the possibility of DTS leaving a partly overwritten live DB as the result of a network or other failure. When DTS completed without errors, we would drop the current back copy, rename the current live DB to be the new back copy db, and rename the new db to be the current live db. If we later discovered that someone had dropped a cog and the new live database was not acceptable we could get thinks back up again in a very short time by renaming the live db back to the new db name and renaming the back copy to the live name.

Another point: having restore automatically destry the old db is the restore completed cleanly would be much less valuable than keeping the old DB (in renamed form) for a while, until someone decides it's no longer needed in case of something nasty coming to light.

Unfortunately I can't see any way of making this usable for really big databases.


Tom
Post #887624
Posted Monday, March 22, 2010 7:55 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, July 10, 2014 1:33 PM
Points: 457, Visits: 476
I kind of like the idea as an option only for relatively small databases. But I have to stop and think about it and why the option doesn't already exist. Most of the time whenever I needed to restore a database, it was because the that database had some how become corrupted with bad data, in which case, why would I want to have an option to keep it around in case the restore fails or is canceled? On the other hand why would I want to restore a perfectly good database.

An answer to the second question maybe, to eliminate a large accumulation of temporary or test data and reset it back to a baseline, then this option could be a good thing. Of course a transactional script could do the same thing unless the temp/test data had overwritten the data I want kept.

Possibly the reason that it is not already an option is because it would rarely be needed. Then again it does seem that it is those rare cases that always seem to rise up and bite us in the butt.


Ron K.

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." -- Martin Fowler
Post #887815
Posted Monday, March 22, 2010 8:06 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 3:45 AM
Points: 8,681, Visits: 9,206
Ron Kunce (3/22/2010)
IPossibly the reason that it is not already an option is because it would rarely be needed. Then again it does seem that it is those rare cases that always seem to rise up and bite us in the butt.

I like those two sentences. The second explains why it would be an extremely good thing to have. And the first explains why MS almost certainly will never provide it.


Tom
Post #887819
Posted Tuesday, March 23, 2010 12:13 PM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Monday, July 7, 2014 1:15 PM
Points: 750, Visits: 3,157
If anything, I would rather have the option to take a full, copy-only backup of the existing database as part of the restore (probably as part of the WITH clause).
Post #888417
Posted Wednesday, March 24, 2010 4:24 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 4:39 PM
Points: 33,155, Visits: 15,291
Matt,

Now that is a great idea as well.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #888798
Posted Monday, March 29, 2010 1:39 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, March 20, 2013 4:02 AM
Points: 2, Visits: 250
Its Great Idea.

Nowadays space is not an issue. Production data more costlier than space.

Post #892156
Posted Monday, March 29, 2010 2:12 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 3:59 PM
Points: 3,135, Visits: 11,473
It wouldn’t do anything you can’t do already. You can restore a database with a new name, verify it is OK, drop the old database, and then rename the restored database.

There are so many possible scenarios for a restore that I don’t think it is really that useful. For example, a complete restore up to a point in time of a failure using the full backup and transaction log backups.

I rarely use the GUI for a restore; I find that it’s easier to use a script.

Post #892186
Posted Monday, March 29, 2010 4:05 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, August 14, 2014 2:03 PM
Points: 3,244, Visits: 532
If I have a concern, I detach the existing database and change the extension to .old (ie: mydbname.mdf.old and mydbname.ldf.old). Then I restore from the backup. If anything fails, all I have to do is remove the .old part of the extension and attach the files. Once I know everything is good-to-go, I delete the old files and that frees up the space.

-SQLBill



Post #892280
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse