sp_update_log_shipping_plan

Transact-SQL Reference

Transact-SQL Reference

sp_update_log_shipping_plan

Updates information about an existing log shipping plan.

Syntax

sp_update_log_shipping_plan [@plan_id =] plan_id,
    [@plan_name =] 'plan_name',
    [@description =] 'description',
    [@source_server =] 'source_server',
    [@source_dir =] 'source_dir',
    [@destination_dir =] 'destination_dir',
    [@copy_job_id =] copy_job_id,
    [@load_job_id =] load_job_id,
    [@history_retention_period =] history_retention_period,
    [@file_retention_period =] file_retention_period

Arguments

[@plan_id =] plan_id

Is the identification number of the plan to which the database belongs. plan_id is uniqueidentifier, with a default of NULL.

[@plan_name =] 'plan_name'

Is the name of the plan to which the database belongs. plan_name is sysname, with a default of null.

Note  Either plan_id or plan_name must be specified, not both.

[@description =] 'description'

Is the description of the plan. description is nvarchar(500), with a default of NULL.

[@source_server =] 'source_server'

Is the name of the source server. source_server is sysname, with a default of NULL.

[@source_dir =] 'source_dir'

Is the full path to the directory from where the transaction log files will be copied. source_dir is nvarchar(500), with a default of NULL.

[@destination_dir =] 'destination_dir'

Is the directory to which the transaction log files will be copied. destination_dir is nvarchar(500), with a default of NULL.

[@copy_job_id =] copy_job_id

Is the job ID of the copy job. copy_job_id is uniqueidentifier, with a default of NULL.

[@load_job_id =] load_job_id

Is the job ID of the load job. load_job_id is uniqueidentifier, with a default of NULL.

[@history_retention_period =] history_retention_period

Is the length of time in minutes in which the history will be retained. history_retention_period is int, with a default of NULL.

[@file_retention_period =] file_retention_period

Is the length of time the transaction log files will be retained after they are copied. file_retention_period is int, with a default of NULL.

Return Code Values

0 (success) or 1 (failure)

Permissions

Only members of the sysadmin fixed server role can execute sp_update_log_shipping_plan.

Examples

This example updates the plan "Pubs database backup" with a new destination directory and file retention period.

EXEC   msdb.dbo.sp_update_log_shipping_plan
   @plan_name = N'Pubs database backup',
   @destination_dir = N'e:\log shipping',
   @history_retention_period = 4320