源端:
1、停止进程
源端:停止抽取进程eora和投递进程pump_so
GGSCI (db1) 131> stop eroa
GGSCI (db1) 132> stop pump_so
GGSCI (db1) 123> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED EORA 00:00:00 00:09:26
EXTRACT STOPPED PUMP_SO 00:00:00 00:08:09
目标端:停止管理进程和复制进程
GGSCI (db1) 316> stop mgr
GGSCI (db1) 317> stop repl
GGSCI (db1) 318> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
REPLICAT STOPPED REPL 00:00:00 00:01:03
2、对抽取进程和投递进程进行 etrollover操作
源端:
GGSCI (db1) 124> alter extract pump_so etrollover
GGSCI (db1) 125> alter extract pump_so etrollover
3、查看抽取进程eora的Seqno和RBA
源端:
GGSCI (db1) 126> info eora,detail
EXTRACT EORA Initialized 2017-02-10 16:52 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:00:18 ago)
Log Read Checkpoint Oracle Redo Logs
2017-02-10 22:15:53 Seqno 13, RBA 1498112
SCN 0.1174495 (1174495)
Target Extract Trails:
Remote Trail Name Seqno RBA Max MB
/u01/app/oracle/ogg/dirdat/et 8 0 100
Extract Source Begin End
/u01/app/oracle/oradata/orcl/redo01.log * Initialized * 2017-02-10 22:15
/u01/app/oracle/oradata/orcl/redo01.log * Initialized * 2017-02-10 22:15
/u01/app/oracle/oradata/orcl/redo01.log 2017-02-10 16:50 2017-02-10 22:15
/u01/app/oracle/oradata/orcl/redo03.log 2017-02-10 13:53 2017-02-10 16:50
/u01/app/oracle/oradata/orcl/redo03.log 2017-02-10 12:50 2017-02-10 13:54
/u01/app/oracle/oradata/orcl/redo03.log * Initialized * 2017-02-10 12:50
/u01/app/oracle/oradata/orcl/redo03.log 2017-02-10 12:02 2017-02-10 12:50
/u01/app/oracle/oradata/orcl/redo03.log 2017-02-09 15:06 2017-02-10 12:02
/u01/app/oracle/oradata/orcl/redo02.log 2017-02-09 13:30 2017-02-09 15:06
/u01/app/oracle/oradata/orcl/redo02.log 2017-02-09 12:39 2017-02-09 13:30
Not Available * Initialized * 2017-02-09 12:39
4、修改投递进程pump_so的Seqno和RBA,使之和eora值一致,即8 0
GGSCI (db1) 115> alter extract pump_so extseqno 8,extrba 0
查看投递进程pump_s的Seqno和RBA
GGSCI (db1) 118> info pump_so,detail
如果Seqno值仍不为8,如果为6,则可以继续执行两次下面命令(每执行一次,数值加1)
GGSCI (db1) 117> alter extract pump_so etrollover
GGSCI (db1) 120> info pump_so,detail
EXTRACT PUMP_SO Initialized 2017-02-10 22:25 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:00:04 ago)
Log Read Checkpoint File /u01/app/oracle/ogg/dirdat/et000008
First Record RBA 0
Target Extract Trails:
Remote Trail Name Seqno RBA Max MB
/u01/app/oracle/ogg/dirdat/pt 8 0 100
5、备份目标端ogg 现有的home目录
目标端:
[oracle@db1 ~]$ cp -ra ogg /home/oracle/ogg_backup
6、查看目标端的checkpoint信息
目标端:
GGSCI (db1) 317> info repl,showch
REPLICAT REPL Initialized 2017-02-10 22:32 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:00:40 ago)
Log Read Checkpoint File /u01/app/oracle/ogg/dirdat/pt000008
First Record RBA 0
Current Checkpoint Detail:
Read Checkpoint #1
GGS Log Trail
Startup Checkpoint (starting position in the data source):
Sequence #: 4
RBA: 1229
Timestamp: .....
Extract Trail: /u01/app/oracle/ogg/dirdat/pt
Current Checkpoint (position of last record read in the data source):
Sequence #: 4
RBA: 1229
Timestamp: ........
Extract Trail: /u01/app/oracle/ogg/dirdat/pt
7、将ogg11.2.1.0.3版本解压到目标库现有的ogg home目录下,即ogg下
目标端:
[root@db1 /]# tar xvf fbo_ggs_Linux_x64_ora11g_64bit11.2.1.0.3.tar -C /u01/app/oracle/ogg/
[root@db1 /]# chown -R oracle:oinstall /u01/app/oracle/ogg/
[oracle@db1 ~]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
版本升级为 11.2.1.0.3,说明初步成功
8、验证目标端的checkpoint信息,是否和第6步一致
GGSCI (db1) 1> info repl,detail
如果一致,说明成功,继续向下验证
9、验证数据同步
源端:创建表test3
SQL> select * from test3;
ID
----------
1
2
3
目标端:创建表test3
SQL> select * from test3;
ID
----------
1
2
3
目标端:删除一行数据,下面要验证是否能从源端同步过来
SQL> delete test3 where id=1;
1 row deleted.
SQL> commit;
Commit complete.
SQL> select * from test3;
ID
----------
3
2
10、对于源端ogg为11.2.1.0.3,目标端为11.1.。时,目标端升级,需要重建目标端repl进程,请参考下面链接
http://blog.csdn.net/ljunjie82/article/details/43281499
11、修改复制进程repl的Seqno和RBA,使之和eora、pump_so值一致,即8 0
目标端:
GGSCI (db1) 115> alter replicat repl extseqno 8,extrba 0
查看修改后的Seqno和RBA
GGSCI (db1) 118> info repl,showch
12、启动进程
目标端:启动管理进程和复制进程
GGSCI (db1) 316> start repl
GGSCI (db1) 317> start mgr
GGSCI (db1) 318> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REPL 00:00:00 00:00:03
源端:启动抽取进程eora
和投递进程pump_so
GGSCI (db1) 131> start eroa
GGSCI (db1) 132> start pump_so
GGSCI (db1) 123> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EORA 00:00:00 00:00:06
EXTRACT RUNNING PUMP_SO 00:00:00 00:00:00
13、验证
目标端:
SQL> select * from test3;
ID
----------
3
2
SQL> select * from test3;
ID
----------
3
2
SQL> select * from test3;
ID
----------
3
2
SQL> select * from test3;
ID
----------
3
2
SQL> select * from test3;
ID
----------
3
2
SQL> select * from test3;
ID
----------
3
2
1
SQL> select * from test3;
ID
----------
1
2
3
成功!
OS: 虚拟机 redhat 7.3 x64目标端:
数据库: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64 bit
ogg: Oracle GoldenGate 11.2.1.0.3 Linux, x64, 64bit
OS : 虚拟机 redhat 7.3 x64要把目标端ogg升级到 11.2.1.0.3。
数据库 : Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64 bi t
ogg: Oracle GoldenGate 11.2.1.0.1 Linux, x64, 64bit
1、停止进程
源端:停止抽取进程eora和投递进程pump_so
GGSCI (db1) 131> stop eroa
GGSCI (db1) 132> stop pump_so
GGSCI (db1) 123> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED EORA 00:00:00 00:09:26
EXTRACT STOPPED PUMP_SO 00:00:00 00:08:09
目标端:停止管理进程和复制进程
GGSCI (db1) 316> stop mgr
GGSCI (db1) 317> stop repl
GGSCI (db1) 318> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
REPLICAT STOPPED REPL 00:00:00 00:01:03
2、对抽取进程和投递进程进行 etrollover操作
源端:
GGSCI (db1) 124> alter extract pump_so etrollover
GGSCI (db1) 125> alter extract pump_so etrollover
3、查看抽取进程eora的Seqno和RBA
源端:
GGSCI (db1) 126> info eora,detail
EXTRACT EORA Initialized 2017-02-10 16:52 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:00:18 ago)
Log Read Checkpoint Oracle Redo Logs
2017-02-10 22:15:53 Seqno 13, RBA 1498112
SCN 0.1174495 (1174495)
Target Extract Trails:
Remote Trail Name Seqno RBA Max MB
/u01/app/oracle/ogg/dirdat/et 8 0 100
Extract Source Begin End
/u01/app/oracle/oradata/orcl/redo01.log * Initialized * 2017-02-10 22:15
/u01/app/oracle/oradata/orcl/redo01.log * Initialized * 2017-02-10 22:15
/u01/app/oracle/oradata/orcl/redo01.log 2017-02-10 16:50 2017-02-10 22:15
/u01/app/oracle/oradata/orcl/redo03.log 2017-02-10 13:53 2017-02-10 16:50
/u01/app/oracle/oradata/orcl/redo03.log 2017-02-10 12:50 2017-02-10 13:54
/u01/app/oracle/oradata/orcl/redo03.log * Initialized * 2017-02-10 12:50
/u01/app/oracle/oradata/orcl/redo03.log 2017-02-10 12:02 2017-02-10 12:50
/u01/app/oracle/oradata/orcl/redo03.log 2017-02-09 15:06 2017-02-10 12:02
/u01/app/oracle/oradata/orcl/redo02.log 2017-02-09 13:30 2017-02-09 15:06
/u01/app/oracle/oradata/orcl/redo02.log 2017-02-09 12:39 2017-02-09 13:30
Not Available * Initialized * 2017-02-09 12:39
4、修改投递进程pump_so的Seqno和RBA,使之和eora值一致,即8 0
GGSCI (db1) 115> alter extract pump_so extseqno 8,extrba 0
查看投递进程pump_s的Seqno和RBA
GGSCI (db1) 118> info pump_so,detail
如果Seqno值仍不为8,如果为6,则可以继续执行两次下面命令(每执行一次,数值加1)
GGSCI (db1) 117> alter extract pump_so etrollover
GGSCI (db1) 120> info pump_so,detail
EXTRACT PUMP_SO Initialized 2017-02-10 22:25 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:00:04 ago)
Log Read Checkpoint File /u01/app/oracle/ogg/dirdat/et000008
First Record RBA 0
Target Extract Trails:
Remote Trail Name Seqno RBA Max MB
/u01/app/oracle/ogg/dirdat/pt 8 0 100
5、备份目标端ogg 现有的home目录
目标端:
[oracle@db1 ~]$ cp -ra ogg /home/oracle/ogg_backup
6、查看目标端的checkpoint信息
目标端:
GGSCI (db1) 317> info repl,showch
REPLICAT REPL Initialized 2017-02-10 22:32 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:00:40 ago)
Log Read Checkpoint File /u01/app/oracle/ogg/dirdat/pt000008
First Record RBA 0
Current Checkpoint Detail:
Read Checkpoint #1
GGS Log Trail
Startup Checkpoint (starting position in the data source):
Sequence #: 4
RBA: 1229
Timestamp: .....
Extract Trail: /u01/app/oracle/ogg/dirdat/pt
Current Checkpoint (position of last record read in the data source):
Sequence #: 4
RBA: 1229
Timestamp: ........
Extract Trail: /u01/app/oracle/ogg/dirdat/pt
7、将ogg11.2.1.0.3版本解压到目标库现有的ogg home目录下,即ogg下
目标端:
[root@db1 /]# tar xvf fbo_ggs_Linux_x64_ora11g_64bit11.2.1.0.3.tar -C /u01/app/oracle/ogg/
[root@db1 /]# chown -R oracle:oinstall /u01/app/oracle/ogg/
[oracle@db1 ~]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
版本升级为 11.2.1.0.3,说明初步成功
8、验证目标端的checkpoint信息,是否和第6步一致
GGSCI (db1) 1> info repl,detail
如果一致,说明成功,继续向下验证
9、验证数据同步
源端:创建表test3
SQL> select * from test3;
ID
----------
1
2
3
目标端:创建表test3
SQL> select * from test3;
ID
----------
1
2
3
目标端:删除一行数据,下面要验证是否能从源端同步过来
SQL> delete test3 where id=1;
1 row deleted.
SQL> commit;
Commit complete.
SQL> select * from test3;
ID
----------
3
2
10、对于源端ogg为11.2.1.0.3,目标端为11.1.。时,目标端升级,需要重建目标端repl进程,请参考下面链接
http://blog.csdn.net/ljunjie82/article/details/43281499
11、修改复制进程repl的Seqno和RBA,使之和eora、pump_so值一致,即8 0
目标端:
GGSCI (db1) 115> alter replicat repl extseqno 8,extrba 0
查看修改后的Seqno和RBA
GGSCI (db1) 118> info repl,showch
12、启动进程
目标端:启动管理进程和复制进程
GGSCI (db1) 316> start repl
GGSCI (db1) 317> start mgr
GGSCI (db1) 318> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REPL 00:00:00 00:00:03
GGSCI (db1) 131> start eroa
GGSCI (db1) 132> start pump_so
GGSCI (db1) 123> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EORA 00:00:00 00:00:06
EXTRACT RUNNING PUMP_SO 00:00:00 00:00:00
13、验证
目标端:
SQL> select * from test3;
ID
----------
3
2
SQL> select * from test3;
ID
----------
3
2
SQL> select * from test3;
ID
----------
3
2
SQL> select * from test3;
ID
----------
3
2
SQL> select * from test3;
ID
----------
3
2
SQL> select * from test3;
ID
----------
3
2
1
SQL> select * from test3;
ID
----------
1
2
3
成功!
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31414383/viewspace-2133410/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31414383/viewspace-2133410/