关于integrated capture mode官方文档一些介绍:
http://docs.oracle.com/goldengate/1212/gg-winux/GIORA/process_mode.htm#CACCDCEA
http://www.oracle.com/technetwork/database/availability/8398-goldengate-integrated-capture-1888658.pdf
In integrated capture mode, the Oracle GoldenGate Extract process interacts directly with a database logmining server to receive data changes in the form of logical change records (LCR). Integrated capture supports more data and storage types as compared to classic capture, and the support is more transparent.
[img]http://www.orasql.com/blog/uploadfiles/goldengate%20integrated%20capture%20mode%20image_16448.png[/img]
integrated capture的优势:
The following are some additional benefits of integrated capture:
*
Because integrated capture is fully integrated with the database, no additional setup is required to work with Oracle RAC, ASM, and TDE.
*
Integrated capture uses the database logmining server to access the Oracle redo stream, with the benefit of being able to automatically switch between different copies of archive logs or different mirrored versions of the online logs. Thus integrated capture can transparently handle the absence of a log file caused by disk corruption, hardware failure, or operator error, assuming that additional copies of the archived and online logs are available
*
Integrated capture enables faster filtering of tables.
*
Integrated capture handles point-in-time recovery and RAC integration more efficiently.
*
Integrated capture features integrated log management. The Oracle Recovery Manager (RMAN) automatically retains the archive logs that are needed by Extract.
*
Integrated capture is the only mode that supports capture from a multitenant container database. One Extract can mine multiple pluggable databases within a multitenant container database.
*
For a release 11.2.0.4 source database and later (with source compatibility set to 11.2.0.4 or higher), the capture of DDL is performed by the logmining server asynchronously and requires no special triggers, tables, or other database objects to be installed. Oracle GoldenGate upgrades can be performed without stopping user applications. The use of a DDL trigger and supporting objects is required when Extract is in integrated mode with an Oracle 11g source database that is earlier than version 11.2.0.4.
调整enable_goldengate_replication参数为true 11.2.0.4新特性
[code]SQL> alter system set enable_goldengate_replication=TRUE scope=both;
System altered. [/code]
内存调整
[code]SQL> show parameter stream
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
streams_pool_size big integer 0
SQL> show parameter sga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 400M
sga_target big integer 0
SQL> alter system set memory_max_target=600m scope=spfile;
System altered.
startup force
SQL> alter system set memory_target=600m scope =both;
System altered.
SQL> alter system set sga_target=400m scope=both;
System altered.
SQL> ALTER SYSTEM SET streams_pool_size=100m scope = both;
System altered. [/code]
设置归档模式
省略
设置权限
[code]BEGIN
dbms_goldengate_auth.grant_admin_privilege
(
grantee => 'OGGUSER',
privilege_type => 'CAPTURE',
grant_select_privileges => TRUE
);
END;
/ [/code]
设置权限后,需要重新dblogin,不然REGISTER 会报错,如下:
[code]GGSCI (localhost.localdomain) 43> REGISTER EXTRACT int_ext DATABASE
2014-01-08 14:56:48 ERROR OGG-01755 Cannot register or unregister EXTRACT INT_EXT because of the following SQL error: User ogguser does not have the required privileges to use integrated capture. See Extract user privileges in the Oracle GoldenGate for Oracle Installation and Setup Guide.
GGSCI (localhost.localdomain) 44> dblogin userid ogguser,password ogguser
Successfully logged into database. [/code]
创建测试表
[code]SQL> create table awen.int_ext_test (id number(3) primary key,name varchar2(20));
Table created.
SQL> create table scott.int_ext_test (id number(3) primary key,name varchar2(20));
Table created. [/code]
添加抽取进程:
[code]GGSCI (localhost.localdomain) 19> ADD EXTRACT int_ext INTEGRATED TRANLOG, BEGIN NOW
EXTRACT added.[/code]
将进程注册到数据库
[code]GGSCI (localhost.localdomain) 44> dblogin userid ogguser,password ogguser
Successfully logged into database.
GGSCI (localhost.localdomain) 45> REGISTER EXTRACT int_ext DATABASE
2014-01-08 14:57:37 WARNING OGG-02064 Oracle compatibility version 11.2.0 has limited datatype support for integrated capture. Version 11.2.0.3 required for full support.
2014-01-08 14:58:01 INFO OGG-02003 Extract INT_EXT successfully registered with database at SCN 15621984. [/code]
添加附件日志
[code]GGSCI (localhost.localdomain) 50> add trandata awen.int_ext_test
Logging of supplemental redo data enabled for table AWEN.INT_EXT_TEST. [/code]
添加队列文件
[code]GGSCI (localhost.localdomain) 46> ADD EXTTRAIL ./dirdat/ya, EXTRACT int_ext
EXTTRAIL added.[/code]
添加传输进程
[code]GGSCI (localhost.localdomain) 47> ADD EXTRACT int_dp EXTTRAILSOURCE ./dirdat/ya
EXTRACT added.[/code]
添加目标端队列文件
[code]GGSCI (localhost.localdomain) 48> ADD RMTTRAIL ./dirdat/yb , EXTRACT int_dp [/code]
添加复制进程
[code]GGSCI (localhost.localdomain) 57> ADD REPLICAT int_rep, EXTTRAIL ./dirdat/yb
REPLICAT added. [/code]
各进程参数配置如下:
[code]GGSCI (localhost.localdomain) 88> view params int_ext
EXTRACT int_ext
USERID ogguser, PASSWORD ogguser
TRANLOGOPTIONS INTEGRATEDPARAMS (MAX_SGA_SIZE 50)
EXTTRAIL ./dirdat/ya
TABLE awen.int_ext_test;
GGSCI (localhost.localdomain) 90> view params int_dp
EXTRACT int_dp
USERID ogguser,PASSWORD ogguser
RMTHOST 127.0.0.1,MGRPORT 7848,COMPRESS
RMTTRAIL ./dirdat/yb
TABLE awen.*;
GGSCI (localhost.localdomain) 91> view params int_rep
replicat int_rep
ASSUMETARGETDEFS
USERID ogguser, PASSWORD ogguser
DISCARDFILE ./dirrpt/int_rep.dsc, PURGE
map awen.int_ext_test, target scott.int_ext_test;[/code]
启动各进程
[code]start int*[/code]
简单数据测试:
源端
[code]SQL> insert into awen.int_ext_test values(101,'Steven');
1 row created.
SQL> commit;
Commit complete.
SQL> update awen.int_ext_test set name='Jobs' where id=101;
1 row updated.
SQL> commit;
Commit complete.
SQL> delete from awen.int_ext_test where id=101;
1 row deleted.
SQL> commit;
Commit complete. [/code]
目标端
[code]SQL> select * from scott.int_ext_test;
ID NAME
---------- --------------------
101 Steven
SQL> /
ID NAME
---------- --------------------
101 Jobs
SQL> /
no rows selected
SQL> select object_name,object_type from ogguser.user_objects where object_type not in ('TABLE','INDEX','LOB');
OBJECT_NAME OBJECT_TYPE
------------------------------ -------------------
AQ$_OGG$Q_TAB_INT_EXT_V EVALUATION CONTEXT
AQ$OGG$Q_TAB_INT_EXT_S VIEW
AQ$_OGG$Q_TAB_INT_EXT_N SEQUENCE
AQ$_OGG$Q_TAB_INT_EXT_E QUEUE
AQ$_OGG$Q_TAB_INT_EXT_F VIEW
AQ$OGG$Q_TAB_INT_EXT VIEW
OGG$Q_INT_EXT_R RULE SET
OGG$Q_INT_EXT_N RULE SET
AQ$OGG$Q_TAB_INT_EXT_R VIEW
OGG$Q_INT_EXT QUEUE
OGG$INT_EXT_CAPTURE_I RULE SET
OGG$INT_EXT_CAPTURE_E RULE SET
INT_EXT_TEST7 RULE
GGS_TRACE8 RULE
ORASQL9 RULE [/code]
alert中的信息
[code]GoldenGate CAPTURE CP01 for OGG$CAP_INT_EXT with pid=26, OS id=2832 is in combined capture and apply mode.
Capture OGG$CAP_INT_EXT is handling 1 applies.
-- capture is running in apply-state checkpoint mode.
Starting persistent Logminer Session with sid = 1 for GoldenGate Capture OGG$CAP_INT_EXT
LOGMINER: Parameters summary for session# = 1
LOGMINER: Number of processes = 4, Transaction Chunk Size = 1
LOGMINER: Memory Size = 33M, Checkpoint interval = 1000M
LOGMINER: SpillScn 0, ResetLogScn 1
LOGMINER: summary for session# = 1
LOGMINER: StartScn: 15723448 (0x0000.00efebb8)
LOGMINER: EndScn: 0
LOGMINER: HighConsumedScn: 15723448 (0x0000.00efebb8)
LOGMINER: session_flag: 0xf0
LOGMINER: DDL CKPT is on.
LOGMINER: Read buffers: 64
LOGMINER: Memory LWM: limit 10M, LWM 26M, 79%
LOGMINER: Memory Release Limit: 1M
LOGMINER: LowCkptScn: 15723286 (0x0000.00efeb16)
LOGMINER: HighCkptScn: 0 (0x0000.00000000)
LOGMINER: SkipScn: 15723286 (0x0000.00efeb16)
Thu Jan 09 10:35:43 2014
db_recovery_file_dest_size of 2048 MB is 3.81% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Thu Jan 09 10:35:44 2014
LOGMINER: session#=1 (OGG$CAP_INT_EXT), reader MS00 pid=28 OS id=2846 sid=17 started
Thu Jan 09 10:35:44 2014
LOGMINER: session#=1 (OGG$CAP_INT_EXT), builder MS01 pid=29 OS id=2848 sid=134 started
Thu Jan 09 10:35:44 2014
LOGMINER: session#=1 (OGG$CAP_INT_EXT), preparer MS02 pid=30 OS id=2850 sid=15 started
Thu Jan 09 10:35:44 2014
LOGMINER: session#=1 (OGG$CAP_INT_EXT), preparer MS03 pid=32 OS id=2852 sid=19 started
Thu Jan 09 10:35:44 2014
Starting background process CJQ0
Thu Jan 09 10:35:44 2014
CJQ0 started with pid=34, OS id=2856
Thu Jan 09 10:35:49 2014
CAPTURE OGG$CAP_INT_EXT: Session Restart SCN: 15723286
LOGMINER: Begin mining logfile for session 1 thread 1 sequence 186, /oracle/flash_recovery_area/ORASQL/archivelog/2014_01_09/o1_mf_1_186_9dw2qbs5_.arc
LOGMINER: End mining logfile for session 1 thread 1 sequence 186, /oracle/flash_recovery_area/ORASQL/archivelog/2014_01_09/o1_mf_1_186_9dw2qbs5_.arc
LOGMINER: Begin mining logfile for session 1 thread 1 sequence 187, /oracle/oradata/orasql/logfile/redo01.log
knlbmEnq: all subscribers are inactive - stop enqueuing. Capture Name: OGG$CAP_INT_EXT[/code]
http://docs.oracle.com/goldengate/1212/gg-winux/GIORA/process_mode.htm#CACCDCEA
http://www.oracle.com/technetwork/database/availability/8398-goldengate-integrated-capture-1888658.pdf
In integrated capture mode, the Oracle GoldenGate Extract process interacts directly with a database logmining server to receive data changes in the form of logical change records (LCR). Integrated capture supports more data and storage types as compared to classic capture, and the support is more transparent.
[img]http://www.orasql.com/blog/uploadfiles/goldengate%20integrated%20capture%20mode%20image_16448.png[/img]
integrated capture的优势:
The following are some additional benefits of integrated capture:
*
Because integrated capture is fully integrated with the database, no additional setup is required to work with Oracle RAC, ASM, and TDE.
*
Integrated capture uses the database logmining server to access the Oracle redo stream, with the benefit of being able to automatically switch between different copies of archive logs or different mirrored versions of the online logs. Thus integrated capture can transparently handle the absence of a log file caused by disk corruption, hardware failure, or operator error, assuming that additional copies of the archived and online logs are available
*
Integrated capture enables faster filtering of tables.
*
Integrated capture handles point-in-time recovery and RAC integration more efficiently.
*
Integrated capture features integrated log management. The Oracle Recovery Manager (RMAN) automatically retains the archive logs that are needed by Extract.
*
Integrated capture is the only mode that supports capture from a multitenant container database. One Extract can mine multiple pluggable databases within a multitenant container database.
*
For a release 11.2.0.4 source database and later (with source compatibility set to 11.2.0.4 or higher), the capture of DDL is performed by the logmining server asynchronously and requires no special triggers, tables, or other database objects to be installed. Oracle GoldenGate upgrades can be performed without stopping user applications. The use of a DDL trigger and supporting objects is required when Extract is in integrated mode with an Oracle 11g source database that is earlier than version 11.2.0.4.
调整enable_goldengate_replication参数为true 11.2.0.4新特性
[code]SQL> alter system set enable_goldengate_replication=TRUE scope=both;
System altered. [/code]
内存调整
[code]SQL> show parameter stream
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
streams_pool_size big integer 0
SQL> show parameter sga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 400M
sga_target big integer 0
SQL> alter system set memory_max_target=600m scope=spfile;
System altered.
startup force
SQL> alter system set memory_target=600m scope =both;
System altered.
SQL> alter system set sga_target=400m scope=both;
System altered.
SQL> ALTER SYSTEM SET streams_pool_size=100m scope = both;
System altered. [/code]
设置归档模式
省略
设置权限
[code]BEGIN
dbms_goldengate_auth.grant_admin_privilege
(
grantee => 'OGGUSER',
privilege_type => 'CAPTURE',
grant_select_privileges => TRUE
);
END;
/ [/code]
设置权限后,需要重新dblogin,不然REGISTER 会报错,如下:
[code]GGSCI (localhost.localdomain) 43> REGISTER EXTRACT int_ext DATABASE
2014-01-08 14:56:48 ERROR OGG-01755 Cannot register or unregister EXTRACT INT_EXT because of the following SQL error: User ogguser does not have the required privileges to use integrated capture. See Extract user privileges in the Oracle GoldenGate for Oracle Installation and Setup Guide.
GGSCI (localhost.localdomain) 44> dblogin userid ogguser,password ogguser
Successfully logged into database. [/code]
创建测试表
[code]SQL> create table awen.int_ext_test (id number(3) primary key,name varchar2(20));
Table created.
SQL> create table scott.int_ext_test (id number(3) primary key,name varchar2(20));
Table created. [/code]
添加抽取进程:
[code]GGSCI (localhost.localdomain) 19> ADD EXTRACT int_ext INTEGRATED TRANLOG, BEGIN NOW
EXTRACT added.[/code]
将进程注册到数据库
[code]GGSCI (localhost.localdomain) 44> dblogin userid ogguser,password ogguser
Successfully logged into database.
GGSCI (localhost.localdomain) 45> REGISTER EXTRACT int_ext DATABASE
2014-01-08 14:57:37 WARNING OGG-02064 Oracle compatibility version 11.2.0 has limited datatype support for integrated capture. Version 11.2.0.3 required for full support.
2014-01-08 14:58:01 INFO OGG-02003 Extract INT_EXT successfully registered with database at SCN 15621984. [/code]
添加附件日志
[code]GGSCI (localhost.localdomain) 50> add trandata awen.int_ext_test
Logging of supplemental redo data enabled for table AWEN.INT_EXT_TEST. [/code]
添加队列文件
[code]GGSCI (localhost.localdomain) 46> ADD EXTTRAIL ./dirdat/ya, EXTRACT int_ext
EXTTRAIL added.[/code]
添加传输进程
[code]GGSCI (localhost.localdomain) 47> ADD EXTRACT int_dp EXTTRAILSOURCE ./dirdat/ya
EXTRACT added.[/code]
添加目标端队列文件
[code]GGSCI (localhost.localdomain) 48> ADD RMTTRAIL ./dirdat/yb , EXTRACT int_dp [/code]
添加复制进程
[code]GGSCI (localhost.localdomain) 57> ADD REPLICAT int_rep, EXTTRAIL ./dirdat/yb
REPLICAT added. [/code]
各进程参数配置如下:
[code]GGSCI (localhost.localdomain) 88> view params int_ext
EXTRACT int_ext
USERID ogguser, PASSWORD ogguser
TRANLOGOPTIONS INTEGRATEDPARAMS (MAX_SGA_SIZE 50)
EXTTRAIL ./dirdat/ya
TABLE awen.int_ext_test;
GGSCI (localhost.localdomain) 90> view params int_dp
EXTRACT int_dp
USERID ogguser,PASSWORD ogguser
RMTHOST 127.0.0.1,MGRPORT 7848,COMPRESS
RMTTRAIL ./dirdat/yb
TABLE awen.*;
GGSCI (localhost.localdomain) 91> view params int_rep
replicat int_rep
ASSUMETARGETDEFS
USERID ogguser, PASSWORD ogguser
DISCARDFILE ./dirrpt/int_rep.dsc, PURGE
map awen.int_ext_test, target scott.int_ext_test;[/code]
启动各进程
[code]start int*[/code]
简单数据测试:
源端
[code]SQL> insert into awen.int_ext_test values(101,'Steven');
1 row created.
SQL> commit;
Commit complete.
SQL> update awen.int_ext_test set name='Jobs' where id=101;
1 row updated.
SQL> commit;
Commit complete.
SQL> delete from awen.int_ext_test where id=101;
1 row deleted.
SQL> commit;
Commit complete. [/code]
目标端
[code]SQL> select * from scott.int_ext_test;
ID NAME
---------- --------------------
101 Steven
SQL> /
ID NAME
---------- --------------------
101 Jobs
SQL> /
no rows selected
SQL> select object_name,object_type from ogguser.user_objects where object_type not in ('TABLE','INDEX','LOB');
OBJECT_NAME OBJECT_TYPE
------------------------------ -------------------
AQ$_OGG$Q_TAB_INT_EXT_V EVALUATION CONTEXT
AQ$OGG$Q_TAB_INT_EXT_S VIEW
AQ$_OGG$Q_TAB_INT_EXT_N SEQUENCE
AQ$_OGG$Q_TAB_INT_EXT_E QUEUE
AQ$_OGG$Q_TAB_INT_EXT_F VIEW
AQ$OGG$Q_TAB_INT_EXT VIEW
OGG$Q_INT_EXT_R RULE SET
OGG$Q_INT_EXT_N RULE SET
AQ$OGG$Q_TAB_INT_EXT_R VIEW
OGG$Q_INT_EXT QUEUE
OGG$INT_EXT_CAPTURE_I RULE SET
OGG$INT_EXT_CAPTURE_E RULE SET
INT_EXT_TEST7 RULE
GGS_TRACE8 RULE
ORASQL9 RULE [/code]
alert中的信息
[code]GoldenGate CAPTURE CP01 for OGG$CAP_INT_EXT with pid=26, OS id=2832 is in combined capture and apply mode.
Capture OGG$CAP_INT_EXT is handling 1 applies.
-- capture is running in apply-state checkpoint mode.
Starting persistent Logminer Session with sid = 1 for GoldenGate Capture OGG$CAP_INT_EXT
LOGMINER: Parameters summary for session# = 1
LOGMINER: Number of processes = 4, Transaction Chunk Size = 1
LOGMINER: Memory Size = 33M, Checkpoint interval = 1000M
LOGMINER: SpillScn 0, ResetLogScn 1
LOGMINER: summary for session# = 1
LOGMINER: StartScn: 15723448 (0x0000.00efebb8)
LOGMINER: EndScn: 0
LOGMINER: HighConsumedScn: 15723448 (0x0000.00efebb8)
LOGMINER: session_flag: 0xf0
LOGMINER: DDL CKPT is on.
LOGMINER: Read buffers: 64
LOGMINER: Memory LWM: limit 10M, LWM 26M, 79%
LOGMINER: Memory Release Limit: 1M
LOGMINER: LowCkptScn: 15723286 (0x0000.00efeb16)
LOGMINER: HighCkptScn: 0 (0x0000.00000000)
LOGMINER: SkipScn: 15723286 (0x0000.00efeb16)
Thu Jan 09 10:35:43 2014
db_recovery_file_dest_size of 2048 MB is 3.81% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Thu Jan 09 10:35:44 2014
LOGMINER: session#=1 (OGG$CAP_INT_EXT), reader MS00 pid=28 OS id=2846 sid=17 started
Thu Jan 09 10:35:44 2014
LOGMINER: session#=1 (OGG$CAP_INT_EXT), builder MS01 pid=29 OS id=2848 sid=134 started
Thu Jan 09 10:35:44 2014
LOGMINER: session#=1 (OGG$CAP_INT_EXT), preparer MS02 pid=30 OS id=2850 sid=15 started
Thu Jan 09 10:35:44 2014
LOGMINER: session#=1 (OGG$CAP_INT_EXT), preparer MS03 pid=32 OS id=2852 sid=19 started
Thu Jan 09 10:35:44 2014
Starting background process CJQ0
Thu Jan 09 10:35:44 2014
CJQ0 started with pid=34, OS id=2856
Thu Jan 09 10:35:49 2014
CAPTURE OGG$CAP_INT_EXT: Session Restart SCN: 15723286
LOGMINER: Begin mining logfile for session 1 thread 1 sequence 186, /oracle/flash_recovery_area/ORASQL/archivelog/2014_01_09/o1_mf_1_186_9dw2qbs5_.arc
LOGMINER: End mining logfile for session 1 thread 1 sequence 186, /oracle/flash_recovery_area/ORASQL/archivelog/2014_01_09/o1_mf_1_186_9dw2qbs5_.arc
LOGMINER: Begin mining logfile for session 1 thread 1 sequence 187, /oracle/oradata/orasql/logfile/redo01.log
knlbmEnq: all subscribers are inactive - stop enqueuing. Capture Name: OGG$CAP_INT_EXT[/code]
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




