Pages

Saturday, December 29, 2012

Remove Log-Shipping setup from SQL Server

How to Remove Log-Shipping setup from SQL Server

Below are the simple T-SQL commands to remove the log shipping from the Primary and Secodary Server.

Run the below query in Primary Server:

1. Below query will remove the secondary server details from Primary server.


 use master
 go
 sp_delete_log_shipping_primary_secondary     @primary_database='Room',@secondary_server='MYCOMPUTER\SERVER1',  
 @secondary_database='Room'

2. Run the below query in Secondary server. The below query will remove the COPY JOB and RESTORE JOB from the secondary server.


Use Master
 GO
 sp_delete_log_shipping_secondary_database  @secondary_database='Room'

3. Run the below query in Primary server. Below query will remove the BACKUP JOB and ALERT JOB from primary server.

Use Master
 Go
 sp_delete_log_shipping_primary_database @database='Room'

Above simple 3 steps are enough for removing log shipping.

Hope the above information helps.