码迷,mamicode.com
首页 > 其他好文 > 详细

Use Goldengate Initial Data Load

时间:2015-03-01 10:32:39      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:goldengate   init load   

我们在搭建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

这里着重介绍 Initial Load,具体安装配置请参考:
http://blog.csdn.net/zbdba/article/details/38794415


Source and target DB:
配置并开启manager进程:

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 manager
Source:
配置initload 抽取进程:

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:
配置repload 复制进程

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)
----------
         0
source:
开启抽取进程:

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
发现已抽取完成

target:
查看日志:

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

标签:goldengate   init load   

原文地址:http://blog.csdn.net/zbdba/article/details/44001181

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!