Split 1. OGG REPLICAT process
If the particle size Replicat splitting process and is not detailed enough, the best method for selective tuning process is Replicat split.
Such as a single Replicat unable to meet a delivery queue data requirements, it can be split according to the table, and each process a different set of tables, try to ensure that the same table involved in a business Replicat can ensure consistency between (to be temporarily banned list foreign key links can split ensure Replicat)
1.1. Stop the process to split
GGSCI (cndba) 11> stop rep1
Sending STOP request to REPLICAT REP1 ...
Request processed.
1.2. To view the split process and RBA number of SEQNO
GGSCI (cndba) 12> info rep1
REPLICAT REP1 Last Started 2018-06-11 21:18 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:00:58 ago)
Log Read Checkpoint File ./dirdat/et000024
2018-06-11 21:58:22.004321 RBA 1324
说明当前的进程读到第24个队列,而且RBA号1314的位置。
1.3. To create a new process for the editing parameter files, here called rep2
edit params rep2
REPLICAT rep2
--setenv (ORACLE_SID=cndba)
--SETENV (ORACLE_HOME = "/u01/app/oracle/product/11.2.0/db_1")
USERID ogg,PASSWORD ogg
ASSUMETARGETDEFS
--HANDLECOLLISIONS
REPERROR (DEFAULT, DISCARD)
DDLERROR DEFAULT DISCARD
DDLOPTIONS REPORT
DISCARDFILE ./dirrpt/repr2.dsc,append,megabytes 100
--HANDLECOLLISIONS
MAP test.test2, TARGET test.test2;
1.4. Adding rep2 process group, and add tail file
GGSCI (cndba) 17> add replicat rep2, exttrail ./dirdat/et, checkpointtable ogg.checkpoint
REPLICAT added.
1.5. Rep2 same modified pointers and rep1
GGSCI (cndba) 18> alter rep2,extseqno 24 extrba 1324
REPLICAT altered.
1.6. Rep2 and reconfirmed rep1 pointer changes to the length consistent state
GGSCI (cndba) 22> info rep1
REPLICAT REP1 Last Started 2018-06-11 21:18 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:14:17 ago)
Log Read Checkpoint File ./dirdat/et000024
2018-06-11 21:58:22.004321 RBA 1324
GGSCI (cndba) 30> info rep2
REPLICAT REP2 Initialized 2018-06-12 00:22 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:00:04 ago)
Log Read Checkpoint File ./dirdat/et000024
First Record RBA 1324
1.7. Always remember to take rep1 in Split rep2 tables exclude, or there will be duplicate data
edit params rep1
tableexclude test.test2
1.8. Start rep1 and rep2
GGSCI (cndba) 32> start rep1
Sending START request to MANAGER ...
REPLICAT REP1 starting
GGSCI (cndba) 33> start rep2
Sending START request to MANAGER ...
REPLICAT REP2 starting
GGSCI (cndba) 34> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REP1 00:00:00 00:00:08
REPLICAT RUNNING REP2 00:00:00 00:00:04
1.9. Test
--源端插入数据
SQL> insert into test2 values(1,'zhangsan');
1 row created.
SQL> commit;
Commit complete.
SQL> insert into test values(50,'test');
1 row created.
SQL> commit;
Commit complete.
SQL> select count(*) from test;
COUNT(*)
----------
40
--目标端查看数据
SQL> select * from test2;
ID NAME
---------- --------
1 zhangsan
SQL> select count(*) from test;
COUNT(*)
----------
40
到这个ogg 就把比较慢的进程拆分到不同的两个进程里面,入库就会明显地加快。
对ogg 调优其实就是对一些参数做相应的调整。入库比较慢就要对Replicat进程进行拆分,而且很多时候对ogg 的瓶颈就是Replicat进程,大多数时候调优发送在容灾端。