I just accidently deleted a database that was being log shipped to, and now it wont restore the logs.
I restored the database, and when I try to restore the logs by running the old job it tells me this:
Executed as user: sa. The preceding restore operation did not specify WITH NORECOVERY or WITH STANDBY. Restart the restore sequence, specifying WITH NORECOVERY or WITH STANDBY for all but the final step. [SQLSTATE 42000] (Error 4306) RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013) Mail sent. [SQLSTATE 01000] (Error 17967). The step failed.
Ok that kind of worked, but when restroring the log I got a new error:
Executed as user: sa. The log in this backup set begins at LSN 239312000000004600001, which is too late to apply to the database. An earlier log backup that includes LSN 237268000000010100001 can be restored. [SQLSTATE 42000] (Error 4305) RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013) Mail sent. [SQLSTATE 01000] (Error 17967). The step failed.
Depending on the size of the production database, why not just re-initialize the log shipping job. It's a pain, but it's a sure way to make sure you're back up and running.
The specific problem that the error message is reporting is that the database is expecting an earlier log file to be applied. You have to properly identify, sequence and apply all the log files from the point at which you restored the database. Each one must be applied with the STANDBY or NORECOVERY option.
This isn't much comfort I realize, but I hope it helps.