> info EXT_1
EXTRACT EXT_1 Initialized 2016-11-11 16:16 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:01:22 ago)
Log Read Checkpoint Oracle Redo Logs
2016-11-11 16:16:04 Seqno 0, RBA 0
SCN 0.0 (0)在11g中没有配置和OGG相关的数据库参数,就会抛出如下的问题了.
2016-11-11 16:17:11 ERROR OGG-02091 Oracle GoldenGate Capture for Oracle, ext_1.prm: Operation not supported because enable_goldengate_replication is not set to true.
2016-11-11 16:17:11 ERROR OGG-01668 Oracle GoldenGate Capture for Oracle, ext_1.prm: PROCESS ABENDING.修复之后,重新启动,这个问题就迎刃而解了,查看这个抽取进程的状态,可以看到已经有了状态数据。
> info ext_1
EXTRACT EXT_1 Last Started 2016-11-11 16:20 Status RUNNING
Checkpoint Lag 00:04:49 (updated 00:00:03 ago)
Process ID 53455
Log Read Checkpoint Oracle Redo Logs
2016-11-11 16:16:04 Seqno 9416, RBA 8206848
SCN 0.0 (0)然后开始在源端配置PUMP进程,目标数据库的IP是10.127.2.32,PASSTHRU代表是一个传输进程data pump
> edit params dpump_1
EXTRACT dpump_1
PASSTHRU
RMTHOST 10.127.2.32, MGRPORT 1530
RMTTRAIL /home/oracle/ogg/ogg_work/dirdat/ss
TABLE n1.*;
> ADD EXTRACT dpump_1,EXTTRAILSOURCE /home/oracle/ogg/ogg_work/dirdat/ss
EXTRACT added.
> ADD RMTTRAIL /home/oracle/ogg/ogg_work/dirdat/ss, EXTRACT dpump_1
RMTTRAIL added.
配置完成之后,启动PUMP进程。
> start dpump_1
Sending START request to MANAGER ...
EXTRACT DPUMP_1 starting查看DUMP进程的信息如下:
> info dpump_1
EXTRACT DPUMP_1 Last Started 2016-11-11 16:24 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:04 ago)
Process ID 53479
Log Read Checkpoint File /home/oracle/ogg/ogg_work/dirdat/ss000000000
First Record RBA 0
对于OGG如果估计最常用的就是info all这个命令了。
> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DPUMP_1 00:00:00 00:00:07
EXTRACT RUNNING EXT_1 00:00:00 00:00:00
源端配置完成,我们来配置目标端。
添加表日志:
> edit param ./GLOBALS
GGSCHEMA ogg_target
CHECKPOINTTABLE ogg_target.CHKPTAB
登录到数据库端:
> dblogin userid ogg_target,password oracle
Successfully logged into database.
目标端配置检查点:
> add checkpointtable ogg_target.CHKPTAB
Successfully created checkpoint table ogg_target.CHKPTAB
配置投递队列参数,将数据应用到目标库,这里有个映射关系,就是源库的n1.*和目标库的n1.*是对应的。
> edit params rep_1
REPLICAT REP_1
USERID ogg_target, PASSWORD oracle
ASSUMETARGETDEFS
HANDLECOLLISIONS
MAP n1.*,TARGET n1.*; 添加投递队列
> ADD REPLICAT REP_1, EXTTRAIL /home/oracle/ogg/ogg_work/dirdat/ss,CHECKPOINTTABLE ggs_target.CHKPTAB
REPLICAT added.
这里自己给自己埋了一个坑,先不说破了。看看下面的错误。
启动投递应用进程,但是发现却有报错。
> start REP_1
Sending START request to MANAGER ...
REPLICAT REP_1 starting
错误提示是比较奇怪的,怎么用户名密码错误了。
Delivery for Oracle, rep_1.prm: OCI Error beginning session (status = 1017-ORA-01017: invalid username/password; logon denied),还有SYS.DBMS_STREAMS的访问权限不足
下面这个地方错误花了些时间来分析,最后才发现是自己把用户名写错了。
先删除,再添加
>delete replicat rep_1 添加的语句如下ogg_target.CHKPTAB是主要的地方,自己给写错为ggs_target了。
> ADD REPLICAT REP_1, EXTTRAIL /home/oracle/ogg/ogg_work/dirdat/ss,CHECKPOINTTABLE ogg_target.CHKPTAB
REPLICAT added.
再次启动就没有问题了。
> start REP_1
Sending START request to MANAGER ...
REPLICAT REP_1 starting