Wednesday, July 22, 2015

Remove Log Shipping When Secondary Server Not Available

The other day, I came accross a scenario where I need to remove log shipping from a database on the primary server. However, we have already shutdown/decommissioned the secondary server. If we try to disable the log shipping from the database properties window, we would most like get the following:

Database Properties

Error Deleting Log Shipping Configuration

image

We would need to remove it manually using the following T-SQL script:

USE [master]
GO

EXEC sp_delete_log_shipping_primary_secondary @primary_database = '[Database_Name]', @secondary_server = '[Secondary_Server_Name]', @secondary_database = '[Database_Name]';
GO

EXEC sp_delete_log_shipping_primary_database @database = '[Database_Name]'
GO

References:


No comments:

Post a Comment