我是靠谱客的博主 忧伤学姐,最近开发中收集的这篇文章主要介绍Oracle 11g 测试ogg中断之后,重新同步操作1.测试ogg中断之后,重新同步操作,觉得挺不错的,现在分享给大家,希望可以做个参考。
概述
测试ogg中断之后,重新同步操作
2018-06-07 17:11 779
1
原创 GoldenGate
本文链接:
https://www.cndba.cn/leo1990/article/2839
1.测试ogg中断之后,重新同步操作
1.1.关闭源端抽取进程
GGSCI (cndba) 65> info all
Program
Status
Group
Lag at Chkpt
Time Since Chkpt
MANAGER
RUNNING
EXTRACT
RUNNING
EXT1
00:00:00
00:00:09
EXTRACT
RUNNING
PUMP1
00:00:00
00:00:08
GGSCI (cndba) 66> stop ext1
Sending STOP request to EXTRACT EXT1 ...
Request processed.
GGSCI (cndba) 67> stop pump1
Sending STOP request to EXTRACT PUMP1 ...
Request processed.
GGSCI (cndba) 68> info all
Program
Status
Group
Lag at Chkpt
Time Since Chkpt
MANAGER
RUNNING
EXTRACT
STOPPED
EXT1
00:00:00
00:00:04
EXTRACT
STOPPED
PUMP1
00:00:00
00:00:01
1.2.关闭目标端进程
GGSCI (cndba) 55> info all
Program
Status
Group
Lag at Chkpt
Time Since Chkpt
MANAGER
RUNNING
REPLICAT
RUNNING
REP1
00:00:00
00:00:08
GGSCI (cndba) 56> stop rep1
Sending STOP request to REPLICAT REP1 ...
Request processed.
GGSCI (cndba) 57> info all
Program
Status
Group
Lag at Chkpt
Time Since Chkpt
MANAGER
RUNNING
REPLICAT
STOPPED
REP1
00:00:00
00:00:01
1.3.检查源端,目标端表数据
--源端
SQL> select * from test1;
no rows selected
--目标端
SQL> select * from test1;
no rows selected
1.4.源端表插入100000条数据
记住插入之前的时间2018-06-07 16:15:24,这个时间点很重要,extract 进程要从这个时间开始抽取
SQL> insert into test1 select level,level||'t' from dual connect by level <= 100000;
100000 rows created.
SQL> commit;
Commit complete.
SQL> select count(*) from test1;
COUNT(*)
----------
100000
如果此时开启源端extract进程,目标端replicat,数据同步不会出现问题,现在的操作就是:
1)结束当前的本地日志,重新开始一个日志
2)从当前新生成的序列重新抓取
1.5.源端操作
1.5.1.查看当前tail文件信息
[root@www.cndba.cn dirdat]# ll
total 12
drwxr-xr-x 2 root
root
4096 Jun
7 15:47 backup
-rw-rw-rw- 1 oracle oinstall 1405 Jun
7 16:11 et000000
-rw-rw-rw- 1 oracle oinstall 1016 Jun
7 16:19 et000001
可以看到当前tail文件是1号文件,重启的时候会自动变成2号文件。
1.5.2.重新生成新的tail文件,抽取进程,投递进程从新的tail文件开始抓取数据
GGSCI (cndba) 70> alter extract ext1 etrollover
2018-06-07 16:33:40
INFO
OGG-01520
Rollover performed.
For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file;
it will not happen automatically.
EXTRACT altered.
GGSCI (cndba) 71> alter extract ext1,thread 1,extseqno 2,extrba 0
EXTRACT altered.
GGSCI (cndba) 72> alter extract pump1 etrollover
2018-06-07 16:34:26
INFO
OGG-01520
Rollover performed.
For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file;
it will not happen automatically.
EXTRACT altered.
GGSCI (cndba) 73> alter extract pump1,thread 1,extseqno 2,extrba 0
EXTRACT altered.
1.5.3.源端从插入数据之前的时间开始抓取数据
GGSCI (cndba) 74> ALTER EXTRACT ext1, TRANLOG, BEGIN 2018-06-07 16:15:24
EXTRACT altered.
1.5.4.重启源端进程
GGSCI (cndba) 58> start ext1
Sending START request to MANAGER ...
EXTRACT EXT1 starting
GGSCI (cndba) 59> start pump1
Sending START request to MANAGER ...
EXTRACT PUMP1 starting
GGSCI (cndba) 64> info all
Program
Status
Group
Lag at Chkpt
Time Since Chkpt
MANAGER
RUNNING
EXTRACT
RUNNING
EXT1
00:00:00
00:00:06
EXTRACT
RUNNING
PUMP1
00:00:00
00:00:01
1.6.目标端操作
1.6.1.查看tail文件
可以看到目标端也生成了新的tail文件号,目标端从这个文件应用数据
[root@www.cndba.cn dirdat]# ll
total 21484
drwxr-xr-x 2 root
root
4096 Jun
7 15:48 backup
-rw-rw-rw- 1 oracle oinstall
1444 Jun
7 16:11 et000000
-rw-rw-rw- 1 oracle oinstall
0 Jun
7 16:19 et000001
-rw-rw-rw- 1 oracle oinstall 21989995 Jun
7 16:35 et000002
1.6.2.设置目标段读取进程,从2号文件开始读取
GGSCI (cndba) 74> alter REPLICAT rep1 extseqno 2, extrba 0
REPLICAT altered.
GGSCI (cndba) 75> start rep1
Sending START request to MANAGER ...
REPLICAT REP1 starting
GGSCI (cndba) 76> info all
Program
Status
Group
Lag at Chkpt
Time Since Chkpt
MANAGER
RUNNING
REPLICAT
RUNNING
REP1
00:00:00
00:00:04
1.6.3.检查目标端数据
SQL> select count(1) from test1;
COUNT(1)
----------
100000
1.7.命令
--前滚重新生成一个新的队列文件
alter extract xxx etrollover
--从指定时间重新抓取(重新抓取数据前提:归档文件没有删除)
ALTER EXTRACT xxx, TRANLOG, BEGIN 2010-12-31 08:00
--重置抽取进程,本地文件序列号从0开始生成。
alter extract ext1,extseqno 0,extrba 0
--重置读取进程,重新从0号trial文件开始读取。
alter replicat rep1,extseqno 0,extrba 0
转载于:https://www.cnblogs.com/xibuhaohao/p/10767449.html
最后
以上就是忧伤学姐为你收集整理的Oracle 11g 测试ogg中断之后,重新同步操作1.测试ogg中断之后,重新同步操作的全部内容,希望文章能够帮你解决Oracle 11g 测试ogg中断之后,重新同步操作1.测试ogg中断之后,重新同步操作所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复