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

此存储过程将返回有关给定主数据库的所有辅助数据库的信息。This stored procedure returns information regarding all the secondary databases for a given primary database.

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

语法Syntax

  
sp_help_log_shipping_primary_secondary  
[ @primary_database = ] 'primary_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.

返回代码值Return Code Values

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

结果集Result Sets

列名称Column name 说明Description
secondary_serversecondary_server 日志传送配置中的MicrosoftMicrosoft SQL Server 数据库引擎SQL Server Database Engine辅助实例的名称。The name of the secondary instance of the MicrosoftMicrosoft SQL Server 数据库引擎SQL Server Database Engine in the log shipping configuration.
secondary_databasesecondary_database 日志传送配置中辅助数据库的名称。The name of the secondary database in the log shipping configuration.

备注Remarks

必须从主服务器上的master数据库运行sp_help_log_shipping_primary_secondarysp_help_log_shipping_primary_secondary must be run from the master database on the primary server.

权限Permissions

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

示例Examples

此示例演示如何使用sp_help_log_shipping_primary_secondary检索与主数据库AdventureWorks2012AdventureWorks2012关联的辅助数据库的列表。This example illustrates using sp_help_log_shipping_primary_secondary to retrieve a list of secondary databases associate with the primary database AdventureWorks2012AdventureWorks2012.

EXECUTE master.dbo.sp_help_log_shipping_primary_secondary @primary_database=N'AdventureWorks';  
GO  

另请参阅See Also

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