sp_help_log_shipping_monitor_secondary (Transact-SQL)

適用於:SQL Server

從監視資料表傳回次要資料庫的相關資訊。

Transact-SQL 語法慣例

語法

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

引數

[ @secondary_server = ] 'secondary_server' 這是次要伺服器的名稱。 secondary_server為 sysname ,沒有預設值。

[ @secondary_database = ] 'secondary_database' 這是次要資料庫的名稱。 secondary_database為 sysname ,沒有預設值。

傳回碼值

0 (成功) 或 1 (失敗)

結果集

資料行 描述
secondary_server 記錄傳送組態中 Microsoft SQL Server Database Engine 次要實例的名稱。
secondary_database 記錄傳送組態中的次要資料庫名稱。
secondary_id 記錄傳送組態中次要伺服器的識別碼。
primary_server 記錄傳送組態中 SQL Server Database Engine 的主要實例名稱。
primary_database 記錄傳送組態中主資料庫的名稱。
restore_threshold 在產生警示之前,允許在還原作業之間經過的分鐘數。
threshold_alert 超過還原閾值時要引發的警示。
threshold_alert_enabled 判斷是否啟用還原閾值警示。

1 = 已啟用。

0 = 已停用。
last_copied_file 複製到次要伺服器之最後一個備份檔案的檔案名。
last_copied_date 上次複製到次要伺服器之複製作業的時間和日期。
last_copied_date_utc 最後一個複製作業到次要伺服器的時間和日期,以國際標準時程表示。
last_restored_file 還原至次要資料庫之最後一個備份檔案的檔案名。
last_restored_date 次要資料庫上最後一次還原作業的時間和日期。
last_restored_date_utc 次要資料庫上最後一次還原作業的時間和日期,以國際標準時程表示。
history_retention_period 記錄傳送記錄記錄在刪除之前,會保留給定次要資料庫的時間量,以分鐘為單位。

備註

sp_help_log_shipping_monitor_secondary 必須從 監視伺服器上的 master 資料庫執行。

權限

只有系統管理員 固定伺服器角色的成員 才能執行此程式。

另請參閱

關於記錄傳送 (SQL Server)
系統預存程序 (Transact-SQL)