Goldengate Best Parameters & TEST from Maclean

Sample
drop user ogg_maclean cascade;
create user ogg_maclean identified by oracle;
alter user ogg_maclean default tablespace users;
grant connect,resource to OGG_MACLEAN;

OGG_MACLEAN

maclean_press

conn ogg_maclean/oracle
create table maclean_press1(a int constraint key1 primary key,b varchar2(100),c varchar2(100),d date default sysdate,e date);
create table maclean_press2(a int constraint key2 primary key,b varchar2(100),c varchar2(100),d date default sysdate,e date);
create table maclean_press3(a int constraint key3 primary key,b varchar2(100),c varchar2(100),d date default sysdate,e date);
create table maclean_press4(a int constraint key4 primary key,b varchar2(100),c varchar2(100),d date default sysdate,e date);
create table maclean_press5(a int constraint key5 primary key,b varchar2(100),c varchar2(100),d date default sysdate,e date);
create table maclean_press6(a int constraint key6 primary key,b varchar2(100),c varchar2(100),d date default sysdate,e date);
create table maclean_press7(a int constraint key7 primary key,b varchar2(100),c varchar2(100),d date default sysdate,e date);
create table maclean_press8(a int constraint key8 primary key,b varchar2(100),c varchar2(100),d date default sysdate,e date);
create table maclean_press9(a int constraint key9 primary key,b varchar2(100),c varchar2(100),d date default sysdate,e date);
create table maclean_press10(a int constraint key10 primary key,b varchar2(100),c varchar2(100),d date default sysdate,e date);

create or replace procedure trouble_ogg_sql as 
begin 
    for i in 1..2000000 loop
        insert into maclean_press1(a,b,c,d) values(i,i,i,sysdate);
        insert into maclean_press2(a,b,c,d) values(i,i,i,sysdate);
        insert into maclean_press3(a,b,c,d) values(i,i,i,sysdate);
        insert into maclean_press4(a,b,c,d) values(i,i,i,sysdate);
        insert into maclean_press5(a,b,c,d) values(i,i,i,sysdate);
        insert into maclean_press6(a,b,c,d) values(i,i,i,sysdate);
        insert into maclean_press7(a,b,c,d) values(i,i,i,sysdate);
        insert into maclean_press8(a,b,c,d) values(i,i,i,sysdate);
        insert into maclean_press9(a,b,c,d) values(i,i,i,sysdate);
        insert into maclean_press10(a,b,c,d) values(i,i,i,sysdate);
        if mod(i,2000)=0 then
            commit;
        end if;
    end loop;

        delete from maclean_press1 where a <= 10000;
         commit;
EXECUTE IMMEDIATE('alter table maclean_press1 move');
EXECUTE IMMEDIATE('alter index key1 rebuild');
        delete from maclean_press2 where a <= 10000;
        commit;
EXECUTE IMMEDIATE('alter table maclean_press2 move');
EXECUTE IMMEDIATE('alter index key2 rebuild');
delete from maclean_press3 where a <= 10000;
        commit;
EXECUTE IMMEDIATE('alter table maclean_press3 move');
EXECUTE IMMEDIATE('alter index key3 rebuild');
delete from maclean_press4 where a <= 10000;
    commit;        
EXECUTE IMMEDIATE('alter table maclean_press4 move');
EXECUTE IMMEDIATE('alter index key4 rebuild');
delete from maclean_press5 where a <= 10000;
commit;
EXECUTE IMMEDIATE('alter table maclean_press5 move');
EXECUTE IMMEDIATE('alter index key5 rebuild');
delete from maclean_press6 where a <= 10000;
commit;
EXECUTE IMMEDIATE('alter table maclean_press6 move');
EXECUTE IMMEDIATE('alter index key6 rebuild');
delete from maclean_press7 where a <= 10000;
commit;
EXECUTE IMMEDIATE('alter table maclean_press7 move');
EXECUTE IMMEDIATE('alter index key7 rebuild');
delete from maclean_press8 where a <= 10000;
commit;
EXECUTE IMMEDIATE('alter table maclean_press8 move');
EXECUTE IMMEDIATE('alter index key8 rebuild');
delete from maclean_press9 where a <= 10000;
commit;
EXECUTE IMMEDIATE('alter table maclean_press9 move');
EXECUTE IMMEDIATE('alter index key9 rebuild');
delete from maclean_press10 where a <= 10000;
        commit;
EXECUTE IMMEDIATE('alter table maclean_press10 move');
EXECUTE IMMEDIATE('alter index key10 rebuild');

for i in 1..1 loop
        update maclean_press1 set b=b+1 where a <= 20000;
         commit;
        update maclean_press2 set b=b+1 where a <= 20000;
        commit;
        update maclean_press3 set b=b+1 where a <= 20000;
        commit;
        update maclean_press4 set b=b+1 where a <= 20000;
    commit;        
        update maclean_press5 set b=b+1 where a <= 20000;
commit;
        update maclean_press6 set b=b+1 where a <= 20000;
commit;
        update maclean_press7 set b=b+1 where a <= 20000;
commit;
        update maclean_press8 set b=b+1 where a <= 20000;
commit;
        update maclean_press9 set b=b+1 where a <= 20000;
commit;
        update maclean_press10 set b=b+1 where a <= 20000;
        commit;
end loop;

for i in 1..1 loop
        delete from maclean_press1 where a > 30000 and a <= 40000;
         commit;
        delete from maclean_press2 where a > 30000 and a <= 40000;
        commit;
delete from maclean_press3 where a > 30000 and a <= 40000;
        commit;
delete from maclean_press4 where a > 30000 and a <= 40000;
    commit;        
delete from maclean_press5 where a > 30000 and a <= 40000;
commit;
delete from maclean_press6 where a > 30000 and a <= 40000;
commit;
delete from maclean_press7 where a > 30000 and a <= 40000;
commit;
delete from maclean_press8 where a > 30000 and a <= 40000;
commit;
delete from maclean_press9 where a > 30000 and a <= 40000;
commit;
delete from maclean_press10 where a > 30000 and a <= 40000;
        commit;
end loop;
end;
/

exec  ogg_maclean.trouble_ogg_sql;

select count(*),sum(a),sum(b) from maclean_press1;
select count(*),sum(a),sum(b) from maclean_press2;
select count(*),sum(a),sum(b) from maclean_press3;
select count(*),sum(a),sum(b) from maclean_press4;
select count(*),sum(a),sum(b) from maclean_press5;
select count(*),sum(a),sum(b) from maclean_press6;
select count(*),sum(a),sum(b) from maclean_press7;
select count(*),sum(a),sum(b) from maclean_press8;
select count(*),sum(a),sum(b) from maclean_press9;
select count(*),sum(a),sum(b) from maclean_press10;

