sp_MSchange_snapshot_agent_properties (Transact-SQL)

變更執行於 Microsoft SQL Server 2005 散發者端之快照集代理程式作業的屬性。當發行者執行於 Microsoft SQL Server 2000 的執行個體時,會利用這個預存程序來變更 SQL Server 2005 屬性。這個預存程序執行於散發資料庫的散發者端。

主題連結圖示Transact-SQL 語法慣例

語法

sp_MSchange_snapshot_agent_properties [ @publisher = ] 'publisher'
        , [ @publisher_db = ] 'publisher_db'
        , [ @publication = ] 'publication' 
        , [ @frequency_type= ] frequency_type
        , [ @frequency_interval= ] frequency_interval
        , [ @frequency_subday= ] frequency_subday
        , [ @frequency_subday_interval= ] frequency_subday_interval
        , [ @frequency_relative_interval= ] frequency_relative_interval
        , [ @frequency_recurrence_factor= ] frequency_recurrence_factor
        , [ @active_start_date= ] active_start_date
        , [ @active_end_date= ] active_end_date
        , [ @active_start_time_of_day= ] active_start_time_of_day
        , [ @active_end_time_of_day= ] active_end_time_of_day
        , [ @snapshot_job_name = ] 'snapshot_agent_name'
        , [ @publisher_security_mode = ] publisher_security_mode
        , [ @publisher_login = ] 'publisher_login'
        , [ @publisher_password = ] 'publisher_password' 
        , [ @job_login = ] 'job_login'
        , [ @job_password = ] 'job_password'
        , [ @publisher_type = ] 'publisher_type'

引數

  • [ @publisher = ] 'publisher'
    這是發行者的名稱。publishersysname,沒有預設值。
  • [ @publisher_db= ] 'publisher_db'
    這是發行集資料庫的名稱。publisher_dbsysname,沒有預設值。
  • [ @publication = ] 'publication'
    這是發行集的名稱。publicationsysname,沒有預設值。
  • [ @frequency_type = ] frequency_type
    這是快照集代理程式的執行頻率。frequency_typeint,它可以是下列值之一。

    描述

    1

    一次

    2

    視需要

    4

    每日

    8

    每週

    10

    每月

    20

    每月,相對於頻率間隔

    40

    當 SQL Server Agent 啟動時

  • [ @frequency_interval = ] frequency_interval
    這是 frequency_type 設定的頻率所套用的值。frequency_intervalint,沒有預設值。
  • [ @frequency_subday = ] frequency_subday
    這是 freq_subday_interval 的單位。frequency_subdayint,它可以是下列值之一。

    描述

    1

    一次

    2

    4

    分鐘

    8

    小時

  • [ @frequency_subday_interval=] frequency_subday_interval
    這是 frequency_subday 的間隔。frequency_subday_intervalint,沒有預設值。
  • [ @frequency_relative_interval = ] frequency_relative_interval
    這是快照集代理程式的執行日期。frequency_relative_intervalint,沒有預設值。
  • [ @frequency_recurrence_factor = ] frequency_recurrence_factor
    這是 frequency_type 所用的循環因數。frequency_recurrence_factorint,沒有預設值。
  • [ @active_start_date = ] active_start_date
    這是第一次排程快照集代理程式的日期,格式為 YYYYMMDD。active_start_dateint,沒有預設值。
  • [ @active_end_date = ] active_end_date
    這是排程停止快照集代理程式的日期,格式為 YYYYMMDD。active_end_dateint,沒有預設值。
  • [ @active_start_time_of_day=] active_start_time_of_day
    這是第一次排程快照集代理程式的當日時間,格式為 HHMMSS。active_start_time_of_dayint,沒有預設值。
  • [ @active_end_time_of_day=] active_end_time_of_day
    這是排程停止快照集代理程式的當日時間,格式為 HHMMSS。active_end_time_of_dayint,沒有預設值。
  • [ @snapshot_job_name = ] 'snapshot_agent_name'
    這是在使用現有作業時,現有快照集代理程式作業的名稱。snapshot_agent_namenvarchar(100),沒有預設值。
  • [ @publisher_security_mode= ] publisher_security_mode
    這是連接到發行者時,代理程式所用的安全性模式。publisher_security_modeint,沒有預設值。0 指定 SQL Server 驗證,1 指定 Windows 驗證。非 SQL Server 發行者必須指定 0 值。
  • [ @publisher_login= ] 'publisher_login'
    這是連接到發行者時所用的登入。publisher_loginsysname,沒有預設值。當 publisher_security_mode0 時,必須指定 publisher_login。如果 publisher_login 是 NULL,publisher*_security_mode* 是 1,當連接到發行者時,就會使用 job_login 所指定的 Windows 帳戶。
  • [ @publisher_password= ] 'publisher_password'
    這是連接到發行者時所用的密碼。publisher_passwordnvarchar(524),沒有預設值。

    ms186263.security(zh-tw,SQL.90).gif安全性注意事項:
    請勿將驗證資訊儲存在指令碼檔案中。為了要有最佳的安全性,登入名稱和密碼應該在執行階段提供。
  • [ @job_login= ] 'job_login'
    這是執行代理程式之 Windows 帳戶的登入。job_loginnvarchar(257),沒有預設值。通往散發者的代理程式連接一律使用這個 Windows 帳戶。您必須在建立新的快照集代理程式作業時,提供這個參數。 SQL Server 發行者的這個項目不能變更。
  • [ @job_password= ] 'job_password'
    這是執行代理程式之 Windows 帳戶的密碼。job_passwordsysname,沒有預設值。您必須在建立新的快照集代理程式作業時,提供這個參數。

    ms186263.security(zh-tw,SQL.90).gif安全性注意事項:
    請勿將驗證資訊儲存在指令碼檔案中。為了要有最佳的安全性,登入名稱和密碼應該在執行階段提供。
  • [ @publisher_type= ] 'publisher_type'
    指定當發行者不是在 SQL Server 執行個體中執行時的發行者類型。publisher_typesysname,它可以是下列值之一。

    描述

    MSSQLSERVER

    指定 SQL Server 發行者。

    ORACLE

    指定標準 Oracle 發行者。

    ORACLE GATEWAY

    指定 Oracle Gateway 發行者。

    如需有關 Oracle 發行者和 Oracle Gateway 發行者之差異的詳細資訊,請參閱<Oracle 發行概觀>。

傳回碼值

0 (成功) 或 1 (失敗)

備註

sp_MSchange_snapshot_agent_properties 用於快照式複寫、交易式複寫和合併式複寫中。

當執行 sp_MSchange_snapshot_agent_properties 時,您必須指定所有參數。請執行 sp_helppublication_snapshot 來傳回快照集代理程式作業目前的屬性。

當發行者執行於 SQL Server 2005 執行個體時,您應該利用 sp_changepublication_snapshot 來變更快照集代理程式作業的屬性。

權限

只有在散發者端的系統管理員 (sysadmin) 固定伺服器角色成員,才能夠執行 sp_MSchange_snapshot_agent_properties

請參閱

參考

sp_addpublication_snapshot (Transact-SQL)

其他資源

在複寫拓撲中使用多個 SQL Server 版本

說明及資訊

取得 SQL Server 2005 協助