记录一次OGG不同步问题的解决

今天测试ogg的同步,源是Windows,目标是Linux。因为把pump进程里面的路径搞错了,应该是pump到Linux下,对应的是Linux的路径,结果搞成了Windows下的路径。如下

extract pumdb1
SETENV(NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK")
SETENV(ORACLE_SID="test")
userid ggs, password ggs
passthru
rmthost 192.168.2.14,mgrport 7809
--rmttrail d:\ogg\dirdat\db
rmttrail /u01/ogg/dirdat/db
table bb.t1;

复制进程如下: 因为复制进程要在dirdat中找到db开头的文件进行复制。实际上并没有这些文件,因为生成的文件是D:开头的。所以导致不能复制(尽管replicat进程是running的)。

add replicat repdb1,exttrail /u01/ogg/dirdat/db, checkpointtable ggs.checkpoint
start replicat repdb1,aftercsn 1105463

最终的结果,是导致生成的文件,被抛到了目标端的/u01/ogg目录下,而不是/u01/ogg/dirdat目录下。如下。

[oracle@test02 ogg]$ ls
bcpfmt.tpl                ddl_staymetadata_on.sql          d:\ogg\dirdat\db000002  d:\ogg\dirdat\db000028  emsclnt                 marker_status.sql
bcrypt.txt                ddl_tracelevel.sql               d:\ogg\dirdat\db000003  d:\ogg\dirdat\db000029  extract                 mgr
cfg                       ddl_trace_off.sql                d:\ogg\dirdat\db000004  d:\ogg\dirdat\db000030  freeBSD.txt             notices.txt
chkpt_ora_create.sql      ddl_trace_on.sql                 d:\ogg\dirdat\db000005  d:\ogg\dirdat\db000031  ggcmd                   oggerr
cobgen                    defgen                           d:\ogg\dirdat\db000006  d:\ogg\dirdat\db000032  gglog-mgr.dmp           params.sql
convchk                   demo_more_ora_create.sql         d:\ogg\dirdat\db000007  d:\ogg\dirdat\db000033  gglog-REPDB1.dmp        prvtclkm.plb
db2cntl.tpl               demo_more_ora_insert.sql         d:\ogg\dirdat\db000008  d:\ogg\dirdat\db000034  ggMessage.dat           pw_agent_util.sh
ddl_cleartrace.sql        demo_ora_create.sql              d:\ogg\dirdat\db000009  d:\ogg\dirdat\db000035  ggsci                   remove_seq.sql
ddlcob                    demo_ora_insert.sql              d:\ogg\dirdat\db000010  d:\ogg\dirdat\db000036  ggserr.log              replicat
ddl_ddl2file.sql          demo_ora_lob_create.sql          d:\ogg\dirdat\db000011  d:\ogg\dirdat\db000037  help.txt                retrace
ddl_disable.sql           demo_ora_misc.sql                d:\ogg\dirdat\db000012  d:\ogg\dirdat\db000038  jagent.sh               reverse
ddl_enable.sql            demo_ora_pk_befores_create.sql   d:\ogg\dirdat\db000013  d:\ogg\dirdat\db000039  keygen                  role_setup_set.txt
ddl_filter.sql            demo_ora_pk_befores_insert.sql   d:\ogg\dirdat\db000014  d:\ogg\dirdat\db000040  libantlr3c.so           role_setup_spool.txt
ddl_ora10.sql             demo_ora_pk_befores_updates.sql  d:\ogg\dirdat\db000015  d:\ogg\dirdat\db000041  libdb-5.2.so            role_setup.sql
ddl_ora10upCommon.sql     dirchk                           d:\ogg\dirdat\db000016  d:\ogg\dirdat\db000042  libgglog.so             sequence_set.txt
ddl_ora11.sql             dirdat                           d:\ogg\dirdat\db000017  d:\ogg\dirdat\db000043  libggrepo.so            sequence_spool.txt
ddl_ora9.sql              dirdef                           d:\ogg\dirdat\db000018  d:\ogg\dirdat\db000044  libicudata.so.38        sequence.sql
ddl_pin.sql               dirjar                           d:\ogg\dirdat\db000019  d:\ogg\dirdat\db000045  libicui18n.so.38        server
ddl_remove.sql            dirout                           d:\ogg\dirdat\db000020  d:\ogg\dirdat\db000046  libicuuc.so.38          sqlldr.tpl
ddl_session1.sql          dirpcs                           d:\ogg\dirdat\db000021  d:\ogg\dirdat\db000047  libxerces-c.so.28       tcperrs
ddl_session.sql           dirprm                           d:\ogg\dirdat\db000022  d:\ogg\dirdat\db000048  libxml2.txt             ucharset.h
ddl_setup_set.txt         dirrpt                           d:\ogg\dirdat\db000023  d:\ogg\dirdat\db000049  logdump                 ulg.sql
ddl_setup_spool.txt       dirsql                           d:\ogg\dirdat\db000024  d:\ogg\dirdat\db000050  marker_remove.sql       UserExitExamples
ddl_setup.sql             dirtmp                           d:\ogg\dirdat\db000025  d:\ogg\dirdat\db000051  marker_setup_set.txt    usrdecs.h
ddl_status.sql            d:\ogg\dirdat\db000000           d:\ogg\dirdat\db000026  d:\ogg\dirdat\db000052  marker_setup_spool.txt  zlib.txt
ddl_staymetadata_off.sql  d:\ogg\dirdat\db000001           d:\ogg\dirdat\db000027  d:\ogg\dirdat\db000053  marker_setup.sql
[oracle@test02 ogg]$ pwd
/u01/ogg
[oracle@test02 ogg]$

而且,查看目标端的replicat进程,没有复制任何信息。也就是说,数据没有同步。怎么解决呢。

想了下ogg的原理。既然pump文件都生成了,也抛过来了。 有文件,还是可以继续同步的。

解决方法。将这些D:开头的文件更改名字(在notepad 中统一更改,统一修改好mv格式,然后在Linux下修改),然后这些文件移动到dirdat目录下。 然后重新创建一个复制进程,进行复制,即可。这里重新命名为ab开头的文件,复制进程复制ab开头的文件。

创建一个复制进程repdb2

replicat repdb2
SETENV(NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK")
SETENV(ORACLE_SID="orcl")
userid ggs, password ggs
assumetargetdefs
discardfile /u01/ogg/dirdat/rep_2_discard,append
--handlecollisions
discardfile /u01/ogg/dirrpt/repdb2_repaix.dsc,purge
REPORTROLLOVER AT 05:30 ON Friday
map bb.t1,target bb.t1;
--ddl include all
DDLERROR 10655 IGNORE
DDLERROR 10636 IGNORE
DDLERROR DEFAULT IGNORE RETRYOP

启动复制进程repdb2,重新复制即可。

add replicat repdb2,exttrail /u01/ogg/dirdat/ab, checkpointtable ggs.checkpoint
start replicat repdb2,aftercsn 1105463
END。

你可能感兴趣的:(Stream,&,OGG)