主键更新测试(针对Quest)

create table tb1a (id number primary key, name varchar(30));
执行以下sql进行主键更新:
Begin
for i in 1..1000 loop
insert into tb1a values (i, 'aaa');
end loop;
commit;
update tb1a set id=id+100;
commit;
end;
/

select min(id),max(id),sum(id) from tb1a;

分区表

 create table maclean_partition (acct_no number(12),person varchar2(30),week_no number(2)) partition by range (week_no) 
(partition jan values less than(4),partition feb values less than(8),partition others values less than (maxvalue)) enable row movement;

  insert into maclean_partition values(1,'a',2);
 insert into maclean_partition values(2,'b',6);
 insert into maclean_partition values(3,'c',10);
 insert into maclean_partition values(6,'d',6);
 insert into maclean_partition values(8,'e',8);
 insert into maclean_partition values(9,'e',9);
 commit;
 update maclean_partition set person='d' where acct_no=2;
 commit;
 delete maclean_partition where acct_no=1;
 commit;

==========================================================================================================

ASM 的 tnsnames.ora 以及配置监听静态注册

===========================================================================================================

解压软件,配置ogg.sh 

export  GG_HOME=/goldengate
export  LD_LIBRARY_PATH=$ORACLE_HOME/lib   

    GGSCI> create subdirs

打开归档

Select log_mode from v$database;

shutdown immediate;
startup mount;
alter database archivelog;
alter database open;

Select  
SUPPLEMENTAL_LOG_DATA_MIN
,SUPPLEMENTAL_LOG_DATA_PK
,SUPPLEMENTAL_LOG_DATA_UI
,SUPPLEMENTAL_LOG_DATA_FK
,SUPPLEMENTAL_LOG_DATA_ALL from v$database;

alter database add supplemental log data ;
--alter database add supplemental log data (primary key, unique,foreign key) columns;
alter system switch logfile;

Select  
SUPPLEMENTAL_LOG_DATA_MIN
,SUPPLEMENTAL_LOG_DATA_PK
,SUPPLEMENTAL_LOG_DATA_UI
,SUPPLEMENTAL_LOG_DATA_FK
,SUPPLEMENTAL_LOG_DATA_ALL from v$database;

Alter database force logging;

创建ogg 用户

--create tablespace
create tablespace goldengate datafile  size 1024M ;

-- Create the user 
create user goldengate identified by &A default tablespace goldengate;

-- Grant role privileges 
grant  resource, connect, dba to goldengate;

grant create any table to goldengate;
grant create any view to goldengate;
grant create any procedure to goldengate;
grant create any sequence to goldengate;
grant create any index to goldengate;
grant create any trigger to goldengate;
grant create any view to goldengate;

===========================================================================================================
[oracle@vrh1 ~]$ cat ogg.sh

export ORACLE_HOME=/s01/orabase/product/11.2.0/dbhome_1
export ORACLE_SID=VRAC1
export LD_LIBRARY_PATH=/ogg:$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export PATH=/home/oracle/ogg:$PATH

cd /home/oracle/ogg
ggsci 

===========================================================================================================

./GLOBALS

GGSCHEMA goldengate
CheckpointTable goldengate.ckpt
UnlockedTrailFiles

===========================================================================================================

MGR

