为 Oracle 发布程序配置事务集任务(复制 Transact-SQL 编程)

Xactset 作业是通过复制在 Oracle 发布服务器上创建的 Oracle 数据库作业,当日志读取器代理未连接到发布服务器时运行,以创建事务集。 可以使用复制存储过程以编程方式从分发服务器启用和配置此作业。 有关详细信息,请参阅 Oracle 发布服务器的性能优化

启用交易集合任务

  1. 在 Oracle 发布服务器上,将 job_queue_processes 初始化参数设置为足够的值,以允许 Xactset 作业运行。 有关此参数的详细信息,请参阅 Oracle 发布服务器的数据库文档。

  2. 在分发服务器上,执行sp_publisherproperty(Transact-SQL)。 指定 Oracle 发布服务器 @publisher 的名称,为 @propertyname 设定值 xactsetbatching,以及为 @propertyvalue 设定值 enabled

  3. 在分发服务器上,执行sp_publisherproperty(Transact-SQL)。@publisher 指定 Oracle 发布服务器的名称、@propertyname的值xactsetjobinterval,以及@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)。@publisher 指定 Oracle 发布服务器的名称,为 @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 发布服务器的性能优化
复制系统存储过程概念