sp_delete_log_shipping_secondary_primary (Transact-SQL)sp_delete_log_shipping_secondary_primary (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

此存储过程可从辅助服务器删除有关指定主服务器的信息,并从辅助服务器删除复制作业和还原作业。This stored procedure removes the information about the specified primary server from the secondary server, and removes the copy job and restore job from the secondary.

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

语法Syntax

  
sp_delete_log_shipping_secondary_primary  
[ @primary_server = ] 'primary_server'  
[ @primary_database = ] 'primary_database'  

参数Arguments

[ @primary_server = ] 'primary_server'日志传送配置中的MicrosoftMicrosoft SQL Server 数据库引擎SQL Server Database Engine主实例的名称。[ @primary_server = ] 'primary_server' The name of the primary instance of the MicrosoftMicrosoft SQL Server 数据库引擎SQL Server Database Engine in the log shipping configuration. primary_serversysname ,且不能为 NULL。primary_server is sysname and cannot be NULL.

[ @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.

返回代码值Return Code Values

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

结果集Result Sets

无。None.

备注Remarks

必须从辅助服务器上的master数据库运行sp_delete_log_shipping_secondary_primarysp_delete_log_shipping_secondary_primary must be run from the master database on the secondary server. 此存储过程执行以下操作:This stored procedure does the following:

  1. 删除辅助 ID 的复制和还原作业。Deletes the copy and restore jobs for the secondary ID.

  2. 删除log_shipping_secondary中的条目。Deletes the entry in log_shipping_secondary.

  3. 调用监视服务器上sp_delete_log_shipping_alert_jobCalls sp_delete_log_shipping_alert_job on the monitor server.

权限Permissions

只有sysadmin固定服务器角色的成员才能运行此过程。Only members of the sysadmin fixed server role can run this procedure.

另请参阅See Also

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