我们在搭建ogg的时候,通常需要先对目标库进行初始化,那么初始化的方式很多。现在介绍ogg自己的初始化方式。
测试环境: Souce DB: OS:redhat 6.3 Name:zbdba1 DB:11.2.0.4 OGG:11.2.1.0.1 Target DB: OS:redhat 6.3 Name:zbdba2 DB:11.2.0.4 OGG:11.2.1.0.1
GGSCI (zbdba1) 1> view param mgr port 7839 DYNAMICPORTLIST 7840-7914 USERID OGG,PASSWORD ogg AUTORESTART REPLICAT *, RETRIES 5, WAITMINUTES 3 PURGEOLDEXTRACTS ./DIRDAT/*,MINKEEPDAYS 3 PURGEDDLHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10,FREQUENCYMINUTES 30 PURGEMARKERHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10 LAGREPORTHOURS 1 LAGINFOMINUTES 30 LAGCRITICALMINUTES 45 GGSCI (zbdba2) 11> view param mgr port 7839 DYNAMICPORTLIST 7840-7914 USERID OGG,PASSWORD ogg AUTORESTART REPLICAT *, RETRIES 5, WAITMINUTES 3 PURGEOLDEXTRACTS ./dirdat/*,MINKEEPDAYS 3 PURGEDDLHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10,FREQUENCYMINUTES 30 PURGEMARKERHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10 LAGREPORTHOURS 1 LAGINFOMINUTES 30 LAGCRITICALMINUTES 45 start managerSource:
GGSCI (zbdba1) 7> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING GGSCI (zbdba1) 8> GGSCI (zbdba1) 8> GGSCI (zbdba1) 8> add extract initload,sourceistable EXTRACT added. GGSCI (zbdba1) 9> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING GGSCI (zbdba1) 10> edit param initload EXTRACT initload USERID ogg, PASSWORD ogg RMTHOST 192.168.56.61, MGRPORT 7839 RMTTASK replicat, GROUP repload TABLE zbdba.test;Target:
GGSCI (zbdba2) 9> add replicat repload,specialrun REPLICAT added. GGSCI (zbdba2) 10> GGSCI (zbdba2) 10> GGSCI (zbdba2) 10> GGSCI (zbdba2) 10> edit param repload REPLICAT repload USERID ogg, PASSWORD ogg ASSUMETARGETDEFS MAP zbdba.test, TARGET zbdba.test; source: SQL> conn zbdba/oracle; Connected. SQL> select count(1) from test; COUNT(1) ---------- 86315 target: SQL> select count(1) from test; COUNT(1) ---------- 0source:
GGSCI (zbdba1) 15> start extract initload Sending START request to MANAGER ... EXTRACT INITLOAD starting查看日志:
2015-02-27 02:18:25 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (ogg): start extract initload. 2015-02-27 02:18:25 INFO OGG-00963 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host zbdba1 (START EXTRACT INITLOAD ). 2015-02-27 02:18:25 INFO OGG-00975 Oracle GoldenGate Manager for Oracle, mgr.prm: EXTRACT INITLOAD starting. 2015-02-27 02:18:25 INFO OGG-01017 Oracle GoldenGate Capture for Oracle, initload.prm: Wildcard resolution set to IMMEDIATE because SOURCEISTABLE is used. 2015-02-27 02:18:25 INFO OGG-00992 Oracle GoldenGate Capture for Oracle, initload.prm: EXTRACT INITLOAD starting. 2015-02-27 02:18:25 INFO OGG-03035 Oracle GoldenGate Capture for Oracle, initload.prm: Operating system character set identified as UTF-8. Locale: en_US, LC_ALL:. 2015-02-27 02:18:29 WARNING OGG-00869 Oracle GoldenGate Capture for Oracle, initload.prm: No unique key is defined for table 'TEST'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key. 2015-02-27 02:18:29 INFO OGG-01815 Oracle GoldenGate Capture for Oracle, initload.prm: Virtual Memory Facilities for: COM anon alloc: mmap(MAP_ANON) anon free: munmap file alloc: mmap(MAP_SHARED) file free: munmap target directories: /ogg/dirtmp. 2015-02-27 02:18:29 INFO OGG-00993 Oracle GoldenGate Capture for Oracle, initload.prm: EXTRACT INITLOAD started.
GGSCI (zbdba1) 18> info initload EXTRACT INITLOAD Last Started 2015-02-27 02:18 Status RUNNING Checkpoint Lag Not Available Log Read Checkpoint Table ZBDBA.TEST 2015-02-27 02:19:25 Record 43671 Task SOURCEISTABLE GGSCI (zbdba1) 19> info initload EXTRACT INITLOAD Last Started 2015-02-27 02:18 Status RUNNING Checkpoint Lag Not Available Log Read Checkpoint Table ZBDBA.TEST 2015-02-27 02:19:35 Record 54025 Task SOURCEISTABLE GGSCI (zbdba1) 20> ! info initload EXTRACT INITLOAD Last Started 2015-02-27 02:18 Status STOPPED Checkpoint Lag Not Available Log Read Checkpoint Table ZBDBA.TEST 2015-02-27 02:20:16 Record 86315 Task SOURCEISTABLE 发现已抽取完成
2015-02-27 02:18:54 INFO OGG-00995 Oracle GoldenGate Delivery for Oracle, repload.prm: REPLICAT REPLOAD starting. 2015-02-27 02:18:54 INFO OGG-03035 Oracle GoldenGate Delivery for Oracle, repload.prm: Operating system character set identified as UTF-8. Locale: en_US, LC_ALL:. 2015-02-27 02:18:55 INFO OGG-01815 Oracle GoldenGate Delivery for Oracle, repload.prm: Virtual Memory Facilities for: COM anon alloc: mmap(MAP_ANON) anon free: munmap file alloc: mmap(MAP_SHARED) file free: munmap target directories: /ogg/dirtmp. 2015-02-27 02:18:55 INFO OGG-00996 Oracle GoldenGate Delivery for Oracle, repload.prm: REPLICAT REPLOAD started. 2015-02-27 02:18:59 WARNING OGG-00869 Oracle GoldenGate Delivery for Oracle, repload.prm: No unique key is defined for table 'TEST'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key. 2015-02-27 02:20:21 INFO OGG-00994 Oracle GoldenGate Delivery for Oracle, repload.prm: REPLICAT REPLOAD stopped normally. 发现repload进程已经自动启动并且复制完毕自动停止了。
SQL> select count(1) from test; COUNT(1) ---------- 86315 已经完成初始化
Use Goldengate Initial Data Load
原文地址:http://blog.csdn.net/zbdba/article/details/44001181