My primary server with SQL Server 2005 broke down, so I've started up the log-shipped database on the secondary server. The database is live on the secondary server, and I just need to remove the log shipping settings for it, while the primary server is no longer accessible.
It seems that the sp_delete_log_shipping_secondary_database
stored procedure should be executed on the secondary server to do this, which "removes a secondary database and removes the local history and remote history", as it is stated on msdn.
Would this also remove the database itself? Or only the log shipping settings for it? And what will it do when the primary server is not accessible?
I must not loose the database on the secondary server, as it is already in use.
Best Answer
You are facing what is called orphaned entries in logshipping tables in msdb. You can use below tsql to just manually clean up logshipping orphan entries. For your case, since you don't have the primary database available, you should just run the
secondary
part or you can try runningsp_delete_log_shipping_secondary_database N'secondary_database'
. It will just remove the secondary database settings from msdb.Note: Above methods are safe and will delete ONLY logshipping related information.