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

从监视表返回关于辅助数据库的信息。Returns information regarding a secondary database from the monitor tables.

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

语法Syntax

  
sp_help_log_shipping_monitor_secondary  
[ @secondary_server = ] 'secondary_server',  
[ @secondary_database = ] 'secondary_database'  

参数Arguments

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

Column 说明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.
secondary_idsecondary_id 日志传送配置中辅助服务器的 ID。The ID for the secondary server in the log shipping configuration.
primary_serverprimary_server 日志传送配置中 SQL Server 数据库引擎SQL Server Database Engine主实例的名称。The name of the primary instance of the SQL Server 数据库引擎SQL Server Database Engine in the log shipping configuration.
primary_databaseprimary_database 日志传送配置中主数据库的名称。The name of the primary database in the log shipping configuration.
restore_thresholdrestore_threshold 两次还原操作之间允许的间隔时间(分钟),一旦超过此值,就会生成警报。The number of minutes allowed to elapse between restore operations before an alert is generated.
threshold_alertthreshold_alert 超过还原阈值时引发的警报。The alert to be raised when the restore threshold is exceeded.
threshold_alert_enabledthreshold_alert_enabled 确定是否启用了还原阈值警报。Determines if restore threshold alerts are enabled.

1 = 启用。1 = Enabled.

0 = 禁用。0 = Disabled.
last_copied_filelast_copied_file 上次复制到辅助服务器的备份文件的文件名。The filename of the last backup file copied to the secondary server.
last_copied_datelast_copied_date 上次复制到辅助服务器的时间和日期。The time and date of the last copy operation to the secondary server.
last_copied_date_utclast_copied_date_utc 上次对辅助服务器执行复制操作的时间和日期,以通用协调时间表示。The time and date of the last copy operation to the secondary server, expressed in Coordinated Universal Time.
last_restored_filelast_restored_file 上次还原到辅助数据库的备份文件的文件名。The filename of the last backup file restored to the secondary database.
last_restored_datelast_restored_date 上次对辅助数据库执行还原操作的时间和日期。The time and date of the last restore operation on the secondary database.
last_restored_date_utclast_restored_date_utc 上次对辅助数据库执行还原操作的时间和日期,以通用协调时间表示。The time and date of the last restore operation on the secondary database, expressed in Coordinated Universal Time.
history_retention_periodhistory_retention_period 日志传送历史记录在删除前保留在给定辅助数据库中的时间(分钟)。The amount of time, in minutes, that log shipping history records are retained for a given secondary database before being deleted.

备注Remarks

必须从监视服务器上的master数据库运行sp_help_log_shipping_monitor_secondarysp_help_log_shipping_monitor_secondary must be run from the master database 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)