Tuesday, November 24, 2009

Manually remove log shipping using T-SQL :

Manually, using T-SQL :

1. On the primary server, execute sp_delete_log_shipping_primary_secondary to delete the information about the secondary database from the primary server.

EXEC master.dbo.sp_delete_log_shipping_primary_secondary
@primary_database = N'AdventureWorks'
,@secondary_server = N'LogShippingServer'
,@secondary_database = N'LogShipAdventureWorks'

2. On the secondary server, execute sp_delete_log_shipping_secondary_database to delete the secondary database.

sp_delete_log_shipping_secondary_database N'LogShipAdventureWorks'

3. On the primary server, execute sp_delete_log_shipping_primary_database to delete information about the log shipping configuration from the primary server. This also deletes the backup job.

sp_delete_log_shipping_primary_database N'AdventureWorks'


  1. Worked perfectly! My secondary server was not accessible and I wasn't able to tear down log shipping using SQL Management Studio. Thanks a bunch!

  2. looks nice. but have you ever heard about another way of access database query recovery, provided by appropriate data recovery services?