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

存储日志传送作业的历史记录详细信息。Stores history details for log shipping jobs. 该表存储在msdb数据库中。This table is stored in the msdb database.

与历史记录和监视相关的表也用于主服务器和辅助服务器。The tables related to history and monitoring are also used at the primary server and the secondary servers.

列名称Column name 数据类型Data type 说明Description
agent_idagent_id uniqueidentifieruniqueidentifier 用于备份的主 ID 或者用于复制或还原的辅助 ID。The primary ID for backup or the secondary ID for copy or restore.
agent_typeagent_type tinyinttinyint 日志传送作业的类型。The type of log shipping job.

0 = 备份。0 = Backup.

1 = 复制。1 = Copy.

2 = 还原。2 = Restore.
session_idsession_id intint 备份/复制/还原作业的会话 ID。The session ID for the backup/copy/restore/ job.
database_namedatabase_name sysnamesysname 与此记录关联的数据库的名称。The name of the database associated with this record. 用于备份的主数据库、用于还原的辅助数据库或用于复制的空数据库。Primary database for backup, secondary database for restore, or empty for copy.
session_statussession_status tinyinttinyint 会话的状态。The status of the session.

0 = 正在启动。0 = Starting.

1 = 正在运行。1 = Running.

2 = 成功。2 = Success.

3 = 错误。3 = Error.

4 = 警告。4 = Warning.
log_timelog_time datetimedatetime 创建记录的日期和时间。The date and time at which the record was created.
log_time_utclog_time_utc datetimedatetime 创建记录的日期和时间,使用通用协调时间表示。The date and time at which the record was created, expressed in Coordinated Universal Time.
messagemessage nvarchar(max)nvarchar(max) 消息正文。Message text.


此表包含日志传送代理的历史记录详细信息。This table contains history details for the log shipping agents. 若要标识代理会话,请使用列agent_idagent_typesession_idTo identify an agent session, use columns agent_id, agent_type, and session_id. 若要查看代理会话的历史记录详细信息,请按log_time排序。To see the history detail for the agent session, sort by log_time.

除了存储在远程监视服务器上外,与主服务器有关的信息存储在主服务器上的log_shipping_monitor_history_detail表中,与辅助服务器相关的信息也存储在辅助服务器上的log_shipping_monitor_history_detail表中。In addition to being stored on the remote monitor server, the information related to the primary server is stored on the primary server in its log_shipping_monitor_history_detail table, and information related to a secondary server is also stored on the secondary server in its log_shipping_monitor_history_detail table.

另请参阅See Also

关于 (SQL Server 的日志传送) About Log Shipping (SQL Server)
sp_delete_log_shipping_primary_database (Transact-sql) sp_delete_log_shipping_primary_database (Transact-SQL)
sp_cleanup_log_shipping_history (Transact-sql) sp_cleanup_log_shipping_history (Transact-SQL)
sp_refresh_log_shipping_monitor (Transact-sql) sp_refresh_log_shipping_monitor (Transact-SQL)
sp_delete_log_shipping_secondary_database (Transact-sql) sp_delete_log_shipping_secondary_database (Transact-SQL)
系统表 (Transact-sql) System Tables (Transact-SQL)
log_shipping_monitor_error_detail (Transact-sql)log_shipping_monitor_error_detail (Transact-SQL)