sp_update_log_shipping_monitor_info
Updates the monitoring information about a log shipping pair.
Syntax
sp_update_log_shipping_monitor_info
[@primary_server_name =] 'primary_server_name',
[@primary_database_name =] 'primary_database_name',
[@secondary_server_name =] 'secondary_server_name',
[@secondary_database_name =] 'secondary_database_name'
[,[@backup_threshold =] backup_threshold]
[,[@backup_threshold_alert =] backup_threshold_alert]
[,[@backup_threshold_alert_enabled =] backup_threshold_alert_enabled]
[,[@backup_outage_start_time =] backup_outage_start_time]
[,[@backup_outage_end_time =] backup_outage_end_time]
[,[@backup_outage_weekday_mask =] backup_outage_weekday_mask]
[,[@copy_enabled =] copy_enabled]
[,[@load_enabled =] load_enabled]
[,[@out_of_sync_threshold =] out_of_sync_threshold]
[,[@out_of_sync_threshold_alert =] out_of_sync_threshold_alert]
[,[@out_of_sync_threshold_alert_enabled =] out_of_sync_threshold_alert_enabled]
[,[@out_of_sync_outage_start_time =]out_of_sync_outage_start_time]
[,[@out_of_sync_outage_end_time =] out_of_sync_outage_end_time]
[,[@out_of_sync_outage_weekday_mask =] out_of_sync_outage_weekday_mask]
Arguments
[@primary_server_name =] 'primary_server_name'
Is the name of the primary server. primary_server_name is sysname, with no default.
[@primary_database_name =] 'primary_database_name'
Is the name of the database on the primary server. primary_database_name is sysname, with no default.
[@secondary_server_name =] 'secondary_server_name'
Is the name of the secondary server. secondary_server_name is sysname, with no default.
[@secondary_database_name =] 'secondary_database_name'
Is the name of the database on the secondary server. secondary_database_name is sysname, with no default.
[@backup_threshold =] backup_threshold
Is the length of time in minutes after the last backup before a threshold alert error is raised. backup_threshold is int, with a default of NULL.
[@backup_threshold_alert =] backup_threshold_alert
Is the error raised when the backup threshold has been exceeded. backup_threshold_alert is int, with a default of NULL.
[@backup_threshold_alert_enabled =] backup_threshold_alert_enabled
Specifies whether an alert will be raised when backup_threshold has been exceeded. The one (1) indicates an alert will be raised. backup_threshold_alert_enabled is bit, with a default of NULL.
[@backup_outage_start_time =] backup_outage_start_time
Is the time in HHMMSS that a planned outage begins. During a planned outage, alerts will not be raised if the backup threshold is exceeded. backup_outage_start_time is int, with a default of NULL.
[@backup_outage_end_time =] backup_outage_end_time
Is the time in HHMMSS that a planned outage ends. backup_outage_end_time is int, with a default of NULL.
[@backup_outage_weekday_mask =] backup_outage_weekday_mask
Is the day of the week that a planned outage occurs. backup_outage_weekday_mask is int, with a default of NULL. It can be one or more of the following values.
Value | Day |
---|---|
1 | Sunday |
2 | Monday |
4 | Tuesday |
8 | Wednesday |
16 | Thursday |
32 | Friday |
64 | Saturday |
[@copy_enabled =] copy_enabled
Specifies whether the copy for the database is enabled on the secondary server. The one (1) value means that copy is enabled. copy_enabled is bit, with a default of NULL.
[@load_enabled =] load_enabled
Specifies whether the load for the database is enabled on the secondary server. load_enabled is bit, with a default of NULL.
[@out_of_sync_threshold =] out_of_sync_threshold
The length of time in minutes after the last load before an error is raised. out_of_sync_threshold is int, with a default of NULL.
[@out_of_sync_threshold_alert =] out_of_sync_threshold_alert
Is the error raised when the out-of-sync threshold has been exceeded. out_of_sync_threshold_alert is int, with a default of NULL.
[@out_of_sync_threshold_alert_enabled =] out_of_sync_threshold_alert_enabled
Specifies whether an alert will be raised when the out-of-sync threshold has been exceeded. The one (1) value means an alert will be raised. out_of_sync_threshold_alert_enabled is bit, with a default of NULL.
[@out_of_sync_outage_start_time =] out_of_sync_outage_start_time
Is the time in HHMMSS that a planned outage begins. During a planned outage, alerts will not be raised if the out-of-sync threshold is exceeded. out_of_sync_outage_start_time is int, with a default of NULL.
[@out_of_sync_outage_end_time =] out_of_sync_outage_end_time
Is the time in HHMMSS that a planned outage ends. out_of_sync_outage_end_time is int, with a default of NULL.
[@out_of_sync_outage_weekday_mask =] out_of_sync_outage_weekday_mask
Is the day of the week that a planned outage occurs. out_of_sync_outage_weekday_mask is int, with a default of NULL. It can be one or more of the following values.
Value | Day |
---|---|
1 | Sunday |
2 | Monday |
4 | Tuesday |
8 | Wednesday |
16 | Thursday |
32 | Friday |
64 | Saturday |
Return Code Values
0 (success) or 1 (failure)
Remarks
This stored procedure updates both the primary server in log_shipping_primaries table and the secondary server in log_shipping_secondaries table.
Permissions
Only members of the sysadmin fixed server role can execute the sp_update_log_shipping_monitor_info.