February 26, 2014 at 1:43 pm
I would like to set up automated job to restore a database from another live database nightly.
I can use SSMS UI to restore the database to point of time from the other live database.
Is there a way that I can do from script?
I can do something like below (pseudocode)
restore databaseA from database B
to point of time of tonight 9:00 pm.
I don't want to use the backup file names, for every night the backup name changes.
Just use the database name.
Thanks
February 27, 2014 at 3:15 am
Check the following link which might help you:
http://www.sqlservercentral.com/Forums/Topic782209-24-1.aspx
http://www.sqlservercentral.com/Forums/Topic1041837-357-1.aspx
http://community.spiceworks.com/topic/282881-automated-restore-of-sql-2008-database
HTH
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
February 27, 2014 at 6:15 am
I'd suggest using a T-SQL script to restore from. Whatever mechanism is changing the backups nightly is surely discernable, and therefore repeatable. You can then just run the restore. There is no RESTORE FROM Database command. You must have a backup. If you have to, you could take a backup of your own, but then, in case you have differentials, make sure you use COPY_ONLY for that backup so that it doesn't disrupt the differentials.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply