更新有關(guān)現(xiàn)有日志傳送計(jì)劃的信息。
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
[@plan_id =] plan_id
是數(shù)據(jù)庫所屬于的計(jì)劃的標(biāo)識號。plan_id 的數(shù)據(jù)類型為 uniqueidentifier,其默認(rèn)值為 NULL。
[@plan_name =] 'plan_name'
是數(shù)據(jù)庫所屬于的計(jì)劃的名稱。plan_name 的數(shù)據(jù)類型為 sysname,其默認(rèn)值為 NULL。
說明 必須指定 plan_id 或 plan_name 兩者之一,但不能兩者都指定。
[@description =] 'description'
是計(jì)劃的描述。description 的數(shù)據(jù)類型為 nvarchar(500),其默認(rèn)值為 NULL。
[@source_server =] 'source_server'
是源服務(wù)器的名稱。source_server 的數(shù)據(jù)類型為 sysname,其默認(rèn)值為 NULL。
[@source_dir =] 'source_dir'
是目錄的完整路徑,事務(wù)日志文件將從該目錄復(fù)制。source_dir 的數(shù)據(jù)類型為 nvarchar(500),其默認(rèn)值為 NULL。
[@destination_dir =] 'destination_dir'
是復(fù)制事務(wù)日志文件的目的目錄。destination_dir 的數(shù)據(jù)類型為 nvarchar(500),其默認(rèn)值為 NULL。
[@copy_job_id =] copy_job_id
是復(fù)制作業(yè)的作業(yè) ID。copy_job_id 的數(shù)據(jù)類型為 uniqueidentifier,其默認(rèn)值為 NULL。
[@load_job_id =] load_job_id
是裝載作業(yè)的作業(yè) ID。load_job_id 的數(shù)據(jù)類型為 uniqueidentifier,其默認(rèn)值為 NULL。
[@history_retention_period =] history_retention_period
是歷史記錄要保留的時(shí)間長度(以分鐘計(jì))。history_retention_period 的數(shù)據(jù)類型為 int,其默認(rèn)值為 NULL。
[@file_retention_period =] file_retention_period
是事務(wù)日志文件復(fù)制后的保留時(shí)間長度(以分鐘計(jì))。file_retention_period 的數(shù)據(jù)類型為 int,其默認(rèn)值為 NULL。
0(成功)或 1(失?。?/P>
只有 sysadmin 固定服務(wù)器角色的成員才能執(zhí)行 sp_update_log_shipping_plan。
下例用新的目的目錄和文件保留期更新計(jì)劃"Pubs database backup"。
EXEC msdb.dbo.sp_update_log_shipping_plan
@plan_name = N'Pubs database backup',
@destination_dir = N'e:\log shipping',
@history_retention_period = 4320