发布于:2021-01-26 11:54:50
0
69
0
在我之前的一篇文章中,我们讨论了如何设置和使用集成捕获模式,以及如何使用集成捕获模式的下游挖掘数据库选项。
现在让我们看看如何将经典捕获升级为集成捕获。
综上所述,经典捕获和集成捕获模式之间的主要区别在于,在经典捕获中,extract联机读取Oracle数据库(视情况而定)重做日志文件以捕获更改,而在集成捕获模式中,数据库日志挖掘服务器读取重做日志文件并捕获数据库中的更改LCR(逻辑更改记录)的形式,然后由金门提取过程访问。
让我们看看这个升级过程的一个例子。
在本例中,我们有一个名为testme的(经典捕获)提取组。为了这个示例的目的,我们创建了一个没有任何datapump提取组的直接提取组。
GGSCI (pdemvrhl062) 2> ADD EXTRACT testme, TRANLOG BEGIN NOW
EXTRACT added.
GGSCI (pdemvrhl062) 3> ADD RMTTRAIL ./dirdat/ie EXTRACT testme
RMTTRAIL added.
GGSCI (pdemvrhl062) 5> EDIT PARAMS testme
EXTRACT testme
USERID ggate, PASSWORD ggate
RMTHOST 10.32.xxx.xx, MGRPORT 7809
RMTTRAIL ./dirdat/ie
TABLE sh.countries;
GGSCI (pdemvrhl062) 7> START EXTRACT testme
Sending START request to MANAGER ...
EXTRACT TESTME starting
我们可以看到,一旦提取过程开始,它就会读取数据库的在线重做日志文件——因此我们知道这是一个经典的提取。
GGSCI (pdemvrhl062) 8> INFO EXTRACT testme
EXTRACT TESTME Last Started 2013-02-08 17:26 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:02:32 ago)
Log Read Checkpoint Oracle Redo Logs
2013-02-08 17:23:42 Seqno 75, RBA 1308688
SCN 0.0 (0)
要将经典捕获升级为集成捕获,我们需要首先停止提取过程并将其注册到数据库中。
GGSCI (pdemvrhl062) 13> STOP EXTRACT testme
Sending STOP request to EXTRACT TESTME ...
Request processed.
GGSCI (pdemvrhl062) 14> REGISTER EXTRACT testme DATABASE
2013-02-08 17:37:34 WARNING OGG-02064 Oracle compatibility version 11.2.0.0.0 has limited datatype support for integrated capture. Version 11.2.0.3 required for full support.
2013-02-08 17:38:22 INFO OGG-02003 Extract TESTME successfully registered with database at SCN 3114483.
我们现在可以检查一下是否可以升级摘录。
在我的例子中,我注意到如下所示的一条错误消息,指出在这个阶段无法升级摘录。
GGSCI (pdemvrhl062) 13> STOP EXTRACT testme
Sending STOP request to EXTRACT TESTME ...
Request processed.
GGSCI (pdemvrhl062) 14> REGISTER EXTRACT testme DATABASE
2013-02-08 17:37:34 WARNING OGG-02064 Oracle compatibility version 11.2.0.0.0 has limited datatype support for integrated capture. Version 11.2.0.3 required for full support.
2013-02-08 17:38:22 INFO OGG-02003 Extract TESTME successfully registered with database at SCN 3114483.
GGSCI (pdemvrhl062) 4> INFO testme UPGRADE
ERROR: Extract TESTME is not ready to be upgraded because recovery SCN 3114444 has not reached SCN 3114483.
为了解决这个错误,我发出了alterextract命令,启动并立即停止了提取。
GGSCI (pdemvrhl062) 5> ALTER EXTRACT testme TRANLOG BEGIN NOW
EXTRACT altered.
GGSCI (pdemvrhl062) 7> START EXTRACT testme
Sending START request to MANAGER ...
EXTRACT TESTME starting
GGSCI (pdemvrhl062) 8> INFO EXTRACT testme
EXTRACT TESTME Last Started 2013-02-08 17:44 Status RUNNING
Checkpoint Lag 00:00:42 (updated 00:00:01 ago)
Log Read Checkpoint Oracle Redo Logs
2013-02-08 17:44:05 Seqno 84, RBA 44048
SCN 0.0 (0)
GGSCI (pdemvrhl062) 9> STOP EXTRACT testme
Sending STOP request to EXTRACT TESTME ...
Request processed.
现在我们看到摘录已经可以升级了。
GGSCI (pdemvrhl062) 10> INFO testme UPGRADE
Extract TESTME is ready to be upgraded to integrated capture.
为了升级经典的capture extract,我们使用upgrade INTEGRATED TRANLOG命令,如下所示。
GGSCI (pdemvrhl062) 11> ALTER EXTRACT testme , UPGRADE INTEGRATED TRANLOG
Extract TESTME successfully upgraded to integrated capture.
GGSCI (pdemvrhl062) 12> START EXTRACT testme
Sending START request to MANAGER ...
EXTRACT TESTME starting
GGSCI (pdemvrhl062) 13> INFO EXTRACT testme
EXTRACT TESTME Initialized 2013-02-08 17:44 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:01:57 ago)
Log Read Checkpoint Oracle Integrated Redo Logs
2013-02-08 17:44:59
SCN 0.3142900 (3142900)
我们可以看到摘录不再读取重做日志文件。请注意经典捕获和集成捕获之间的区别。
经典
Log Read Checkpoint Oracle Redo Logs
2013-02-08 17:44:05 Seqno 84, RBA 44048
SCN 0.0 (0)
集成
Log Read Checkpoint Oracle Integrated Redo Logs
2013-02-08 17:44:59
SCN 0.3142900 (3142900)
我们可以看到,在升级到集成捕获之后,在数据库中创建了一个队列和队列表。
SQL> select CAPTURE_NAME, QUEUE_NAME, STATUS from DBA_CAPTURE;
CAPTURE_NAME QUEUE_NAME STATUS
------------------------------ ------------------------------ --------
OGG$CAP_TESTME OGG$Q_TESTME ENABLED
SQL> select OWNER, QUEUE_TABLE, QUEUE_TYPE from dba_queues
2 where NAME='OGG$Q_TESTME';
OWNER QUEUE_TABLE
------------------------------ ------------------------------
QUEUE_TYPE
--------------------
GGATE OGG$Q_TAB_TESTME
NORMAL_QUEUE
作者介绍