sp_help_log_shipping_secondary_primary (Transact-SQL)sp_help_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 retrieves the settings for a given primary database on the secondary server.

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


[ @primary_server = ] 'primary_server' OR  
[ @primary_database = ] 'primary_database'  


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

结果集包含backup_destination_directory secondary_idprimary_serverprimary_databasebackup_source_directoryfile_retention_periodcopy_job_idrestore_job_idmonitor_servermonitor_server_security_modelog_shipping_secondary的列。The result set contains the columns secondary_id, primary_server, primary_database, backup_source_directory, backup_destination_directory, file_retention_period, copy_job_id, restore_job_id, monitor_server, monitor_server_security_mode from log_shipping_secondary.


必须从辅助服务器上的master数据库运行sp_help_log_shipping_secondary_primarysp_help_log_shipping_secondary_primary must be run from the master database on the secondary server.


只有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)