sp_change_log_shipping_primary_database (Transact-SQL)
Changes the primary database settings.
sp_change_log_shipping_primary_database [ @database = ] 'database'
[, [ @backup_directory = ] 'backup_directory']
[, [ @backup_share = ] 'backup_share']
[, [ @backup_retention_period = ] 'backup_retention_period']
[, [ @monitor_server_security_mode = ] 'monitor_server_security_mode']
[, [ @monitor_server_login = ] 'monitor_server_login']
[, [ @monitor_server_password = ] 'monitor_server_password']
[, [ @backup_threshold = ] 'backup_threshold']
[, [ @threshold_alert = ] 'threshold_alert']
[, [ @threshold_alert_enabled = ] 'threshold_alert_enabled']
[, [ @history_retention_period = ] 'history_retention_period']
[, [ @backup_compression = ] backup_compression_option ]
sp_change_log_shipping_primary_database must be run from the master database on the primary server. This stored procedure does the following:
-
Changes the settings in the log_shipping_primary_database record, if necessary.
-
Changes the local record in log_shipping_monitor_primary on the primary server using supplied arguments, if necessary.
-
If the monitor server is different from the primary server, changes record in log_shipping_monitor_primary on the monitor server using supplied arguments, if necessary.
This example illustrates the use of sp_change_log_shipping_primary_database to update the settings associated with the primary database AdventureWorks2012 .
EXEC master.dbo.sp_change_log_shipping_primary_database @database = N'AdventureWorks' , @backup_directory = N'c:\LogShipping' , @backup_share = N'\\tribeca\LogShipping' , @backup_retention_period = 1440 , @backup_threshold = 60 , @threshold_alert = 0 , @threshold_alert_enabled = 1 , @history_retention_period = 1440 ,@monitor_server_security_mode = 1 ,@backup_compression = 1