Skip to content

Latest commit

 

History

History
72 lines (48 loc) · 3.87 KB

File metadata and controls

72 lines (48 loc) · 3.87 KB
title Remove Log Shipping (SQL Server)
description Learn how to remove log shipping by using SQL Server Management Studio or Transact-SQL in SQL Server.
author MikeRayMSFT
ms.author mikeray
ms.reviewer randolphwest
ms.date 02/23/2026
ms.service sql
ms.subservice log-shipping
ms.topic how-to
helpviewer_keywords
log shipping [SQL Server], removing
removing log shipping
deleting log shipping

Remove Log Shipping (SQL Server)

[!INCLUDE SQL Server]

This article describes how to remove log shipping in [!INCLUDE ssnoversion] by using [!INCLUDE ssManStudioFull] or [!INCLUDE tsql].

Use SQL Server Management Studio

  1. Connect to the instance of [!INCLUDE ssNoVersion] that is currently the log shipping primary server, and expand that instance.

  2. Expand Databases, right-click the log shipping primary database, and then select Properties.

  3. Under Select a page, select Transaction Log Shipping.

  4. Clear the Enable this as a primary database in a log shipping configuration check box.

  5. Select OK to remove log shipping from this primary database.

Use Transact-SQL

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

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

    [!NOTE]
    If there are no other secondary databases with the same secondary ID, sp_delete_log_shipping_secondary_primary is invoked from sp_delete_log_shipping_secondary_database and deletes the entry for the secondary ID and the copy and restore jobs.

  3. On the log shipping 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.

  4. On the log shipping primary server, disable the backup job. For more information, see Disable or Enable a Job.

  5. On the log shipping secondary server, disable the copy and restore jobs.

  6. Optionally, if you're no longer using the log shipping secondary database, you can delete it from the secondary server.

Permissions

The log-shipping stored procedures require membership in the sysadmin fixed server role.

Related tasks

Related content