Could someone help me with a newbie question about log shipping?
I've configured it for a test database where I chose the target to be in the In Recovery state. Obviously that makes the database inaccessible. I then wanted to take a look at its contents, just to make sure I configured everything correctly and its contents are the same as the source. So I used this solution, and it worked well. (Except I used RESTORE LOG instead of RESTORE DATABASE.)
Now I want to resume the log shipping process, so I need to put the target DB in the In Recovery state again. Trying it the same way as in that answer but using WITH NORECOVERY instead of WITH RECOVERY didn't work. I guess I could re-apply all the backups, starting from the last full backup and including all the transaction log backups that have been applied so far, but is that the only option in this scenario?
Yes, I tried the RESTORE ... WITH NORECOVERY option after I finished inspecting the database, and it said:
Msg 3117, Level 16, State 4, Line 4
The log or differential backup cannot be restored because no files are ready to rollforward.
Msg 3013, Level 16, State 1, Line 4
RESTORE LOG is terminating abnormally.
So yes, I figured I couldn't do it like that.
And I also believe I should be able to achieve my goal by re-applying all the backups with no recovery starting from the last full backup. My question is whether that's my only option.
It's been a while since I did this for real, but I believe you only need to specify STANDBY on the final restore when you want to be able to inspect the data.
It's good to try these things with a small test database, with changes between log backups, so you get a good feel for how it all works, and what the optimal strategy is.
@PaulWhite I don't think I'll need to either, not this time anyway as I've already verified that my configuration works fine. But it could come in handy in the future. I'll just try it then and see what happens. Thanks again.