I have a log shipping solution setup where the secondary db is setup to recover in standby mode so my users can query the db.
I started running into issues where as the db was restoring logs, a user would sneak in which would kill the log restores because exclusive access was not obtained at that point.
My workaround was to change the log shipping set at the time of the log restores
using sp_change_log_shipping_secondary_database @restore_mode = 0
then the logs will run in norecovery mode.
Once all of the logs complete restoring
I do a final RESTORE DATABASE dbname WITH STANDBY = 'Undo Path Name'
Typically the restore with standby takes less then 1 minute to run.
All of sudden two nights ago, that step went to 13 minutes. Last night it exceeded 1 hour.
We are very confused here since it would seem like this command is simply flipping a flag for the database from norecovery to standy mode.
Any insight as to why this step is suddenly taking so long would be very much appreciated.
Thanks,
James