sp_delete_log_shipping_primary_secondary (Transact-SQL)sp_delete_log_shipping_primary_secondary (Transact-SQL)

适用于: 是SQL Server 否Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库 APPLIES TO: YesSQL Server NoAzure SQL Database NoAzure Synapse Analytics (SQL DW) NoParallel Data Warehouse

删除主服务器上的辅助数据库项。Removes the entry for a secondary database on the primary server.

主题链接图标 Transact-SQL 语法约定Topic link icon Transact-SQL Syntax Conventions

语法Syntax

  
sp_delete_log_shipping_primary_secondary  
    [ @primary_database = ] 'primary_database',   
    [ @secondary_server = ] 'secondary_server',   
    [ @secondary_database = ] 'secondary_database'  

参数Arguments

[ @primary_database = ] 'primary_database'主服务器上的数据库的名称。[ @primary_database = ] 'primary_database' Is the name of the database on the primary server. primary_database sysname,无默认值。primary_database is sysname, with no default.

[ @secondary_server = ] 'secondary_server'辅助服务器的名称。[ @secondary_server = ] 'secondary_server' Is the name of the secondary server. secondary_server sysname,无默认值。secondary_server is sysname, with no default.

[ @secondary_database = ] 'secondary_database'辅助数据库的名称。[ @secondary_database = ] 'secondary_database' Is the name of the secondary database. secondary_database sysname,无默认值。secondary_database is sysname, with no default.

返回代码值Return Code Values

0(成功)或 1(失败)0 (success) or 1 (failure)

结果集Result Sets

无。None.

备注Remarks

必须从主服务器上的master数据库运行sp_delete_log_shipping_primary_secondarysp_delete_log_shipping_primary_secondary must be run from the master database on the primary server. 此存储过程从主服务器上的log_shipping_primary_secondaries中删除辅助数据库的条目。This stored procedure removes the entry for a secondary database from log_shipping_primary_secondaries on the primary server.

权限Permissions

要求具有 sysadmin 固定服务器角色的成员身份。Requires membership in the sysadmin fixed server role.

示例Examples

以下示例中,使用 sp_delete_log_shipping_primary_secondary 从辅助服务器 LogShipAdventureWorks 上删除辅助数据库 FLATIRONIn the following example, sp_delete_log_shipping_primary_secondary is used to delete the secondary database LogShipAdventureWorks from the secondary server FLATIRON.

EXEC master.dbo.sp_delete_log_shipping_primary_secondary  
@primary_database = N'AdventureWorks'  
,@secondary_server = N'FLATIRON'  
,@secondary_database = N'LogShipAdventureWorks';  
GO  

另请参阅See Also

关于 (SQL Server 的日志传送) About Log Shipping (SQL Server)
系统存储过程 (Transact-SQL)System Stored Procedures (Transact-SQL)