共用方式為


設定 Oracle 發行者的交易集作業(複寫 Transact-SQL 程式設計)

Xactset 作業是由復寫所建立的 Oracle 資料庫作業,會在記錄讀取器代理程式未連線到發行者時,於 Oracle 發行者端執行,以建立交易集。 您可以使用複寫預存程序,以程式設計方式從發行者啟用和設定此作業。 如需詳細資訊,請參閱 Oracle 發行者的效能微調

啟用交易集任務

  1. 在 Oracle 發行者上,將 job_queue_processes 初始化參數設定為足夠的值,以允許 Xactset 作業執行。 如需此參數的詳細資訊,請參閱 Oracle 發行者的資料庫檔。

  2. 在散發者端,執行 sp_publisherproperty (Transact-SQL) 。 針對 @publisher 指定 Oracle 發行者的名稱,為 @propertyname 指定xactsetbatching 的值,並為 @propertyvalue 指定enabled 的值。

  3. 在散發者端,執行 sp_publisherproperty (Transact-SQL) 。 針對 @publisher 指定 Oracle 發行者的名稱、@propertyname 的值,以及作業間隔(以分鐘為單位),為 @propertyvalue 指定一個值。

  4. 在散發者端,執行 sp_publisherproperty (Transact-SQL) 。 針對 @publisher 指定 Oracle 發行者的名稱,為 @propertyname 指定值 xactsetjob,以及為 @propertyvalue 指定值 enabled

設定交易組作業

  1. (選擇性)在散發者端,執行 sp_publisherproperty (Transact-SQL) 。 為 @publisher指定 Oracle 發行者的名稱。 這會傳回發行者端 Xactset 作業的屬性。

  2. 在散發者端,執行 sp_publisherproperty (Transact-SQL) 。 針對 @publisher 指定 Oracle 發行者的名稱、針對 @propertyname 設定的 Xactset 作業屬性名稱,以及 @propertyvalue的新設定。

  3. (選擇性)針對所設定的每個 Xactset 作業屬性重複步驟 2。 變更 xactsetjobinterval 屬性時,您必須重新啟動 Oracle 發行者上的作業,新的間隔才會生效。

若要檢視交易集作業的屬性

  1. 在散發者端,執行 sp_helpxactsetjob。 為 @publisher指定 Oracle 發行者的名稱。

若要停用交易集作業

  1. 在散發者端,執行 sp_publisherproperty (Transact-SQL) 。 指定 Oracle 發行者 @publisher 的名稱、@propertyname 的值xactsetjob,以及 @propertyvalue 的值disabled

範例

下列範例會啟用 Xactset 作業,並將執行之間的間隔設定為三分鐘。

-- This script uses sqlcmd scripting variables. They are in the form
-- $(MyVariable). For information about how to use scripting variables  
-- on the command line and in SQL Server Management Studio, see the 
-- "Executing Replication Scripts" section in the topic
-- "Programming Replication Using System Stored Procedures".

DECLARE @publisher AS sysname;
SET @publisher = $(Publisher);

-- Enable the creation of transaction sets
-- at the Oracle Publisher.
EXEC sp_publisherproperty 
  @publisher = @publisher, 
  @propertyname = N'xactsetbatching', 
  @propertyvalue = N'enabled';

-- Set the job interval before enabling
-- the job, otherwise the job must be restarted.
EXEC sp_publisherproperty 
  @publisher = @publisher, 
  @propertyname = N'xactsetjobinterval', 
  @propertyvalue = N'3';

-- Enable the transaction set job.
EXEC sp_publisherproperty 
  @publisher = @publisher, 
  @propertyname = N'xactsetjob', 
  @propertyvalue = N'enabled';
GO

另請參閱

Oracle 發行者的效能調整
復寫系統預存程式概念