patternsqlMinor
SQL Server: Log Shipping in "restoring" state: Can I temporarily take it out of restoring to check it?
Viewed 0 times
canlogsqltakerestoringstateshippingservercheckout
Problem
I know it is normal for the target db to be in "restoring" state
I also would like to do a few queries as a sanity check that the data is all up to date.
Can I take it to a read only, non-restoring state, temporarily, to check the data, and then put it back to restoring, without breaking the whole restore chain?
thanks!
I also would like to do a few queries as a sanity check that the data is all up to date.
Can I take it to a read only, non-restoring state, temporarily, to check the data, and then put it back to restoring, without breaking the whole restore chain?
thanks!
Solution
I would suggest configuring the log shipping to
When you use
When you use
Think of it as a transaction log restore. When you restore each transaction log, you leave the DB in NORECOVERY so that you can continue to append any additional log files until you have restored to the point you require. Then, you set it to RECOVERY and the database is able to be read. Make sense?
@DenisT brought up a good point that the 'disconnect all users' option must be checked in order for all users to get booted. Otherwise, the log restore will fail.
Here's a great article on it
http://askmesql.blogspot.se/2011/01/log-shipping-norecovery-vs-standby-mode.html
STANDBY mode instead of NORECOVERY. This will allow you to query the secondary db for any reporting, etc.When you use
NORECOVERY mode, the secondary database will not allow any users to access it, so the database does not have to worry about uncommitted transactions. The log can just be restored as it currently sits without worrying about any users accessing/changing things.When you use
STANDBY mode, the database restores in NORECOVERY mode, then looks at and rolls any open transactions. Once that is complete, users can access the database and it will be in read-only mode. When the next log is restored, the database disconnects all users and repeats the rollback/forward process and then, again, places the database in read-only mode. Lather, rinse, repeat.Think of it as a transaction log restore. When you restore each transaction log, you leave the DB in NORECOVERY so that you can continue to append any additional log files until you have restored to the point you require. Then, you set it to RECOVERY and the database is able to be read. Make sense?
@DenisT brought up a good point that the 'disconnect all users' option must be checked in order for all users to get booted. Otherwise, the log restore will fail.
Here's a great article on it
http://askmesql.blogspot.se/2011/01/log-shipping-norecovery-vs-standby-mode.html
Context
StackExchange Database Administrators Q#72864, answer score: 7
Revisions (0)
No revisions yet.