Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logshipping: Database restore failing

Status
Not open for further replies.

mkal

Programmer
Jun 24, 2003
223
US
SQL 2000 Ent.(sp4) on Windows 2003 Ent.(sp2)

A logshipping process that has been working for weeks suddenly failed today. I've confirmed all the log files for the secondary exist on the server and I've checked the ERRORLOG but other than a last entry saying the log had been restored there is no other error messages.

I tried to manually run the restore using the next log file to be used with the following command in Query Analyzer (from master db) on the secondary server.

restore log db_name from disk = 'D:\MSSQL\Logshipping\db_name\Secondary\db_name_tlog_200712201130.TRN' with standby = 'D:\MSSQL\Logshipping\db_name\Secondary\undo_db_name.dat', move 'db_name_log' to 'D:\Program Files\Microsoft SQL Server\MSSQL\Data\db_name_log.ldf'

which produces the following error:
Server: Msg 3101, Level 16, State 2, Line 1
Exclusive access could not be obtained because the database is in use.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.

I've run sp_who2 on the server and there is no other connection to this database other than the one sp_who2 is generating.

Anyone ever run into this situation and what did you do to solve it.

Thanks,
Mike
 
I came accross this situation. I just kicked out all the users who are accessing the subscriber database.

That did it and I can resume with log shipping.

Also did you check the kill all users before attempting restore.

thanks
 
Took your advice and booted everyone out (set db to single user mode) and that fixed the problem.

Thanks,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top