Port 7809
userid goldengate , password oracle
DYNAMICPORTLIST 9101-9356
CheckMinutes 10
PurgeOldExtracts ./dirdat/*, UseCheckpoints, MinKeepHours 96
PurgeMarkerHistory MinKeepDays 3, MaxKeepDays 7, FrequencyMinutes 120
AutoRestart ER *, WaitMinutes 5, Retries 3
LagInfoMinutes 0
LagReportMinutes 10

===========================================================================================================

源端DDL

cd ogg

 GRANT EXECUTE ON UTL_FILE TO goldengate;

  ALTER SYSTEM SET RECYCLEBIN =OFF SCOPE =BOTH;

11g中 只能ALTER SYSTEM SET RECYCLEBIN =OFF SCOPE =SPFILE; 之后重启

   @marker_setup.sql
    @ddl_setup.sql
    @role_setup.sql

    GRANT GGS_GGSUSER_ROLE TO goldengate;
     @ddl_enable.sql
     @ddl_pin.sql goldengate
     @sequence.sql

dblogin userid  goldengate ,     password oracle
add checkpointtable goldengate.ckpt

ADD TRANDATA XX.XX

===========================================================================================================

add extract ext01, tranlog , begin now , threads 2 
add exttrail ./dirdat/ml , extract ext01 , megabytes 200

extract ext01
SETENV (ORACLE_HOME="/s01/orabase/product/11.2.0/dbhome_1" )
SETENV (ORACLE_SID="VRAC1")
SETENV (NLS_LANG = "AMERICAN_AMERICA.AL32UTF8")
--TRANLOGOPTIONS EXCLUDEUSER <Replicat username>
--CacheMgr CacheDirectory ./dirtmp 51980MB, CacheDirectory ./dirtmp/goldengate_tmp
userid goldengate , password oracle
--TranLogOptions ExcludeUser goldengate
--TranLogOptions AltArchivedLogFormat Instance NETDB1 %t_%s_%r.dbf
--TranLogOptions AltArchivedLogFormat Instance NETDB2 %t_%s_%r.dbf
--TranLogOptions AltArchiveLogDest Primary Instance NETDB1 /arch1, AltArchiveLogDest Instance NETDB2 /arch2
tranlogoptions asmuser sys@ASM , ASMPASSWORD oracle
--TRANLOGOPTIONS DBLOGREADER, DBLOGREADER BUFSIZE [x], BUFSIZE [y]
ThreadOptions MaxCommitPropagationDelay 10000 IOLatency 3000
exttrail ./dirdat/ml
DDL Include ALL
--DDL INCLUDE ALL, EXCLUDE OBJNAME "<schema name>.<object name> "
DDLOptions AddTranData, Report
DDLOptions NoCrossRename, Report
Table ogg_maclean.*;

-- Prevent data looping. This is generally used in bi-directional
-- configuration
TRANLOGOPTIONS EXCLUDEUSER <Replicat username>
===========================================================================================================
add extract pump01, EXTTRAILSOURCE ./dirdat/ml 
add rmttrail ./dirdat/ml , extract pump01, megabytes 200

pump 

extract pump01
SETENV (ORACLE_HOME = "<Oracle home path>" )
SETENV (ORACLE_SID="<Oracle sid>")

passthru
rmthost 192.168.1.179 , mgrport 7809 
rmttrail ./dirdat/ml
--DISCARDFILE <diacard file path/<discard file name.dsc>, APPEND Megabytes <n>
table ogg_maclean.*;

===========================================================================================================

add replicat rep01, exttrail ./dirdat/ml

replicat 

replicat rep01
SETENV (ORACLE_HOME = "/s01/oracle/app/oracle/product/11.2.0/dbhome_1" )
SETENV (ORACLE_SID="PRODA")
SETENV (NLS_LANG ="American_America.AL32UTF8")
userid goldengate , password oracle
--HandleCollisions
AssumeTargetDefs
DiscardFile ./dirrpt/rep1.dsc, APPEND Megabytes 800 ,  Purge
DBOptions DeferrefConst
DBOptions SuppressTriggers    
MaxTransOps 10000
GroupTransOps 1000
SQLEXEC "ALTER SESSION SET COMMIT_WRITE = BATCH,NOWAIT"
BatchSQL
--DDL INCLUDE ALL, EXCLUDE OBJNAME "<schema name>.<object name> "
DDLOptions Report
DDLError 24344 Ignore
DDLError 4052 Ignore
DDLError 955 Ignore
DDLError 1408 Ignore
DDLError 911 Ignore
AllowNoOpUpdates
CheckSequenceValue
--IGNORETRUNCATES
--DEFERAPPLYINTERVAL 1 MINUTES
-- Sequence testgg.*, Target testgg.*
MapExclude ogg_maclean.SYS_EXPORT_SCHEMA* ;
map ogg_maclean.* , target ogg_maclean.* ;

--DDLOPTIONS SUPPRESSTRIGGERS
--The SUPPRESSTRIGGERS parameter prevents triggers from firing on 
target objects that are configured for replication with Oracle GoldenGate. 
This alleviates the need to manually disable triggers and constraints.  
To use this option, the Replicat user must be an Oracle Streams administrator 
which can be granted by invoking dbms_goldengate_auth.grant_admin_privilege.
Available FROM ORACLE 10.2.0.5 AND Later Patches and Oracle 11.2.0.2

================================================================================================

DROP TABLE gg_test;
CREATE TABLE gg_test
(
    a        number(10),
    b             VARCHAR20(30),
        PRIMARY KEY (a)
        );
4.8    100字段表测试脚本
create table table_100cols
(
a1        number(10) not null,
a2        number(10),
a3        number(10),
a4        number(10),
a5        number(10),
a6        number(10),
a7        number(10),
a8        number(10),
a9        number(10),
a10       number(10),
a11       number(10),
a12       number(10),
a13       number(10),
a14       number(10),
a15       number(10),
a16       number(10),
a17       number(10),
a18       number(10),
a19       number(10),
a20       number(10),
a21       number(10),
a22       number(10),
a23       number(10),
a24       number(10),
a25       number(10),
a26       number(10),
a27       number(10),
a28       number(10),
a29       number(10),
a30       number(10),
a31       number(10),
a32       number(10),
a33       number(10),
a34       number(10),
a35       number(10),
a36       number(10),
a37       number(10),
a38       number(10),
a39       number(10),
a40       number(10),
a41       number(10),
a42       number(10),
a43       number(10),
a44       number(10),
a45       number(10),
a46       number(10),
a47       number(10),
a48       number(10),
a49       number(10),
a50       number(10),
a51       number(10),
a52       number(10),
a53       number(10),
a54       number(10),
a55       number(10),
a56       number(10),
a57       number(10),
a58       number(10),
a59       number(10),
a60       number(10),
a61       number(10),
a62       number(10),
a63       number(10),
a64       number(10),
a65       number(10),
a66       number(10),
a67       number(10),
a68       number(10),
a69       number(10),
a70       number(10),
a71       number(10),
a72       number(10),
a73       number(10),
a74       number(10),
a75       number(10),
a76       number(10),
a77       number(10),
a78       number(10),
a79       number(10),
a80       number(10),
a81       number(10),
a82       number(10),
a83       number(10),
a84       number(10),
a85       number(10),
a86       number(10),
a87       number(10),
a88       number(10),
a89       number(10),
a90       number(10),
a91       number(10),
a92       number(10),
a93       number(10),
a94       number(10),
a95       number(10),
a96       number(10),
a97       number(10),
a98       number(10),
a99       number(10),
a100      number(10)
)

alter table table_100cols
  add constraint PK_100cols primary key (a1)
  using index 
  tablespace CS_stat
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );

  alter table table_100cols
  add constraint PK_100cols primary key (a1)
  using index 
  tablespace users
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );

  insert into table_100cols values(1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
100);
4.9    性能测试脚本
create sequence seq_gg start with 1 INCREMENT BY 1 MAXVALUE 999999999 cache 500000;

create or replace procedure gg_insert
is
begin
    for i in 1..1000000 loop
        insert into CM_USER (USER_ID,REGION_CODE,ACC_ID,CAUT_ID,USER_STATUS,USER_TYPE)
        values(seq_gg.nextval,571,1111,2222,3,4);
        if mod(i,1000)=0 then
            commit;
        end if;
    end loop;
    commit;
end;
/

create or replace procedure gg_update
is
CURSOR c_gg IS
    SELECT rowid FROM CM_USER;
v_rowid UROWID;
i number(10);
BEGIN
    OPEN c_gg;
    for i in 1..1000000 loop
        FETCH c_gg INTO v_rowid;
        EXIT WHEN c_gg%NOTFOUND;

        UPDATE CM_USER SET ACC_ID=seq_gg.nextval WHERE rowid = v_rowid;
        if mod(i,1000)=0 then
            commit;
        end if;
    end loop;
    commit;
    CLOSE c_gg;
END;
/

create or replace procedure gg_delete
is
begin
    for i in 1..1000 loop
        delete from  CM_USER where rownum<1001;
        commit;
    end loop;
    commit;
end;
/

 

 

attachment:

ogg parameters

 

 

 

Oracle GoldenGate 在其新推出的版本11.2 中提供了全方位的多字节支持,
可实现对表名/列名,以及DDL 中常见多字节文字如中文的支持。

注意:不同字符集DML 复制必须要将目标的NLS_LANG 变量设置为源端的NLS_LANG 实际值。

 

实验证明,本版本可以支持相同和不同字符集之间带有多字节对象以及数据的DML 和DDL 复制。

新版本的 DDL 复制默认不再开启 addtrandata,需要手工配置ddloptions。Oracle 11.2.0.2以上版本则推荐使用schema level 附加日志,参考步骤:

改用schemal level trandata:
SQL> exec dbms_streams_auth.grant_admin_privilege(‘ogg’);
GGSCI (dbsrv64.localdomain) 2> dblogin userid ogg
GGSCI (dbsrv64.localdomain) 3> ADD SCHEMATRANDATA source
2012-02-23 03:26:04 INFO OGG-01788 SCHEMATRANDATA has
been added on schema source.

 

注意:目前似乎不支持在 map 或者 table 里面使用中文进行匹配,
需要进一步验证。例如下面的将全部被认为是unmapped:
map source.中文*, target target.*;
如果两端字符集不同,则需要将目标的 NLS_LANG 变量设置为源
端的NLS_LANG实际值,可参考之前的最佳实践。
使用defgen 可以指定生成的表定义文件编码,不过实际配置要注意环境变量与数据库环境变量的统一,例如中文环境参考如下:
NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
LANG=zh_CN.GBK

 

Oracle GoldenGate 在其新推出的版本11.2 中提供了两种模式抽取:
1 传统的挖掘日志模式;
2 新的整合捕获模式。该模式使用了Oracle XStream 接口进行数据捕捉。

 schema level trandata 必须要Oracle 11.2.0.2 以上;
 整合模式只有在11.2.0.3 以上才能支持更为广泛的数据类型。

 

1) 数据库打开最小附加日志;
alter database add supplemental log data;
2) 为source schema 加入schema level 附加日志:
SQL> exec dbms_streams_auth.grant_admin_privilege(‘ogg’);
GGSCI (dbsrv64.localdomain) 2> dblogin userid ogg
GGSCI (dbsrv64.localdomain) 3> ADD SCHEMATRANDATA source
2012-02-23 03:26:04 INFO OGG-01788 SCHEMATRANDATA has been
added on schema source.
3) 给抽取进程用户赋予admin 权限:
begin
DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE(
grantee => ‘source’,
privilege_type => ‘capture’,
grant_select_privileges => true,
do_grants => TRUE
);
end;
/
4) 在数据库中注册抽取进程,此时会自动配置XStream:
DBLOGIN USERID source, PASSWORD oracle
REGISTER EXTRACT ext01 DATABASE
5) 配置OGG 的extract 和replicat 进程
ADD EXTRACT ext01, INTEGRATED TRANLOG, BEGIN NOW

 

 

Add exttrail ./dirdat/ml, ext ext01
Add rep rep01, exttrail ./dirdat/ia
GGSCI (dbsrv64.localdomain) 5> view param ext01
EXTRACT ext01
SETENV (ORACLE_SID = “oragbk”)
–SETENV (NLS_LANG = “AMERICAN_AMERICA.ZHS16GBK”)
SETENV (NLS_LANG = “SIMPLIFIED CHINESE_CHINA.ZHS16GBK”)
USERID source, PASSWORD oracle
ddl include all
–ddloptions addtrandata,report
ddloptions report
tranlogoptions dblogreader
EXTTRAIL ./dirdat/ml
dynamicresolution
tableexclude source.AQ*;
tableexclude source.OGG*;
tableexclude source.SYS*;
table source.*;

 

GGSCI (dbsrv64.localdomain) 6> view param rep01
replicat rep01

 

–checkparams
–SETENV (ORACLE_SID = “oragbk”)
SETENV (ORACLE_SID = “orautf”)
SETENV (NLS_LANG = “SIMPLIFIED CHINESE_CHINA.ZHS16GBK”)
–SETENV (NLS_LANG = “AMERICAN_AMERICA.AL32UTF8”)
userid target, password oracle
ddl include mapped
ddlerror 24344,ignore
ddlerror 955,ignore
–DDLOPTIONS REPORT
reperror default,discard
–reperror default, abend
discardfile ./dirrpt/repia.dsc,append
assumetargetdefs
map source.*, target target.*;
6) 确认进程启动后,在源端添加中文表,并增加和更新记录,成功。
注意:
使用整合模式会在extract 用户下建立一些AQ$/SYS/OGG$开头的表,建议使用一个专门用户。本例子中直接抽取了source 自己的表,需要将这些系统表排除掉

 

 

GGSCI (mlab2.oracle.com) 2>  ADD SCHEMATRANDATA ogg_maclean

2013-11-24 00:42:48  ERROR   OGG-01790  Failed to ADD SCHEMATRANDATA on schema ogg_maclean because of the following SQL error: ORA-26947: Oracle GoldenGate replication is not enabled.
ORA-06512: at “SYS.DBMS_CAPTURE_ADM_INTERNAL”, line 1565
ORA-06512: at “SYS.DBMS_CAPTURE_ADM_INTERNAL”, line 1074
ORA-06512: at “SYS.DBMS_CAPTURE_ADM”, line 722
ORA-06512: at line 1 SQL BEGIN sys.dbms_capture_adm.PREPARE_SCHEMA_INSTANTIATION(‘ogg_maclean’,’ALLKEYS_ON’); END;.

GGSCI (mlab2.oracle.com) 3> ADD SCHEMATRANDATA  goldengate;

2013-11-24 00:43:29  ERROR   OGG-01796  Schema: goldengate;, does not exist.

GGSCI (mlab2.oracle.com) 4> ADD SCHEMATRANDATA  goldengate

2013-11-24 00:43:38  ERROR   OGG-01790  Failed to ADD SCHEMATRANDATA on schema goldengate because of the following SQL error: ORA-26947: Oracle GoldenGate replication is not enabled.
ORA-06512: at “SYS.DBMS_CAPTURE_ADM_INTERNAL”, line 1565
ORA-06512: at “SYS.DBMS_CAPTURE_ADM_INTERNAL”, line 1074
ORA-06512: at “SYS.DBMS_CAPTURE_ADM”, line 722
ORA-06512: at line 1 SQL BEGIN sys.dbms_capture_adm.PREPARE_SCHEMA_INSTANTIATION(‘goldengate’,’ALLKEYS_ON’); END;.

11.2.0.4中需要设置

SQL> alter system set enable_goldengate_replication=true;

System altered.

 

 

WARNING OGG-02051 Not enough database memory to service Extract in integrated capture.

==>Streams: resolve low memory condition+LogMiner reader: buffer+LogMiner builder: memory=> Streams Pool Size 不足 增大streams_pool_size即可

 

 

 

source: HP-IA 192.168.174.201/202    root/roothp sys/sys or oracle
target: Linux  192.168.110.200/116.180 root/roothp 
安装目录:/app/ogg/va

复制表: unipostdb.
T_PUB_JNL_SAV
T_PUB_UNREG
T_CDM_LEDGER

TMP_CARD_LEDGER                TABLE
TMP_LEDGER                     TABLE
TRIG_CDM_LEDGER                TABLE
T_CARD_ACC                     TABLE
T_CARD_ATM                     TABLE
T_CARD_LEDGER                  TABLE
T_CDM_LEDGER                   TABLE
T_PUB_JNL_SAV                  TABLE
T_PUB_UNREG                    TABLE
UNIPOSTDB_TEST                 TABLE
UNREG_BAK                      TABLE

conn unipostdb/unipostdb

select count(*) from unipostdb.T_PUB_JNL_SAV;
select count(*) from unipostdb.T_PUB_UNREG;
select count(*) from unipostdb.T_CDM_LEDGER;

 truncate table unipostdb.T_PUB_JNL_SAV;

truncate table unipostdb.T_PUB_UNREG;

alter extga, begin now
alter extgb, begin now
alter extgc, begin now
alter extgd, begin now

Set pages 999
Set long 4000
Select dbms_metadata.get_ddl('TABLE', 'T_PUB_JNL_SAV', 'UNIPOSTDB') from dual;
Select dbms_metadata.get_ddl('TABLE', 'T_PUB_UNREG', 'UNIPOSTDB') from dual;
Select dbms_metadata.get_ddl('TABLE', 'T_CDM_LEDGER', 'UNIPOSTDB') from dual;

 ,CLT_SEQNO 

col table_name for a20
col constraint_name for a20
col column_name for a20
select cols.table_name,cols.constraint_name,cols.column_name from user_cons_columns cols, user_constraints cons 
where  cons.table_name = 'T_PUB_UNREG'  and cols.constraint_name=cons.constraint_name;

GLOBALS:
CHECKPOINTTABLE ogg.chkpt
GGSCHEMA ogg

ogg source:
add checkpointtab 

add ext extga, tranlog, begin now, threads 2
add rmttrail ./dirdat/ra, ext extga, megabytes 100

add ext extgb, tranlog, begin now, threads 2
add rmttrail ./dirdat/rb, ext extgb, megabytes 100

add ext extgc, tranlog, begin now, threads 2
add rmttrail ./dirdat/rc, ext extgc, megabytes 100

EXTRACT extga
USERID ogg, PASSWORD ogg
rmthost  192.168.110.200, mgrport 7809
rmttrail ./dirdat/ra 
TRANLOGOPTIONS DBLOGREADER
TRANLOGOPTIONS BUFSIZE 10000000, DBLOGREADERBUFSIZE 4194304
REPORTCOUNT EVERY 2 MINUTES, RATE
--dynamicresolution
--GETTRUNCATES
table unipostdb.T_PUB_JNL_SAV;

EXTRACT extgb
USERID ogg, PASSWORD ogg
rmthost  192.168.110.200, mgrport 7809
rmttrail ./dirdat/rb 
TRANLOGOPTIONS DBLOGREADER
TRANLOGOPTIONS BUFSIZE 10000000, DBLOGREADERBUFSIZE 4194304
REPORTCOUNT EVERY 2 MINUTES, RATE
--dynamicresolution
--GETTRUNCATES
table unipostdb.T_PUB_UNREG;

EXTRACT extgc
USERID ogg, PASSWORD ogg
TRANLOGOPTIONS DBLOGREADER
TRANLOGOPTIONS BUFSIZE 10000000, DBLOGREADERBUFSIZE 4194304
rmthost  192.168.110.200, mgrport 7809
rmttrail ./dirdat/rc 
REPORTCOUNT EVERY 2 MINUTES, RATE
--dynamicresolution
--GETTRUNCATES
table unipostdb.T_CDM_LEDGER;

ogg target:
-----------------------------------------------------
add rep repaa, exttrail ./dirdat/ra

replicat repaa
userid ogg, password ogg
reperror default, abend
discardfile ./dirrpt/repaa.dsc,append, megabytes 10
REPORTCOUNT EVERY 2 MINUTES, RATE
GROUPTRANSOPS 2000
BATCHSQL
assumetargetdefs
--allownoopupdates
--dynamicresolution
map unipostdb.T_PUB_JNL_SAV, target unipostdb.T_PUB_JNL_SAV, FILTER ( @RANGE (1, 3) );

add rep repab, exttrail ./dirdat/ra

replicat repab
userid ogg, password ogg
reperror default, abend
discardfile ./dirrpt/repab.dsc,append, megabytes 10
REPORTCOUNT EVERY 2 MINUTES, RATE
GROUPTRANSOPS 2000
BATCHSQL
assumetargetdefs
--allownoopupdates
--dynamicresolution
map unipostdb.T_PUB_JNL_SAV, target unipostdb.T_PUB_JNL_SAV, FILTER ( @RANGE (2, 3) );

add rep repac, exttrail ./dirdat/ra

replicat repac
userid ogg, password ogg
reperror default, abend
discardfile ./dirrpt/repac.dsc,append, megabytes 10
REPORTCOUNT EVERY 2 MINUTES, RATE
GROUPTRANSOPS 2000
BATCHSQL
assumetargetdefs
--allownoopupdates
--dynamicresolution
map unipostdb.T_PUB_JNL_SAV, target unipostdb.T_PUB_JNL_SAV, FILTER ( @RANGE (3, 3) );
-------------------------------------------

add rep repba, exttrail ./dirdat/rb
edit param repba

replicat repba
userid ogg, password ogg
reperror default, abend
discardfile ./dirrpt/repba.dsc,append, megabytes 10
REPORTCOUNT EVERY 2 MINUTES, RATE
GROUPTRANSOPS 2000
BATCHSQL
assumetargetdefs
--allownoopupdates
--dynamicresolution
map unipostdb.T_PUB_JNL_SAV, target unipostdb.T_PUB_UNREG, FILTER ( @RANGE (1, 3) );

add rep repbb, exttrail ./dirdat/rb
edit param repbb

replicat repbb
userid ogg, password ogg
reperror default, abend
discardfile ./dirrpt/repbb.dsc,append, megabytes 10
REPORTCOUNT EVERY 2 MINUTES, RATE
GROUPTRANSOPS 2000
BATCHSQL
assumetargetdefs
--allownoopupdates
--dynamicresolution
map unipostdb.T_PUB_JNL_SAV, target unipostdb.T_PUB_UNREG, FILTER ( @RANGE (2, 3) );

add rep repbc, exttrail ./dirdat/rb

replicat repbc
userid ogg, password ogg
reperror default, abend
discardfile ./dirrpt/repbc.dsc,append, megabytes 10
REPORTCOUNT EVERY 2 MINUTES, RATE
GROUPTRANSOPS 2000
BATCHSQL
assumetargetdefs
--allownoopupdates
--dynamicresolution
map unipostdb.T_PUB_JNL_SAV, target unipostdb.T_PUB_UNREG, FILTER ( @RANGE (3, 3) );

-------------------------------------------------------------------

add rep repca, exttrail ./dirdat/rc
edit param repca

replicat repca
userid ogg, password ogg
reperror default, abend
discardfile ./dirrpt/repca.dsc,append, megabytes 10
REPORTCOUNT EVERY 2 MINUTES, RATE
GROUPTRANSOPS 2000
BATCHSQL
assumetargetdefs
--allownoopupdates
--dynamicresolution
map unipostdb.T_PUB_JNL_SAV, target unipostdb.T_CDM_LEDGER, FILTER ( @RANGE (1, 3) );

add rep repcb, exttrail ./dirdat/rc
edit param repcb

replicat repcb
userid ogg, password ogg
reperror default, abend
discardfile ./dirrpt/repcb.dsc,append, megabytes 10
REPORTCOUNT EVERY 2 MINUTES, RATE
GROUPTRANSOPS 2000
BATCHSQL
assumetargetdefs
--allownoopupdates
--dynamicresolution
map unipostdb.T_PUB_JNL_SAV, target unipostdb.T_CDM_LEDGER, FILTER ( @RANGE (2, 3) );

add rep repcc, exttrail ./dirdat/rc
edit param repcc

replicat repcc
userid ogg, password ogg
reperror default, abend
discardfile ./dirrpt/repcc.dsc,append, megabytes 10
REPORTCOUNT EVERY 2 MINUTES, RATE
GROUPTRANSOPS 2000
BATCHSQL
assumetargetdefs
--allownoopupdates
--dynamicresolution
map unipostdb.T_PUB_JNL_SAV, target unipostdb.T_CDM_LEDGER, FILTER ( @RANGE (3, 3) );

----------------------------------

alter repba, extseqno 0, extrba 0
alter repbb, extseqno 0, extrba 0
alter repbc, extseqno 0, extrba 0

alter repca, extseqno 0, extrba 0
alter repcb, extseqno 0, extrba 0
alter repcc, extseqno 0, extrba 0

-----------------------------------------
linux:
processor       : 63
vendor_id       : GenuineIntel
cpu family      : 6
model           : 46
model name      : Intel(R) Xeon(R) CPU           X7560  @ 2.27GHz
stepping        : 6
cpu MHz         : 2261.119
cache size      : 24576 KB
physical id     : 7
siblings        : 8
core id         : 11
cpu cores       : 4
apicid          : 247
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm 
syscall nx rdtscp lm constant_tsc ida nonstop_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 4522.22
clflush size    : 64
cache_alignment : 64
address sizes   : 44 bits physical, 48 bits virtual
power management: [8]

hp-unix
32c X 2 

------------------------------

PURGEOLDEXTRACTS ./dirdat/*, USECHECKPOINTS

35 + 40 G日志,产生24G队列

Log Read Checkpoint  Oracle Redo Logs
                     2011-12-30 14:49:21  Thread 1, Seqno 1956, RBA 397949752
Log Read Checkpoint  Oracle Redo Logs
                     2011-12-30 14:49:21  Thread 2, Seqno 1339, RBA 293856

----------------------------------------------------------------------

add ext extgd, tranlog, begin now, threads 2
add rmttrail ./dirdat/rd, ext extgd, megabytes 100

EXTRACT extgd
USERID ogg, PASSWORD ogg
rmthost  192.168.110.200, mgrport 7809
rmttrail ./dirdat/rd
TRANLOGOPTIONS DBLOGREADER
TRANLOGOPTIONS BUFSIZE 10000000, DBLOGREADERBUFSIZE 4194304
REPORTCOUNT EVERY 2 MINUTES, RATE
--dynamicresolution
GETTRUNCATES
table unipostdb.T_PUB_JNL_SAV, FILTER ( @RANGE (2, 2,  CLT_SEQNO) );

-----------

add rep repda, exttrail ./dirdat/rd

replicat repda
userid ogg, password ogg
reperror default, abend
discardfile ./dirrpt/repda.dsc,append, megabytes 10
REPORTCOUNT EVERY 2 MINUTES, RATE
GROUPTRANSOPS 2000
BATCHSQL
assumetargetdefs
--allownoopupdates
--dynamicresolution
map unipostdb.T_PUB_JNL_SAV, target unipostdb.T_PUB_JNL_SAV, FILTER ( @RANGE (1, 3) );

add rep repdb, exttrail ./dirdat/rd

replicat repdb
userid ogg, password ogg
reperror default, abend
discardfile ./dirrpt/repdb.dsc,append, megabytes 10
REPORTCOUNT EVERY 2 MINUTES, RATE
GROUPTRANSOPS 2000
BATCHSQL
assumetargetdefs
--allownoopupdates
--dynamicresolution
map unipostdb.T_PUB_JNL_SAV, target unipostdb.T_PUB_JNL_SAV, FILTER ( @RANGE (2, 3) );

add rep repdc, exttrail ./dirdat/rd

replicat repdc
userid ogg, password ogg
reperror default, abend
discardfile ./dirrpt/repdc.dsc,append, megabytes 10
REPORTCOUNT EVERY 2 MINUTES, RATE
GROUPTRANSOPS 2000
BATCHSQL
assumetargetdefs
--allownoopupdates
--dynamicresolution
map unipostdb.T_PUB_JNL_SAV, target unipostdb.T_PUB_JNL_SAV, FILTER ( @RANGE (3, 3) );

-----------------------------------
session_cached_cursors 50 -> 200

 

 

 

very_large_table.sql

 


Posted

in

by

Tags:

Comments

5 responses to “Goldengate Best Parameters & TEST from Maclean”

  1. maclean Avatar
    maclean

    56k带宽,配置传输参数:flushcsecs 30RMTHOST 10.6.157.17, MGRPORT 7809, tcpbufsize 65536, tcpflushbytes 65535, compress, compressthreshold 1 Reduce repeated fetching of LOBs watch for DBMS_LOB.writeappend()FetchOptions SurppressDuplicates Reduce IO overhead by EOFDELAY Competes with LGWR for the same logEOFDelay 15Avoid scsi errors Other parameters to adjust:CheckpointSecsFlushSecsTCPBufsize COMPRESS specifies that outgoing blocks of captured changes are compressed. COMPRESSTHRESHOLD sets the minimum byte size for which compression will occur. Default is 1000 bytes.Example: RMTHOST newyork, MGRPORT 7809, COMPRESS, COMPRESSTHRESHOLD 750Tables with referential integrity to one another should be processed by the same process group.An increased value for the FLUSHSECS or TCPFLUSHBYTES parameters might allow more efficientuse of the network, but the benefit must be balanced with the risk of increased latency of the targetdata if activity on the source is low and the buffer has not been flushed.More on TCP parameters:TCPFLUSHBYTES and TCPBUFSIZE should only be used for online processes, not for initial loadconfigurations. Work with your network administrator to find a suitable value for TCPBUFSIZE.You can use the following formula as a guideline for further experimentation to determine the optimumbuffer size for your network. First, use the ping command from the operating system’s command shellto obtain the average round trip time (RTT), shown in the following example:

  2. Ask_Maclean_liu_Oracle Avatar

    How to recover from an OGG-01028 Incompatible Record if the trail is not corrupt (Doc ID 1507462.1)Oracle GoldenGate – Version 9.5_EA and laterInformation in this document applies to any platform.GOALTo recover from error: OGG-01028 Incompatible record in /ggtrail/GGODSCF/dirdat/cf000325, rba 19018 (getting header).when it is known that the trail file is intact.This applies to both extract data pumps and replicats FIXIf a trail is not corrupt, a pump or replicat can be restarted by noting the point of failure (trail number and RBA) indicated in the report and discard file. Please do not attempt this if you are not familiar with reading these reports.This should be done on transaction boundaries or with RESTARTCOLLISIONS enabled. If you do not understand this, do not do this yourself; please have support assist you. >logdumplogdump> log to mycase.txtlogdump> open (/ggtrail/GGODSCF/dirdat/cf000325) <<<— the trail in the reportlogdump> ghdr onlogdump> pos (RBA 19018) <<<— the RBA in the report logdump> n this will give you a bad header messagelogdump> sfh prev this gives you the header of the previous record start,write down the RBA value <<<— If it’s the transaction boundary or only DML in transactionlogdump> count if this finishes Ok and gives you a count of tables and records, the trail is OK and you can use the RBA we saved for the alter later the trail is known to be undamaged if this does not finish with the count, you have a bad trail and must use another recovery method, contact support.logdump> exitYou now have a history of what you did in file mycase.txt and a written record of the RBA to use to ALTER the extract data pump or replicatggsci> alter , extseqno < the existing sequence number>, extrba ggsci> start

  3. Ask_Maclean_liu_Oracle Avatar

    How to recover from Extract ERROR 180 encountered commit SCN that is not greater than the highest SCN already processedThis is the summary of Metalink Doc:987379.1This error occurs in an Oracle RAC environment after a transaction is written to the idle node but does not yet appear in the redo log when the current transaction is processed. This transaction will have a higher SCN then the previous transaction In order to avoid to live this problem the steps in (Encountered SCN That Is Not Greater Than The Highest SCN Already Processed ) articale must be done But If you have encountered this problem here is the solution Do an ETROLLOVER on Extract, and take note of the new sequence number of the trail file. ALTER EXTRACT [name], ETROLLOVERStart extract START EXTRACT [name]Send PUMP, LOGEND, to see if it’s at the end of the previous trail. SEND EXTRACT [pump_name], LOGENDOnce it is at the end of the trail file, You must stop the pump, and do an ETROLLOVER for it too. Take note of the new trail file sequence number that is created from this stepSTOP EXTRACT [pump_name] ALTER EXTRACT [pump_name], ETROLLOVERAlter the pump to SEQNO to the new trail file created from step #1. ALTER EXTRACT [pump_name], EXTSEQNO ##### EXTRBA 0Restart pump START EXTRACT [pump_name]Send Replicat, LOGEND to make sure it has processed all the remaining data, and stop Replicat. SEND REPLICAT [name], LOGEND STOP REPLICAT [name]If replicat is not at end of trail, generate a report and forcestop replicatSEND REPLICAT [name], REPORTSTOP REPLICAT [name]!Add the following parameters to replicat parameter file to allow replicat to process each trail record as a single transaction, or set them to 1 if you have any of these parametersGROUPTRANSOPS 1MAXTRANSOPS 1Restart replicatSTART REPLICAT [name]Once replicat has completely processed the trail, stop the replicatSTOP REPLICAT [name]Edit the replicat parameter file: Add parameter HANDLECOLLISIONS to Replicat parameter file Remove or comment out GROUPTRANSOPS and MAXTRANSOPS or revert them back to their original values.ALTER REPLICAT, SEQNO to the new trail file created in step #4. ALTER REPLICAT [name], EXTSEQNO ###### EXTRBA 0Start ReplicatSTART REPLICAT [name]Once Replicat has processed the out of order SCN operations, disable HANDLECOLLISIONS. You could also look for the CSN and wait for Replicat to checkpoint past it.SEND REPLICAT [name], NOHANDLECOLLISIONSEdit the replicat parameter and comment out the HANDLECOLLISIONS parameter. You do not need to stop/restart replicat. This will ensure that on any subsequent replicat restarts the parameter is disabled

  4. Ask_Maclean_liu_Oracle Avatar

    GoldenGate performance tuning using the RANGE functionWe can improve performance by splitting large tables into row ranges and then assign processing of those ranges of rows to two or more Extract or Replicat process groups.We can use the RANGE function to divide the rows of table across processing groups.The syntax is @RANGE ({range}, {total ranges} [, {column}] [, {column}] [, …])For example here the replication workload is split into two ranges between two different Replicat processes based on the table column ‘ORDID’.The column name is optional. If not specified, GoldenGate uses the primary key of the table to allocate the ranges.(Replicat group 1 parameter file)MAP sh.orders, TARGET sh.orders, FILTER (@RANGE (1, 2, ORDID));(Replicat group 2 parameter file)MAP sh.orders, TARGET sh.orders, FILTER (@RANGE (2, 2, ORDID));While the above example shows the use of RANGE in the Replicat process groups, we can also use the RANGE function in the Extract process group.The GoldenGate documentation also states that it is better to use the RANGE function with Extract as opposed to Replicat process groups.“Using Extract to calculate the ranges is more efficient than using Replicat. Calculating ranges on the target side requires Replicat to read through the entire trail to find the data that meets each range specification.”Let us now have a look at an example where we are updating about 10 million rows in a table and we are using the RANGE function on the Replicat side of things to split the replication of these 10 mllion rows among three Replicat groups.Create the ExtractGGSCI (dvdb01) 2> add extract ext2 tranlog begin nowEXTRACT added.GGSCI (dvdb01) 3> add rmttrail /u01/oracle/goldengate/dirdat/aa, extract ext2RMTTRAIL added.Contents of parameter file for Extract ext2EXTRACT ext2USERID prd, PASSWORD prdRMTHOST sodb02, MGRPORT 7809RMTTRAIL /u01/oracle/goldengate/dirdat/aaTABLE prd.ac_entry;On Target server, add THREE Replicat groups Note that the trail file is the same for ALL the three replicat groupsGGSCI (sodb02) 1> add replicat rep2, exttrail /u01/oracle/goldengate/dirdat/aaREPLICAT added.GGSCI (sodb02) 2> add replicat rep3, exttrail /u01/oracle/goldengate/dirdat/aaREPLICAT added.GGSCI (sodb02) 3> add replicat rep4, exttrail /u01/oracle/goldengate/dirdat/aaREPLICAT added.Note the parameter file contents for each of the three Replicat groupsREPLICAT rep2ASSUMETARGETDEFSUSERID prd,PASSWORD prdMAP prd.ac_entry, TARGET prd.ac_entry, FILTER (@RANGE (1,3));REPLICAT rep3ASSUMETARGETDEFSUSERID prd,PASSWORD prdMAP prd.ac_entry, TARGET prd.ac_entry, FILTER (@RANGE (2,3));REPLICAT rep4ASSUMETARGETDEFSUSERID prd,PASSWORD prdMAP prd.ac_entry, TARGET prd.ac_entry, FILTER (@RANGE (3,3));Start the Extract on source serverGGSCI (dvdb01) 6> start extract ext2Sending START request to MANAGER …EXTRACT EXT2 startingGGSCI (dvdb01) 7> info extract ext2EXTRACT EXT2 Last Started 2011-03-11 14:24 Status RUNNINGCheckpoint Lag 00:18:36 (updated 00:00:00 ago)Log Read Checkpoint Oracle Redo Logs2011-03-11 14:06:02 Seqno 22, RBA 220007440On target, now start the replicat processesGGSCI (sodb02) 7> start replicat rep2Sending START request to MANAGER …REPLICAT REP2 startingGGSCI (sodb02) 8> start replicat rep3Sending START request to MANAGER …REPLICAT REP3 startingGGSCI (sodb02) 9> start replicat rep4Sending START request to MANAGER …REPLICAT REP4 startingUpdate 10 million rows in the tableSQL> update ac_entry set update_date=sysdate where id between 350000 and 11000000;10193820 rows updated.SQL> commit;Commit complete.After some time we check the status of the Extract process. We find that it has finished (note the EOF) and while the database log sequence has advanced from 22 to 28, GoldenGate has generated 311 trace files of 10MB each (the default size) in the location on the target server specified for the trail files.GGSCI (dvdb01) 23> send extract ext2 statusSending STATUS request to EXTRACT EXT2 …EXTRACT EXT2 (PID 23821)Current status: Recovery complete: At EOFCurrent read position:Sequence #: 28RBA: 1827632128Timestamp: 2011-03-11 14:39:26.000000Current write position:Sequence #: 311RBA: 1021232Timestamp: 2011-03-11 14:39:34.393944Extract Trail: /u01/oracle/goldengate/dirdat/aaOn the target server, we now check the status of the three Replicat groups, We find that all three are running and are currently processing the same trail file sequence # 217 (aa217).But the important point to note is that the processes are reading from different parts of the same trail file. Note that each process has a different RBA or relative byte address.GGSCI (sodb02) 31> send replicat rep* statusSending STATUS request to REPLICAT REP2 …Current status: Processing dataSequence #: 217RBA: 888147502538 records in current transactionSending STATUS request to REPLICAT REP3 …Current status: Processing dataSequence #: 217RBA: 890379502438 records in current transactionSending STATUS request to REPLICAT REP4 …Current status: Processing dataSequence #: 217RBA: 3219241502782 records in current transactionAfter some time, we run the same command again and find that all three replicat processes have now completed and are at trail file sequence 311 which was the last trail file that the extract process had generated. Note the EOF and the fact that the RBA now for all three replicat files is the same.GGSCI (sodb02) 6> send replicat rep* statusSending STATUS request to REPLICAT REP2 …Current status: At EOFSequence #: 311RBA: 25766950 records in current transactionSending STATUS request to REPLICAT REP3 …Current status: At EOFSequence #: 311RBA: 25766950 records in current transactionSending STATUS request to REPLICAT REP4 …Current status: At EOFSequence #: 311RBA: 25766950 records in current transactionIf we chcek the statistics of the three replicat processes, we find that using the RANGE function has spilt the 10 miilion row update task into three – each replicat process here has processed about 3.3 million rows each.GGSCI (sodb02) 28> stats replicat rep*Sending STATS request to REPLICAT REP2 …Start of Statistics at 2011-03-11 14:39:41.Replicating from PRD.AC_ENTRY to PRD.AC_ENTRY:*** Total statistics since 2011-03-11 14:36:38 ***Total inserts 0.00Total updates 3398392.00Total deletes 0.00Total discards 0.00Total operations 3398392.00End of Statistics.Sending STATS request to REPLICAT REP3 …Start of Statistics at 2011-03-11 14:39:42.Replicating from PRD.AC_ENTRY to PRD.AC_ENTRY:*** Total statistics since 2011-03-11 14:36:38 ***Total inserts 0.00Total updates 3397822.00Total deletes 0.00Total discards 0.00Total operations 3397822.00End of Statistics.Sending STATS request to REPLICAT REP4 …Start of Statistics at 2011-03-11 14:39:42.Replicating from PRD.AC_ENTRY to PRD.AC_ENTRY:*** Total statistics since 2011-03-11 14:36:38 ***Total inserts 0.00Total updates 3397822.00Total deletes 0.00Total discards 0.00Total operations 3397822.00End of Statistics.

  5. maclean Avatar
    maclean

    replicate 上指定 map maclean.T_* , target maclean.*;不要指定成 map maclean.T_* , target maclean.T_*;

Leave a Reply

Your email address will not be published. Required fields are marked *