sp_MSchange_snapshot_agent_properties (Transact-SQL)
適用於:SQL Server
變更在 Microsoft SQL Server 2005 (9.x) 或更新版本散發者端執行的 快照集代理程式 作業屬性。 當發行者在 Microsoft sql Server 2000 (8.x) 實例上執行時,這個預存程式可用來變更屬性。 這個預存程式會在散發資料庫的散發者端執行。
語法
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'
這是發行者的名稱。 publisher 是 sysname,沒有預設值。
[ @publisher_db = ] 'publisher_db'
這是發行集資料庫的名稱。 publisher_db為 sysname,沒有預設值。
[ @publication = ] 'publication'
這是發行集的名稱。 publication 是 sysname,沒有預設值。
[ @frequency_type = ] frequency_type
這是執行 快照集代理程式的頻率。 frequency_type為 int,而且可以是下列其中一個值。
值 | 名稱 |
---|---|
1 | 一次 |
2 | [視需要] |
4 | 每日 |
8 | 每週 |
10 | 每月 |
20 | 每月,相對於頻率間隔 |
40 | 當 SQL Server Agent 啟動時 |
[ @frequency_interval = ] frequency_interval
這是要套用至frequency_type所設定頻率的值。 frequency_interval為 int,沒有預設值。
[ @frequency_subday = ] frequency_subday
這是freq_subday_interval的單位。 frequency_subday為 int,而且可以是下列其中一個值。
值 | 名稱 |
---|---|
1 | 一次 |
2 | 第二個 |
4 | Minute |
8 | Hour |
[ @frequency_subday_interval = ] frequency_subday_interval
這是frequency_subday的間隔。 frequency_subday_interval為 int,沒有預設值。
[ @frequency_relative_interval = ] frequency_relative_interval
這是 快照集代理程式 執行的日期。 frequency_relative_interval為 int,沒有預設值。
[ @frequency_recurrence_factor = ] frequency_recurrence_factor
這是frequency_type所使用的週期因數。 frequency_recurrence_factor為 int,沒有預設值。
[ @active_start_date = ] active_start_date
這是第一次排程 快照集代理程式 的日期,格式為 yyyyMMdd
。 active_start_date為 int,沒有預設值。
[ @active_end_date = ] active_end_date
這是 快照集代理程式 停止排程的日期,格式為 yyyyMMdd
。 active_end_date為 int,沒有預設值。
[ @active_start_time_of_day = ] active_start_time_of_day
這是第一次排程 快照集代理程式 的一天時間,格式為 HHmmss
。 active_start_time_of_day為 int,沒有預設值。
[ @active_end_time_of_day = ] active_end_time_of_day
這是 快照集代理程式 停止排程的時間,格式為 HHmmss
。 active_end_time_of_day為 int,沒有預設值。
[ @snapshot_job_name = ] 'snapshot_agent_name'
這是使用現有作業時現有的 快照集代理程式 作業名稱。 snapshot_agent_name為 nvarchar(100),沒有預設值。
[ @publisher_security_mode = ] publisher_security_mode
這是連接到發行者時代理程式所使用的安全性模式。 publisher_security_mode為 int,沒有預設值。 0 指定 SQL Server 驗證, 1 指定 Windows 驗證。 非 SQL Server 發行者必須指定 0 的值。 儘可能使用 Windows 驗證。
[ @publisher_login = ] 'publisher_login'
這是連接到發行者時所使用的登入。 publisher_login為 sysname,沒有預設值。 當 publisher_security_mode 為 0 時,必須指定publisher_login。 如果publisher_login為 NULL,且 publisher*_*security_mode為 1,則連線到發行者時會使用job_login中指定的 Windows 帳戶。
[ @publisher_password = ] 'publisher_password'
這是連接到發行者時所使用的密碼。 publisher_password為 nvarchar(524),沒有預設值。
重要
請勿將驗證資訊儲存在腳本檔案中。 為了協助改善安全性,建議您在運行時間提供登入名稱和密碼。
[ @job_login = ] 'job_login'
這是代理程序執行所在的 Windows 帳戶登入。 job_login為 nvarchar(257),沒有預設值。 此 Windows 帳戶一律用於與散發者的代理程式連線。 建立新的 快照集代理程式 作業時,您必須提供此參數。 無法變更非 SQL Server 發行者。
[ @job_password = ] 'job_password'
這是代理程序執行所在的 Windows 帳戶密碼。 job_password為 sysname,沒有預設值。 您必須在建立新的 快照集代理程式 作業時提供此參數。
重要
請勿將驗證資訊儲存在腳本檔案中。 為了協助改善安全性,建議您在運行時間提供登入名稱和密碼。
[ @publisher_type = ] 'publisher_type'
當發行者未在 SQL Server 實例中執行時,指定發行者類型。 publisher_type為 sysname,而且可以是下列其中一個值。
值 | Description |
---|---|
MSSQLSERVER | 指定 SQL Server 發行者。 |
神諭 | 指定標準 Oracle 發行者。 |
ORACLE 閘道 | 指定 Oracle 閘道發行者。 |
如需 Oracle 發行者與 Oracle 閘道發行者之間差異的詳細資訊,請參閱 Oracle 發行概觀。
傳回碼值
0 (成功) 或 1 (失敗)
備註
sp_MSchange_snapshot_agent_properties用於快照式複寫、事務複製和合併式複寫。
執行sp_MSchange_snapshot_agent_properties時,您必須指定所有參數。 執行 sp_helppublication_snapshot 以傳回 快照集代理程式 作業的目前屬性。
當發行者在 SQL Server 2005 (9.x) 或更新版本的實例上執行時,您應該使用 sp_changepublication_snapshot 來變更 快照集代理程式 作業的屬性。
權限
只有散發者端 sysadmin 固定伺服器角色的成員才能執行sp_MSchange_snapshot_agent_properties。