Integrated Capture - Local deployment - Bright DBA
AIM: Configure GoldenGate 12C Integrated Capture (All extract/pump and replicat on same database/server).
oracle performanceintermediate
by OracleDba
14 views
AIM: Configure GoldenGate 12C Integrated Capture (All extract/pump and replicat on same database/server).
12345678910111213141516171819202122232425262728293031
GoldenGate 12c:
Integrated Extract is available from OGG 11g
Integrated Replicat is available from OGG 12c
What is Integrated Capture?
Instead of reading from the redo/archive logs, the Oracle GoldenGate Extract process interacts directly with a database logmining server to receive data changes in the form of logical change records (LCR).
In Pre-Goldengate 12c classic capture mode, the Oracle GoldenGate Extract process captures data changes from the Oracle redo or archive log files on the source system.
Integrated capture modes (2 Types)
a) Local deployment
The source database and the log mining server are the same database
b) Downstream deployment
<--- We will cover this soon in upcoming article
The source and log mining databases are different databases.
Server Name : RAC1,RAC2
OS Version : Red Hat Enterprise Linux 5.7
RAC :
2 Node RAC
Database Version :
11.2.0.3.10
GoldenGate Version : Version 12.1.2.0.0 for oracle db 11.2.0.3.10
Database Name :
BR8DBA (br8dba1, br8dba2)
File System : ASM
Golden Gate User : GATE
Golden Gate Extract : E11G
Golden Gate Pump : P11G
Golden Gate Replicat : R11G
Source Schema : SENDER
Target Schema : RECEIVER
Oracle Home : /u01/app/oracle/product/11.2.0.3/db_1
GoldenGate Home : /u01/app/oracle/product/gg/ogg11 (shared home)1
http://www.br8dba.com/goldengate-12c-installation/1234567891011121314151617181920212223
SQL>
create user sender identified by sender default tablespace users temporary tablespace temp;
User created.
SQL> grant connect,resource,unlimited tablespace to sender;
Grant succeeded.
SQL>
create user receiver identified by receiver default tablespace users temporary tablespace temp;
User created.
SQL> grant connect,resource,unlimited tablespace to receiver;
Grant succeeded.
SQL>
SQL>
exec DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE('GATE', 'capture');
PL/SQL procedure successfully completed.
SQL>123456789101112131415161718192021222324252627282930313233343536373839
On Instance 1 (br8dba1):
SQL>
alter system set streams_pool_size=150M sid='br8dba1';
System altered.
SQL>
On Instance 2 (br8dba2):
SQL>
alter system set streams_pool_size=150M sid='br8dba2';
System altered.
SQL>
SQL> select ISSYS_MODIFIABLE from V$PARAMETER where NAME='compatible';
ISSYS_MOD
---------
FALSE
SQL>
SQL>
show parameter compatible
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
compatible string
11.2.0.3.0 <----
SQL>
*** Database version should be atleast 11.2.0.3.0 OR above
*** Also using below MOS note we have to apply patch based on your current PSU
11.2.0.3 Database Specific Bundle Patches for Integrated Extract 11.2.x (Doc ID 1411356.1)
[oracle@rac1 ~]$
opatch lsinventory | grep -i 18466925
Patch 18466925 : applied on Mon Dec 05 21:56:31 IST 2016
[oracle@rac1 ~]$123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
SQL>
@marker_setup.sql
Marker setup script
You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
Enter Oracle GoldenGate schema name:
gate <---
Marker setup table script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GATE
MARKER TABLE
-------------------------------
OK
MARKER SEQUENCE
-------------------------------
OK
Script complete.
SQL>
SQL>
@ddl_setup.sql;
Oracle GoldenGate DDL Replication setup script
Verifying that current user has privileges to install DDL Replication...
You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
NOTE: For an Oracle 10g source, the system recycle bin must be disabled. For Oracle 11g and later, it can be enabled.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
Enter Oracle GoldenGate schema name:
gate <----
Working, please wait ...
Spooling to file ddl_setup_spool.txt
Checking for sessions that are holding locks on Oracle Golden Gate metadata tables ...
Check complete.
Using GATE as a Oracle GoldenGate schema name.
Working, please wait ...
DDL replication setup script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GATE
CLEAR_TRACE STATUS:
Line/pos Error
---------- --------------------------
No errors No errors
CREATE_TRACE STATUS:
Line/pos Error
---------- --------------------------
No errors No errors
TRACE_PUT_LINE STATUS:
Line/pos Error
---------- --------------------------
No errors No errors
INITIAL_SETUP STATUS:
Line/pos Error
---------- --------------------------
No errors No errors
DDLVERSIONSPECIFIC PACKAGE STATUS:
Line/pos Error
---------- --------------------------
No errors No errors
DDLREPLICATION PACKAGE STATUS:
Line/pos Error
---------- ----------------------------
No errors No errors
DDLREPLICATION PACKAGE BODY STATUS:
Line/pos Error
---------- ----------------------------
No errors No errors
DDL IGNORE TABLE
-----------------------------------
OK
DDL IGNORE LOG TABLE
-----------------------------------
OK
DDLAUX PACKAGE STATUS:
Line/pos Error
---------- ----------------------------
No errors No errors
DDLAUX PACKAGE BODY STATUS:
Line/pos Error
---------- ----------------------------
No errors No errors
SYS.DDLCTXINFO PACKAGE STATUS:
Line/pos Error
---------- ----------------------------
No errors No errors
SYS.DDLCTXINFO PACKAGE BODY STATUS:
Line/pos Error
---------- ----------------------------
No errors No errors
DDL HISTORY TABLE
-----------------------------------
OK
DDL HISTORY TABLE(1)
-----------------------------------
OK
DDL DUMP TABLES
-----------------------------------
OK
DDL DUMP COLUMNS
-----------------------------------
OK
DDL DUMP LOG GROUPS
-----------------------------------
OK
DDL DUMP PARTITIONS
-----------------------------------
OK
DDL DUMP PRIMARY KEYS
-----------------------------------
OK
DDL SEQUENCE
-----------------------------------
OK
GGS_TEMP_COLS
-----------------------------------
OK
GGS_TEMP_UK
-----------------------------------
OK
DDL TRIGGER CODE STATUS:
Line/pos Error
---------- ------------------------------
No errors No errors
DDL TRIGGER INSTALL STATUS
-----------------------------------
OK
DDL TRIGGER RUNNING STATUS
-----------------------------------
ENABLED
STAYMETADATA IN TRIGGER
-----------------------------------
OFF
DDL TRIGGER SQL TRACING
-----------------------------------
0
DDL TRIGGER TRACE LEVEL
-----------------------------------
0
LOCATION OF DDL TRACE FILE
----------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/br8dba/br8dba1/trace/ggs_ddl_trace.log
Analyzing installation status...
VERSION OF DDL REPLICATION
----------------------------------------------------------------------
OGGCORE_12.1.2.0.0_PLATFORMS_130924.1316
STATUS OF DDL REPLICATION
----------------------------------------------------------------------
SUCCESSFUL installation of DDL Replication software components
Script complete.
SQL>123456789101112131415161718
SQL>
@ddl_enable.sql;
Trigger altered.
SQL>
SQL>
@ddl_pin.sql
gate
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
SQL>12345678910111213
[oracle@rac1 ~]$
cat 11.env
GG11=/u01/app/oracle/product/gg/ogg11; export GG11
ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db_1; export ORACLE_HOME
ORACLE_SID=br8dba1; export ORACLE_SID
PATH=$PATH:/u01/app/oracle/product/gg/ogg11; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/u01/app/oracle/product/gg/ogg11; export LD_LIBRARY_PATH
alias ggsci='cd $GG11; ./ggsci'
[oracle@rac1 ~]$
[oracle@rac1 ~]$
. 11.env
[oracle@rac1 ~]$12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
[oracle@rac1 ~]$
ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 12.1.2.0.0 17185003 OGGCORE_12.1.2.0.0_PLATFORMS_130924.1316_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Sep 25 2013 00:31:13
Operating system character set identified as UTF-8.
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
GGSCI (rac1.rajasekhar.com) 1>
dblogin userid gate, password gate
Successfully logged into database.
GGSCI (rac1.rajasekhar.com) 2>
GGSCI (rac1.rajasekhar.com) 2> edit param mgr
-- Add below entries
PORT 15500
DYNAMICPORTLIST 15510-15520
PURGEOLDEXTRACTS /u01/app/oracle/product/gg/ogg11/dirdat/*, USECHECKPOINTS
GGSCI (rac1.rajasekhar.com) 3>
view params mgr
PORT 15500
DYNAMICPORTLIST 15510-15520
PURGEOLDEXTRACTS /u01/app/oracle/product/gg/ogg11/dirdat/*, USECHECKPOINTS
GGSCI (rac1.rajasekhar.com) 4>
GGSCI (rac1.rajasekhar.com) 4>
ADD EXTRACT E11G
INTEGRATED TRANLOG
, BEGIN NOW
EXTRACT added.
GGSCI (rac1.rajasekhar.com) 5>
ADD EXTTRAIL ./dirdat/ea, EXTRACT E11G, MEGABYTES 50
EXTTRAIL added.
GGSCI (rac1.rajasekhar.com) 6> edit params E11G
-- Add below entries
EXTRACT E11G
EXTTRAIL ./dirdat/ea
USERID gate, PASSWORD gate
TRANLOGOPTIONS INTEGRATEDPARAMS (MAX_SGA_SIZE 100)
DDL INCLUDE ALL
DDLOPTIONS REPORT
TABLE sender.*;
GGSCI (rac1.rajasekhar.com) 7>
view params E11G
EXTRACT E11G
EXTTRAIL ./dirdat/ea
USERID gate, PASSWORD gate
TRANLOGOPTIONS INTEGRATEDPARAMS (MAX_SGA_SIZE 100)
DDL INCLUDE ALL
DDLOPTIONS REPORT
TABLE sender.*;
GGSCI (rac1.rajasekhar.com) 8>
GGSCI (rac1.rajasekhar.com) 14>
REGISTER EXTRACT E11G DATABASE
Extract E11G successfully registered with database at SCN 2152703.
GGSCI (rac1.rajasekhar.com) 15>12345678910111213141516171819
GGSCI (rac1.rajasekhar.com) 8>
ADD EXTRACT P11G, EXTTRAILSOURCE ./dirdat/ea
EXTRACT added.
GGSCI (rac1.rajasekhar.com) 9> A
DD RMTTRAIL ./dirdat/pa, EXTRACT P11G, MEGABYTES 50
RMTTRAIL added.
GGSCI (rac1.rajasekhar.com) 10> edit params P11G
GGSCI (rac1.rajasekhar.com) 11>
view params P11G
EXTRACT P11G
RMTHOST 192.168.2.101, MGRPORT 15500
USERID gate, password gate
RMTTRAIL ./dirdat/pa
PASSTHRU
TABLE sender.*;
GGSCI (rac1.rajasekhar.com) 12>12345678910111213141516171819202122232425
GGSCI (rac1.rajasekhar.com) 16>
ADD
SCHEMATRANDATA
sender
2016-12-05 20:36:13 INFO OGG-01788 SCHEMATRANDATA has been added on schema sender.
2016-12-05 20:36:13 INFO OGG-01976 SCHEMATRANDATA for scheduling columns has been added on schema sender.
GGSCI (rac1.rajasekhar.com) 17>
--
The ADD SCHEMATRANDATA command adds supplemental logging to all tables both current and future for sender schema.
GGSCI (rac1.rajasekhar.com) 17>
EDIT PARAMS ./GLOBALS
-- Add below entries
GGSCHEMA GATE
ENABLEMONITORING
CHECKPOINTTABLE GATE.CHECKPOINT
GGSCI (rac1.rajasekhar.com) 18> sh cat ./GLOBALS
GGSCHEMA GATE
ENABLEMONITORING
CHECKPOINTTABLE GATE.CHECKPOINT
GGSCI (rac1.rajasekhar.com) 19>1234567891011121314151617181920212223
For the GLOBALS configuration to take effect, you must exit the session in which the changes were made. Execute the following command to exit GGSCI.
GGSCI (rac1.rajasekhar.com) 19>
exit
[oracle@rac1 ogg11]$
[oracle@rac1 ~]$
ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 12.1.2.0.0 17185003 OGGCORE_12.1.2.0.0_PLATFORMS_130924.1316_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Sep 25 2013 00:31:13
Operating system character set identified as UTF-8.
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
GGSCI (rac1.rajasekhar.com) 1>
dblogin userid gate, password gate
Successfully logged into database.
GGSCI (rac1.rajasekhar.com) 2>
ADD CHECKPOINTTABLE GATE.CHECKPOINT
Successfully created checkpoint table GATE.CHECKPOINT.
GGSCI (rac1.rajasekhar.com) 3>123456789101112131415161718192021222324252627
GGSCI (rac1.rajasekhar.com) 3>
ADD REPLICAT R11G, EXTTRAIL ./dirdat/pa,checkpointtable gate.checkpoint
REPLICAT added.
GGSCI (rac1.rajasekhar.com) 4>
edit param r11g
-- Add below
REPLICAT R11G
ASSUMETARGETDEFS
userid gate, password gate
DISCARDFILE ./dirout/receiver.dsc, purge
ASSUMETARGETDEFS
DDLOPTIONS REPORT
MAP sender.*, TARGET receiver.*;
-- The ASSUMETARGETDEFS statement means that we are assuming both source and target table structure is same.
GGSCI (rac1.rajasekhar.com) 8> view params r11g
REPLICAT R11G
ASSUMETARGETDEFS
userid gate, password gate
DISCARDFILE ./dirout/receiver.dsc, purge
ASSUMETARGETDEFS
DDLOPTIONS REPORT
MAP sender.*, TARGET receiver.*;
GGSCI (rac1.rajasekhar.com) 9>12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
GGSCI (rac1.rajasekhar.com) 9>
info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
JAGENT STOPPED
EXTRACT STOPPED E11G 00:00:00 01:18:04
EXTRACT STOPPED P11G 00:00:00 01:08:06
REPLICAT STOPPED R11G 00:00:00 00:12:02
GGSCI (rac1.rajasekhar.com) 10>
start mgr
Manager started.
GGSCI (rac1.rajasekhar.com) 11>
start extract E11G
Sending START request to MANAGER ...
EXTRACT E11G starting
GGSCI (rac1.rajasekhar.com) 12>
start extract P11G
Sending START request to MANAGER ...
EXTRACT P11G starting
GGSCI (rac1.rajasekhar.com) 13>
start replicat R11G
Sending START request to MANAGER ...
REPLICAT R11G starting
GGSCI (rac1.rajasekhar.com) 14>
info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER
RUNNING
JAGENT STOPPED
EXTRACT
RUNNING
E11G 00:00:09 00:00:00
EXTRACT
RUNNING
P11G 00:00:00 02:29:55
REPLICAT
RUNNING
R11G 00:00:00 00:00:04
GGSCI (rac1.rajasekhar.com) 5>
SQL>
conn sender/sender;
Connected.
SQL> select * from tab;
no rows selected
<----
SQL>12345678
SQL>
conn receiver/receiver
Connected.
SQL> select * from tab;
no rows selected
<---
SQL>123456789101112
SQL>
create table sugi(Name varchar2(10) PRIMARY KEY, Role varchar2(10));
Table created.
SQL>
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
SUGI TABLE <-----
SQL>12345678910111213141516171819202122232425262728293031323334353637383940414243444546
SQL>
insert into SUGI values ('&a','&b');
Enter value for a: RAJ
Enter value for b: DBA
old 1: insert into SUGI values ('&a','&b')
new 1: insert into SUGI values ('RAJ','DBA')
1 row created.
SQL> /
Enter value for a: SUGI
Enter value for b: DBA
old 1: insert into SUGI values ('&a','&b')
new 1: insert into SUGI values ('SUGI','DBA')
1 row created.
SQL> /
Enter value for a: TEJU
Enter value for b: DBA
old 1: insert into SUGI values ('&a','&b')
new 1: insert into SUGI values ('TEJU','DBA')
1 row created.
SQL> COMMIT;
Commit complete.
SQL>
SELECT * FROM SUGI;
NAME ROLE
---------- ----------
RAJ DBA
SUGI DBA
TEJU DBA
SQL>
SQL> SELECT * FROM SUGI;
NAME ROLE
---------- ----------
RAJ DBA
SUGI DBA
TEJU DBA
SQL>123456789101112131415161718192021222324252627282930313233
SQL>
update SUGI TEJU SET role='MANAGER' where name='RAJ';
1 row updated.
SQL>
update SUGI SET role='MANAGER' where name='TEJU';
1 row updated.
SQL> commit;
Commit complete.
SQL> select * from sugi;
NAME ROLE
---------- ----------
RAJ MANAGER
<----
SUGI DBA
TEJU MANAGER
<----
SQL>
SQL> select * from sugi;
NAME ROLE
---------- ----------
RAJ MANAGER
<----
SUGI DBA
TEJU MANAGER
<----
SQL>123456789101112131415
SQL>
delete from SUGI where name='RAJ';
1 row deleted.
SQL> COMMIT;
Commit complete.
SQL> SELECT * FROM SUGI;
NAME ROLE
---------- ----------
SUGI DBA
TEJU MANAGER
SQL>123456789101112131415161718192021222324252627282930
SQL> SELECT * FROM SUGI;
NAME ROLE
---------- ----------
SUGI DBA
TEJU MANAGER
SQL>
SQL>
CREATE TABLE TEST AS SELECT * FROM SUGI;
Table created.
SQL> SELECT * FROM TAB;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
SUGI TABLE
TEST TABLE <----
SQL>
ALTER TABLE TEST ADD EMPNO VARCHAR2(30);
Table altered.
SQL> desc test
Name Null? Type
--------- -------- ----------------------------
NAME VARCHAR2(10)
ROLE VARCHAR2(10)
EMPNO VARCHAR2(30)
SQL>123456789101112131415161718192021222324252627282930
SQL>
desc test
Name Null? Type
------- -------- ----------------------------
NAME VARCHAR2(10)
ROLE VARCHAR2(10)
EMPNO VARCHAR2(30)
<-----
SQL>
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
SUGI TABLE
TEST TABLE
SQL>
drop table
sugi
purge;
Table dropped.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
TEST TABLE
<----
SQL>12345678910111213141516171819
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
TEST TABLE <----
SQL>
SQL>
truncate table test;
Table truncated.
SQL> select count(*) from test;
COUNT(*)
----------
0
<----
SQL>1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
SQL> select count(*) from test;
COUNT(*)
----------
0
<----
SQL>
CAPTURE OGG$CAP_E11G: Source Database:
BR8DBA
CAPTURE OGG$CAP_E11G: Parameter Set by User: CAPTURE_IDKEY_OBJECTS Value: Y
CAPTURE OGG$CAP_E11G: Parameter Set by User: CAPTURE_SEQUENCE_NEXTVAL Value: N
CAPTURE OGG$CAP_E11G: Parameter Set by User: GETAPPLOPS Value: Y
CAPTURE OGG$CAP_E11G: Parameter Set by User: GETREPLICATES Value: N
CAPTURE OGG$CAP_E11G: Parameter Set by User: INCLUDE_OBJECTS Value: SYS.SMON_SCN_TIME
CAPTURE OGG$CAP_E11G: Parameter Set by User: MAX_SGA_SIZE Value: 100
<---
CAPTURE OGG$CAP_E11G: Parameter Set by User:
PARALLELISM Value: 2 <---
GoldenGate CAPTURE CP01 for OGG$CAP_E11G with pid=54, OS id=32549 is in combined capture and apply mode.
Capture OGG$CAP_E11G is handling 1 applies.
-- capture is running in apply-state checkpoint mode.
Starting persistent Logminer Session with sid = 1 for GoldenGate Capture OGG$CAP_E11G
LOGMINER:
Parameters summary for session# = 1
LOGMINER:
Number of processes = 4, Transaction Chunk Size = 1
LOGMINER
: Memory Size = 66M, Checkpoint interval = 1000M
LOGMINER
: SpillScn 0, ResetLogScn 1974745
LOGMINER: summary for session# = 1
LOGMINER: StartScn: 2279365 (0x0000.0022c7c5)
LOGMINER: EndScn: 0
LOGMINER: HighConsumedScn: 2279365 (0x0000.0022c7c5)
LOGMINER: session_flag: 0xf0
LOGMINER: Read buffers: 64
LOGMINER: Memory LWM limit: 10M, 79%
LOGMINER: Memory Release Limit: 15000
LOGMINER: LowCkptScn: 2275760 (0x0000.0022b9b0)
LOGMINER: HighCkptScn: 2275762 (0x0000.0022b9b2)
LOGMINER: SkipScn: 2275760 (0x0000.0022b9b0)
Tue Dec 06 00:56:22 2016
LOGMINER
: session#=1 (OGG$CAP_E11G), reader MS00 pid=55 OS id=32557 sid=164 started
Tue Dec 06 00:56:22 2016
LOGMINER
: session#=1 (OGG$CAP_E11G), builder MS01 pid=57 OS id=32561 sid=162 started
Tue Dec 06 00:56:22 2016
LOGMINER
: session#=1 (OGG$CAP_E11G), preparer MS02 pid=58 OS id=32565 sid=33 started
Tue Dec 06 00:56:22 2016
LOGMINER: session#=1 (OGG$CAP_E11G), preparer MS03 pid=60 OS id=32569 sid=22 started
CAPTURE OGG$CAP_E11G: Session Restart SCN: 2275760
LOGMINER: Begin mining logfile for session 1 thread 1 sequence 20, +TEST/br8dba/onlinelog/group_2.272.924477045
LOGMINER: Begin mining logfile for session 1 thread 2 sequence 17, +TEST/br8dba/onlinelog/group_3.271.924477045
Tue Dec 06 00:56:23 2016
XStream Out client for OGG$E11G with pid=61, OS id=32572 is waiting for GoldenGate Capture OGG$CAP_E11G to complete initializ
ation.
XStream Out client for OGG$E11G successfully attached to GoldenGate Capture OGG$CAP_E11G to receive uncommitted changes with
pid=61, OS id=32572.
[oracle@rac1 trace]$Please to add comments
No comments yet. Be the first to comment!