How to resolve Log Shipping Error “Exclusive access could not be obtained because the database is in use.RESTORE LOG is terminating abnormally”?

Hello Friends,
This error normally came when you did log shipping on your database and  your secondary server database in stand by  mode.
In this error your secondary server database restore job will not work. To resolve this error you just need to change the log shipping setting.
When you configure secondary server database mode   there is check box which says disconnect all collection at the time of restore database so just check that check box and you will find your log shipping is working.

Thanks

Rajat

Advertisements

How to shrink Log File when Log shipping is implemented on database ?

To shrink Log file you have to run following command.
DBCC SHRINKFILE (  ‘Database_log’ , NOTRUNCATE)
So here we used  NOTRUNCATE option because in log shipping  transaction log  sequence important if  you run the normal  Shrink file or with truncate file option then log shipping will be failed.
So run Shrink File with NOTRUNCATE option. Although many DBA & Sql Server experts   gave suggestion to avoid shrink Log file.
But we can do shrink file in log shipping with NOTRUNCATE option if database Log size too much large and you have space issue.

Thanks

Rajat