- 配置集成抽取模式
DB VERSION : 11.2.0.3.0
GG VERSION : 12.1.2.1.5 20635622 OGGCORE_12.1.2.1.0OGGBP_PLATFORMS_150320.0454_FBO
11.2.0.3开始支持integrated capture但是需要打上对应的补丁才可以,补丁列表如下:
11.2.0.3 Database Specific Bundle Patches for Integrated Extract 11.2.x (文档 ID 1411356.1) [ora11@prim 16764834]$ /u01/app2/ora11/product/11.2.0/dbhome_1/OPatch/opatch lsinventory|grep 16764834 Patch 16764834 : applied on Fri Jun 17 00:46:03 CST 2016 |
create tablespace ogg datafile '/prod/oracle/oradata/prod/ogg01.dbf' size 400M; create user ogg identified by "123" default tablespace ogg; alter system set enable_goldengate_replication=true; ---enable force logging AND supplemental log data
---创建需要的用户并授权 create user ggs identified by ggs; GRANT CONNECT TO ggs; GRANT ALTER ANY TABLE TO ggs; GRANT ALTER SESSION TO ggs; GRANT CREATE SESSION TO ggs; GRANT FLASHBACK ANY TABLE TO ggs; GRANT SELECT ANY DICTIONARY TO ggs; GRANT SELECT ANY TABLE TO ggs; GRANT RESOURCE TO ggs; GRANT INSERT ANY TABLE TO ggs; GRANT UPDATE ANY TABLE TO ggs; GRANT DELETE ANY TABLE TO ggs; GRANT execute on utl_file to ggs; GRANT SELECT ANY TRANSACTION TO GGS;
GGSCI (prim) 10> dblogin userid ggs, password ggs Successfully logged into database. GGSCI (prim as ggs@sundb) 11> register extract ep1 database ERROR: User ggs does not have the required privileges to use integrated capture.
---需要授权, 且注意用户名要大写 SQL> exec DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE (grantee=>'GGS', privilege_type=>'capture',grant_select_privileges=>true, do_grants=>TRUE);
PL/SQL procedure successfully completed.
--对捕捉进程进行注册
GGSCI (prim as ggs@sundb) 14> register extract ep1 database
2016-06-17 00:13:53 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. ERROR: Cannot register or unregister EXTRACT EP1 because of the following SQL error: OCI Error 6,550. 上面错误是由于权限不够,授权, SQL>exec DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE (grantee=>'GGS'); ERROR: Cannot register or unregister EXTRACT EP1 because of the following SQL error: OCI Error 1,950. 上面错误是由于权限不够,授权, SQLPLUS>GRANT UNLIMITED TABLESPACE TO GGS;
GGSCI (prim as ggs@sundb) 2> register extract ep1 database
2016-06-17 01:08:21 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. Extract EP1 successfully registered with database at SCN 224553. --看到已经注册成功
dblogin userid ogg, password 123 register extract ext01 database add extract ext01, integrated tranlog, begin now add exttrail ./dirdat/e1, extract ext01, megabytes 10 |
- 普通模式转换集成模式
《ogg_配置集成模式的数据抽取复制(integrated mode)》
GGSCI (prim as ggs@sundb) 76> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING EXTRACT RUNNING DP1 00:00:00 00:00:05 EXTRACT RUNNING EP1 00:00:00 00:00:09 REPLICAT RUNNING RP2 00:00:00 00:00:08
1.Classic模式到integrated模式 GGSCI (prim as ggs@sundb) 51> stop ep1
Sending STOP request to EXTRACT EP1 ... Request processed.
GGSCI (prim as ggs@sundb) 52> register extract ep1 database
2016-07-05 23:40:18 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. ERROR: This EXTRACT EP1 is already registered with the database.
GGSCI (prim as ggs@sundb) 54> alter extract ep1, upgrade integrated tranlog, begin now Extract EP1 successfully upgraded to integrated capture.
GGSCI (prim as ggs@sundb) 55>
GGSCI (prim) 44> info ep1
EXTRACT EP1 Last Started 2016-07-05 23:28 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:01 ago) Process ID 2781 Log Read Checkpoint Oracle Redo Logs 2016-07-05 23:29:52 Seqno 56, RBA 27651072 SCN 0.480608 (480608)
GGSCI (prim as ggs@sundb) 63> info ep1
EXTRACT EP1 Last Started 2016-07-05 23:41 Status RUNNING Checkpoint Lag 00:00:02 (updated 00:00:05 ago) Process ID 2826 Log Read Checkpoint Oracle Integrated Redo Logs 2016-07-05 23:42:31 SCN 0.481435 (481435)
2. integrated模式到Classic模式 GGSCI (prim as ggs@sundb) 70> alter extract ep1, downgrade tranlog Extract EP1 successfully downgraded from integrated capture.
GGSCI (prim as ggs@sundb) 71> info ep1
EXTRACT EP1 Initialized 2016-07-05 23:41 Status STOPPED Checkpoint Lag 00:00:02 (updated 00:02:47 ago) Log Read Checkpoint Oracle Redo Logs 2016-07-05 23:43:22 Seqno 56, RBA 28278864 SCN 0.481559 (481559)
GGSCI (prim as ggs@sundb) 72> unregister ep1 database ERROR: Invalid command.
GGSCI (prim as ggs@sundb) 73> unregister extract ep1 database Successfully unregistered EXTRACT EP1 from database.
GGSCI (prim as ggs@sundb) 74> start ep1
Sending START request to MANAGER ... EXTRACT EP1 starting
GGSCI (prim as ggs@sundb) 75> info ep1
EXTRACT EP1 Last Started 2016-07-05 23:46 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:01 ago) Process ID 2859 Log Read Checkpoint Oracle Redo Logs First Record Seqno 56, RBA 28277264 SCN 0.481558 (481558)
GGSCI (prim as ggs@sundb) 76>
UPGRADE INTEGRATED TRANLOG 实现从classic capture mode 到 integrated capture mode ALTER EXTRACT finance, UPGRADE INTEGRATED TRANLOG DOWNGRADE INTEGRATED TRANLOG 实现从integrated capture mode 到 classic capture mode ALTER EXTRACT finance, DOWNGRADE INTEGRATED TRANLOG |