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

从监视表返回有关主数据库的信息。Returns information regarding a primary database from the monitor tables.

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

语法Syntax

  
sp_help_log_shipping_monitor_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

列名称Column name 说明Description
primary_idprimary_id 日志传送配置的主数据库 ID。The ID of the primary database for 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.
backup_thresholdbackup_threshold 备份操作之间的占用时间阈值(分钟),一旦超过此值,就会生成警报。The number of minutes allowed to elapse between backup operations before an alert is generated.
threshold_alertthreshold_alert 超过备份阈值时引发的警报。The alert to be raised when the backup threshold is exceeded.
threshold_alert_enabledthreshold_alert_enabled 确定是否启用备份阈值警报。Determines if backup threshold alerts are enabled. 1 = 启用;0 = 禁用。1 = enabled; 0 = disabled.
last_backup_filelast_backup_file 最近一次事务日志备份的绝对路径。The absolute path of the most recent transaction log backup.
last_backup_datelast_backup_date 上一次在主数据库上执行事务日志备份操作的时间和日期。The time and date of the last transaction log backup operation on the primary database.
last_backup_date_utclast_backup_date_utc 上一次在主数据库上执行事务日志备份操作的时间和日期,使用协调世界时表示。The time and date of the last transaction log backup operation on the primary 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 primary database before being deleted.

备注Remarks

必须从监视服务器上的master数据库运行sp_help_log_shipping_monitor_primarysp_help_log_shipping_monitor_primary 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)