共计 3072 个字符,预计需要花费 8 分钟才能阅读完成。
这篇文章将为大家详细讲解有关 ogg 中 extract 如何拆分,丸趣 TV 小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
ogg 的 extract 的拆分方法
0. 背景
OGG 在部署以后,随着业务压力的增大,可能需要增加多个 group 来处理数据同步,在这种情况下,就需要对原有的 OGG 进程拆分,同时也不能导致数据同步出现问题。
1. 停止 extract 进程
GGSCI (ogg1) 2 get; stop ext1
2. 停止 datapump 进程
这里要等到投递进程投递完成才能停止,如果在没有投递完成的情况下停止会丢数据
GGSCI (ogg1) 4 get; info dpump
EXTRACT DPUMP Last Started 2014-03-27 20:00 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:02 ago)
Process ID 20746
Log Read Checkpoint File /u01/ggs/dirdat/lt000009
2014-03-27 20:01:36.000000 RBA 19719
多次执行命令查看 rba 是否一致,如果一致说明投递完成,那么就可以停止
GGSCI (ogg1) 7 get; stop dpump
3. 记录 extract 检查点
Extract 检查点包括:Recovery Checkpoint:Sequence 和 RBA
Current Checkpoint:Sequence 和 RBA
Current Checkpoint Detail:
Read Checkpoint #1
Oracle Redo Log
Startup Checkpoint (starting position in the data source):
Thread #: 1
Sequence #: 53
RBA: 25012752
Timestamp: 2014-03-27 19:59:43.000000
SCN: 0.2085381 (2085381)
Redo File: /u01/app/oracle/oradata/dave/redo02.log
Recovery Checkpoint (position of oldest unprocessed transaction in the data source):
Thread #: 1
Sequence #: 53
RBA: 28138512
Timestamp: 2014-03-27 20:10:52.000000
SCN: 0.2086075 (2086075)
Redo File: /u01/app/oracle/oradata/dave/redo02.log
Current Checkpoint (position of last record read in the data source):
Thread #: 1
Sequence #: 53
RBA: 28141568
Timestamp: 2014-03-27 20:10:55.000000
SCN: 0.2086077 (2086077)
Redo File: /u01/app/oracle/oradata/dave/redo02.log
4. 修改原有相应的参数文件,将拆分出的表从参数文件中删除
ext1 进程
之前的
GGSCI (ogg1) 12 get; view param ext1
extract ext1
userid ggs@ogg1, password ggs
exttrail /u01/ggs/dirdat/lt
ddl include mapped objname sender.*;
table sender.*;
修改的
GGSCI (ogg1) 18 get; view param ext1
extract ext1
userid ggs@ogg1, password ggs
exttrail /u01/ggs/dirdat/lt
ddl include mapped objname sender.*;
table sender.dave1;
dpump 进程
之前的
GGSCI (ogg1) 13 get; view param dpump
extract dpump
userid ggs@ogg1, password ggs
rmthost 192.168.2.62, mgrport 7809
rmttrail /u01/ggs/dirdat/rt
passthru
table sender.*;
dynamicresolution
修改的
GGSCI (ogg1) 19 get; view param dpump
extract dpump
userid ggs@ogg1, password ggs
rmthost 192.168.2.62, mgrport 7809
rmttrail /u01/ggs/dirdat/rt
passthru
table sender.dave1;
dynamicresolution
5. 增加新的 extract,datapump
5.1 添加 Extract 进程
GGSCI (ogg1) 22 get; add extract ext3,tranlog, begin now
EXTRACT added.
GGSCI (ogg1) 23 get; add exttrail /u01/ggs/dirdat/E3, extract ext3
EXTTRAIL added.
5.2 修改抽取进程 ext3 参数:
GGSCI (ogg1) 26 get; view param ext3
extract ext3
userid ggs@ogg1, password ggs
exttrail /u01/ggs/dirdat/E3
ddl include mapped objname sender.*;
table sender.dave2;
5.3 添加 Pump 进程
GGSCI (ogg1) 28 get; add extract pump3,exttrailsource /u01/ggs/dirdat/E3
EXTRACT added.
GGSCI (ogg1) 29 get; add rmttrail /u01/ggs/dirdat/E3, extract pump3,megabytes 10
RMTTRAIL added.
5.4 配置 Data Pump 参数:
GGSCI (gg1) 56 get; view params dpump
extract pump3
userid ggs@ogg1, password ggs
rmthost 192.168.2.62, mgrport 7809
rmttrail /u01/ggs/dirdat/E3
passthru
table sender.dave2;
dynamicresolution
6. 修改新增 extract 进程的检查点
检查点为上面记录的两个检查点:current read checkpoint 和 recovery checkpoint
6.1 修改 current read checkpoint
GGSCI (ogg1) 34 get; alter ext3 extseqno 53, extrba 28141568[, thread n]
这里是重点
EXTRACT altered.
6.2 修改 recovery checkpoint
GGSCI (ogg1) 35 get; alter ext3 ioextseqno 53, ioextrba 28138512 [, thread n]
7. 确认所有参数文件正确,启动进程即可
GGSCI (ogg1) 37 get; start *
关于“ogg 中 extract 如何拆分”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。