| title | Remove Log Shipping Secondary | |||||
|---|---|---|---|---|---|---|
| description | Learn how to remove a log shipping secondary partner 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 |
|
[!INCLUDE SQL Server]
This article describes how to remove a log shipping secondary database in [!INCLUDE ssnoversion] by using [!INCLUDE ssManStudioFull] or [!INCLUDE tsql].
-
Connect to the instance of [!INCLUDE ssNoVersion] that is currently the log shipping primary server and expand that instance.
-
Expand Databases, right-click the log shipping primary database, and then select Properties.
-
Under Select a page, select Transaction Log Shipping.
-
Under Secondary server instances and databases, select the database you want to remove.
-
Select Remove.
-
Select OK to update the configuration.
-
On the primary server, execute sp_delete_log_shipping_primary_secondary to delete the information about the secondary database from the primary server.
-
On the 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_primaryis invoked fromsp_delete_log_shipping_secondary_databaseand deletes the entry for the secondary ID and the copy and restore jobs. -
On the secondary server, disable the copy and restore jobs. For more information, see Disable or Enable a Job.
The log-shipping stored procedures require membership in the sysadmin fixed server role.
- Upgrade SQL Server with log shipping (Transact-SQL)
- Configure Log Shipping (SQL Server)
- Add a Secondary Database to a Log Shipping Configuration (SQL Server)
- Remove Log Shipping (SQL Server)
- View the Log Shipping Report (SQL Server Management Studio)
- Monitor Log Shipping (Transact-SQL)
- Fail Over to a Log Shipping Secondary (SQL Server)