Sree Divya (10/13/2016)
Hi,i have configured logshipping for my databases.
for dr testing i have disabled the lscopy,ls restore jobs on the secondary server and after that i have ran my database come to online by retsore databse mydb with recovery.
now my database came to online.
i am planning reconfigure the logshipping .
how can i re configure the logshipping database and its state to standby / readonly mode.
i have tried using the copy only backup and restored on the secondary server but my database is gone to restoring mode.
how can i bring back to stand by mode
Can you detail the exact steps you are taking to restore the database?
The following syntax should be of some help
USE [master]
--Restore to the databasename
RESTORE DATABASE [somedb] FROM
--select the disk location and filename
DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Backup\MY_DBA_Utils_FULL_20161020_170000.bak' WITH
--If you need to move any file locations then do this here
MOVE N'DBA_Utils' TO N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\DBA_Utils2.mdf',
MOVE N'DBA_Utils_log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\DBA_Utils2_log.ldf',
--if no move required then just delete move commands and carry on here
STANDBY = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Backup\MY_DBA_Utils_RollbackUndo_2016-10-20_17-30-00.TUF'
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