Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Multiple PDBs Replication In Multitenant Database Using Oracle GoldenGate 12c

unknown-1040115Mar 15 2016 — edited Mar 23 2016

Multiple Pluggable Database (PDBs) Replication in Multitenant Database Using Oracle GoldenGate 12c

Nassyam Basha (Oracle ACE Director, Author, Oracle Certified Master 11g) & Yenugula Venkata RaviKumar (Oracle ACE & Oracle Certified Master)

Introduction

Oracle GoldenGate operates in a Multitenant container database (CDB) the same way that it operates in a regular Oracle database, we will examine some of the main differences when it comes to configuring Extract and

Replicat processes when they are connecting to a pluggable database (pdb) in multitenant environment.

Below are some of the things to keep in mind when dealing with Oracle Golden Gate and 12c multitenant architecture:

  • It is available only in Integrated Capture Mode and not Classic Capture.
  • One extract can be configured to capture changes from multiple pluggable databases (PDBs).
  • We have to use integrated capture mode, a log mining server is involved and this is only accessible from the root container (CDB$ROOT) .
  • We have to connect as a common user to attach to the log mining server. Example: C##OGGUSER is what we are using in our example.
  • Replicat Process can only connect and apply to one pluggable database.

This article explains how to configure Oracle GoldenGate (OGG) software to perform uni-directional replication with between Source Container Database (cdb1) with Pluggable databases (cdb1pdb1 & cdb1pdb2) and Target Container Database (cdb2) with Pluggable databases (cdb2pdb1 & cdb2pdb2) in Multitenant environment.

Multi PDBs Replicat GG12c Image1.jpg

For this exercise, the details given below:

|

Source Database (cdb1)

|

Target Database (cdb2)

|
|

1. Oracle Enterprise Linux 5.8 (x86-64)
2. Oracle 12c R1 Database (12.1.0.1.0) ORACLE_HOME=/u01/app/oracle/product/12.1.0/db_1

3. Oracle GoldenGate 12c (12.1.2.0.0) GOLDENGATE_HOME=/u01/app/ogg/12g
4. Database Name: cdb1
5. Schema Name: pdb1user
6. Hostname: ggnode1
7. IP Address: 192.168.56.105
8. Pluggable Databases: cdb1pdb1, cdb1pdb2

|

1. Oracle Enterprise Linux 5.8 (x86-64)
2. Oracle 12c R1 Database (12.1.0.1.0) ORACLE_HOME=/u01/app/oracle/product/12.1.0/db_1
3. Oracle GoldenGate 12c (12.1.2.0.0) GOLDENGATE_HOME=/u01/app/ogg/12g
4. Database Name: cdb2

5. Schema Name: pdb1user

6. Hostname: ggnode2

7. IP Address: 192.168.56.106

8. Pluggable Databases: cdb2pdb1, cdb2pdb2

|

Oracle GoldenGate 12c processes in Source database and Target database

|

Oracle Golden Gate Processes at Source Database

|

Oracle GoldenGate Processes at Target Database

|
|

  • Manager: Listening port 7809
  • Extract Process-1: ES01
  • Extract Process-2: PS01
  • Extract Process-3: PS02

|

  • Manager: Listening port 7810
  • Replicat Process-1: RS02
  • Replicat Process-2: RS02

|

Oracle GoldenGate Processes @Source Database (Pluggable Databases – cdb1pdb1 & cdb1pdb2):

  • Extract Process (ES01): This process will capture transactions from the Oracle transactions logs with the help logmining server.

  • Extract Process (PS01 & PS02): This process reads from a trail file and not from database’s transaction log.

Oracle GoldenGate Processes @Target database (Pluggable Database – cdb2pdb1 & cdb2pdb2):

  • Replicat Process (RS01 & RS02): This process also known as Integrated Replicat Process, and tells this process from which trail file to read.

Series of Steps involved @Source Container Database (cdb1):

  • Install Oracle 12c R1 database software as a ‘oracle’ user in the following directory

    ORACLE\_HOME=/u01/app/oracle/product/12.1.0/db\_1.
    
  • Install Oracle GoldenGate 12c software as a ‘oracle’ user in the following directory

    GOLDENGATE_HOME=/u01/app/ogg/12g.

  • Configure, create subdirs for Oracle GoldenGate 12c in source database (cdb1).

  • Create and configure Manger, Extract process, Multiple Pump processes for uni-directional between Source Pluggable databases (cdb1pdb1 & cdb1pdb2) and Target Pluggable databases (cdb2pdb1 & cdb2pdb2).

  • Create database Container Database (cdb1) with pluggable databases (cdb1pdb1 & cdb1pdb2) with advanced option in DBCA with sample schemas.

  • Create database services in LISTENER for cdb1, cdb1pdb1 & cdb1pdb2.

  • Create services for cdb1, cdb1pdb1 & cdb1pdb2.

Installing Oracle Database 12c with Multitenant Option with Multiple Pluggable Databases in Source database.

Creating Container Database (cdb1) with two pluggable databases (cdb1pdb1 & cdb1pdb2)

Multi PDBs Replicat GG12c Image2.jpg

Installing Oracle GoldenGate 12c as ‘oracle’ user in Source Database

Select the option “Oracle GoldenGate for Oracle Database 12c (506.0 MB)”

Multi PDBs Replicat GG12c Image3.jpg

Multi PDBs Replicat GG12c Image4.jpg

Successfully installed Oracle GoldenGate 12c software binaries for Oracle database 12c in Source database (cdb1).

Login to Source Container Database (db1) as a ‘sysdba’

  • Log into source database (cdb1) as a ‘sysdba’

  • Create GoldenGate tablespace

  • Create GoldenGate user ‘c##ogguser’

  • Assign privileges for ‘c##ogguser’ user

  • Adds database level supplemental logging

  • dbms_goldengate_auth.grant_admin_privilege package grants the appropriate privileges for capture and apply within a multitenant container database.

    This includes the container parameter, which must be set to ALL, as shown in the following

    example: dbms_goldengate_auth.grant_admin_privilege(‘C##OGGUSER’,container=>all)

[oracle@ggnode1 ~]$ source 12c.env

[oracle@ggnode1 ~]$ echo $ORACLE_SID cdb1

[oracle@ggnode1 ~]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.1.0 Production on Sun Jun 7 00:13:12 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved.

SQL> connect sys/oracle@192.168.56.105:1521/cdb1 as sysdba Connected.

SQL> select con_id,name,open_mode from v$pdbs;

CON_ID NAME OPEN MODE

---------- -------------- ---------------

2 PDB$SEED READ ONLY

3 CDB1PDB1 READ WRITE

4 CDB1PDB2 READ WRITE

SQL> create tablespace goldengate datafile '/u01/app/oracle/oradata/cdb1/goldengate01.dbf' size 100M autoextend on;
Tablespace created.

SQL> create user c##ogguser identified by oracle container=all;

User created.

SQL> grant connect to c##ogguser container=all;

Grant succeeded.

SQL> grant dba to c##ogguser container=all;

Grant succeeded.

SQL> grant unlimited tablespace to c##ogguser container=all;

Grant succeeded.

SQL> grant create session to c##ogguser container=all;

Grant succeeded.

SQL> grant alter session to c##ogguser container=all;

Grant succeeded.

SQL> grant select any dictionary to c##ogguser container=all;

Grant succeeded.

SQL> alter database add supplemental log data;

Database altered.

SQL> alter database force logging;

Database altered.

SQL> alter pluggable database all open;

Pluggable database altered.

SQL> select con_id,name,open_mode from v$pdbs;

CON_ID NAME OPEN MODE

---------- ----------------- -------------

2 PDB$SEED READ ONLY

3            CDB1PDB1                    READ WRITE

4            CDB1PDB2                    READ WRITE

SQL> select supplemental_log_data_min from v$database;

SUPPLEME
---------------
YES

SQL> alter system switch logfile;

System altered.

Login to Pluggable Database (cdb1pdb1) as a 'sys' user and create user 'pdb1user' and assign privileges

SQL> connect sys/oracle@192.168.56.105:1521/cdb1pdb1 as sysdba

Connected.

SQL> create user pdb1user identified by oracle;

User created.

SQL> grant connect,resource to pdb1user;

Grant succeeded.

SQL> grant create session to pdb1user;

Grant succeeded.

SQL> alter user pdb1user quota unlimited on users;

User altered.

Login to Pluggable Database (cdb1pdb1) as a 'pdb1user' and create object 'inventory'

SQL> connect pdb1user/oracle@192.168.56.105:1521/cdb1pdb1

Connected.

SQL> create table inventory (
prod_id number,
prod_category varchar2(20),
qty_in_stock number,
last_dml timestamp default systimestamp);

Table created.

SQL> alter table inventory add constraint pk_inventory primary key (prod_id) ;

Table altered.

SQL> grant all on inventory to c##ogguser;

Grant succeeded.

SQL> select tname from tab;

TNAME

----------

INVENTORY

SQL> insert into inventory values(101,'BOOSTER',100,sysdate);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from inventory;

PROD_ID PROD_CATEGORY QTY_IN_STOCK LAST_DML

-------- -------------- ------------- ----------------------------
101 BOOSTER 100 07-JUN-15 01.17.36.000000 AM

Login to Pluggable Database (cdb1pdb2) as a 'sys' user and create user 'pdb1user' and assign privileges

SQL> connect sys/oracle@192.168.56.105:1521/cdb1pdb2 as sysdba

Connected.

SQL> create user pdb1user identified by oracle;
User created.

SQL> grant connect, resource to pdb1user;
Grant succeeded.

SQL> grant create session to pdb1user;
Grant succeeded.

SQL> alter user pdb1user quota unlimited on users;
User altered.

Login to Pluggable Database (cdb1pdb2) as a 'pdb1user' and create object 'inventory'

SQL> connect pdb1user/oracle@192.168.56.105:1521/cdb1pdb2

Connected.

SQL> create table inventory (
prod_id number,
prod_category varchar2(20),
qty_in_stock number,
last_dml timestamp default systimestamp);

Table created.

SQL> alter table inventory add constraint pk_inventory primary key (prod_id);

Table altered.

SQL> grant all on inventory to c##ogguser;

Grant succeeded.

SQL> select tname from tab;

TNAME
-----------
INVENTORY

SQL> insert into inventory values(101,'BOOSTER',100,sysdate);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from inventory;

PROD_ID PROD_CATEGORY QTY_IN_STOCK LAST_DML

---------- -------------------- ------------ ----------------------------

101 BOOSTER 100 07-JUN-15 01.17.36.000000 AM

Configuring Oracle GoldenGate 12c in Source Container Database (cdb1)

Run ggsci command to log into the GoldenGate command line interface (GGSCI)

[oracle@ggnode1 ~]$ source 12c.env
[oracle@ggnode1 ~]$ cd $GG
[oracle@ggnode1 12g]$ pwd

/u01/app/ogg/12g

[oracle@ggnode1 12g]$ ./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 12c on Sep 25 2013 02:33:54
Operating system character set identified as UTF-8.
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.

The following command will create subdirectories required for Oracle GoldenGate environment

GGSCI (ggnode1.oracle.com) 1> create subdirs

Creating subdirectories under current directory /u01/app/ogg/12g

| Parameter Files | /u01/app/ogg/12g/dirprm: already exists |
| Report Files | /u01/app/ogg/12g/dirrpt: created |
| Checkpoint Files | /u01/app/ogg/12g/dirrpt: created |
| Process status Files | /u01/app/ogg/12g/dirpcs: created |
| SQL script Files | /u01/app/ogg/12g/dirsql: created |
| Database definition files | /u01/app/ogg/12g/dirdef: created |
| Extract data files | /u01/app/ogg/12g/dirdat: created |
| Temporary Files | /u01/app/ogg/12g/dirtmp: created |
| Credential store files | /u01/app/ogg/12g/dircrd: created |
| Masterkey wallet files | /u01/app/ogg/12g/dirwlt: created |
| Dump files | /u01/app/ogg/12g/dirdmp: created |

The following command will logs into the database as a ‘ogguser’

GGSCI (ggnode1.oracle.com) 2> dblogin userid c##ogguser@cdb1pdb1,password oracle

Successfully logged into database CDB1PDB1.

GGSCI (ggnode1.oracle.com) 3> add schematrandata pdb1user allcols

2015-06-07 00:36:16 INFO OGG-01788 SCHEMATRANDATA has been added on schema pdb1user.

2015-06-07 00:36:16 INFO OGG-01976 SCHEMATRANDATA for scheduling columns has been added on schema pdb1user.

2015-06-07 00:36:16 INFO OGG-01977 SCHEMATRANDATA for all columns has been added on schema pdb1user.

GGSCI (ggnode1.oracle.com) 4> dblogin userid c##ogguser@cdb1pdb2,password oracle

Successfully logged into database CDB1PDB2.

GGSCI (ggnode1.oracle.com) 5> add schematrandata pdb1user allcols

| 2015-06-07 00:36:42 INFO | OGG-01788 SCHEMATRANDATA has been added on schema pdb1user. |
| 2015-06-07 00:36:42 INFO on schema pdb1user. | OGG-01976 SCHEMATRANDATA for scheduling columns has been added |
| 2015-06-07 00:36:42 INFO schema pdb1user. | OGG-01977 SCHEMATRANDATA for all columns has been added on |

Connecting to the root container database in source database (cdb1)

GGSCI (ggnode1.oracle.com) 6> dblogin userid c##ogguser@cdb1,password oracle

Successfully logged into database CDB$ROOT.

The following command registers the extract process (ES01) with the database.

This process is called “Integrated Capture Mode”. In this mode extract process (ES01) interacts directly with the database logmining server to receive data changes in the form of logical change records (LCR).

GGSCI (ggnode1.oracle.com) 7> register extract es01 DATABASE CONTAINER (cdb1pdb1) Extract ES01

successfully registered with database at SCN 1751521.

The following command registers the extract process (ES01) with the database. It will add second pluggable database (cdb1pdb2).

GGSCI (ggnode1.oracle.com) 8> register extract es01 DATABASE ADD CONTAINER (cdb1pdb2) Extract ES01

successfully registered containers with database at SCN 1782819.

Add the Extract process (ES01) and Data Pump processes (PS01 & PS02)

GGSCI (ggnode1.oracle.com) 9> add extract es01 integrated tranlog,begin now

EXTRACT added.

GGSCI (ggnode1.oracle.com) 10> add exttrail ./dirdat/lt, extract es01 ,megabytes 10

EXTTRAIL added.

GGSCI (ggnode1.oracle.com) 11> add extract ps01 ,exttrailsource ./dirdat/lt begin now

EXTRACT added.

GGSCI (ggnode1.oracle.com) 12> add extract ps02,exttrailsource ./dirdat/lt begin now

EXTRACT added.

GGSCI (ggnode1.oracle.com) 13> add rmttrail ./dirdat/rt,extract ps01

RMTTRAIL added.

GGSCI (ggnode1.oracle.com) 14> add rmttrail ./dirdat/pt,extract ps02

RMTTRAIL added.

GGSCI (ggnode1.oracle.com) 15> edit param mgr

GGSCI (ggnode1.oracle.com) 16> view param mgr

PORT 7809

The parameter SOURCECATALOG when used enables us to use the earlier Schema.Table type naming convention.

The following commands will create and configure extract process (ES01) and Pump Processes (PS01 & PS02) with multitenant replication options

GGSCI (ggnode1.oracle.com) 17> edit param es01

GGSCI (ggnode1.oracle.com) 18> view param es01

extract es01
userid c##ogguser@cdb1,password oracle

LOGALLSUPCOLS

UPDATERECORDFORMAT COMPACT

exttrail ./dirdat/lt
SOURCECATALOG cdb1pdb1
table pdb1user.*;
SOURCECATALOG cdb1pdb2
table pdb1user.*;

GGSCI (ggnode1.oracle.com) 19> edit param ps01

GGSCI (ggnode1.oracle.com) 20> view param ps01

extract ps01

userid c##ogguser,password

RMTHOST ggnode2,mgrport 7810

rmttrail ./dirdat/rt

SOURCECATALOG cdb1pdb1

table pdb1user.*;

GGSCI (ggnode1.oracle.com) 21> edit param ps02

GGSCI (ggnode1.oracle.com) 41> view param ps02

extract ps02

userid c##ogguser,password oracle

RMTHOST ggnode2,mgrport 7810

rmttrail ./dirdat/pt

SOURCECATALOG cdb1pdb2

table pdb1user.*;

Start the Manager Process in Source Container Database (cdb1)

GGSCI (ggnode1.oracle.com) 24> start mgr

Manager started.

GGSCI (ggnode1.oracle.com) 25> info all

| Program | Status | Group | Lag at Ckpt | Time Since Chkpt |
| MANAGER | RUNNING | | | |
| EXTRACT | STOPPED | ES01 | 00:00:00 | 00:05:34 |
| EXTRACT | STOPPED | PS01 | 00:00:00 | 00:04:54 |
| EXTRACT | STOPPED | PS02 | 00:00:00 | 00:04:26 |

GGSCI (ggnode1.oracle.com) 2> exit

Installing Oracle Database 12c with Multitenant Option with Multiple Pluggable Databases in Target database

Series of Steps involved @Target Container Database (cdb2):

  • Install Oracle 12c R1 database software as a ‘oracle’ user in the following directory ORACLE_HOME=/u01/app/oracle/product/12.1.0/db_1
  • Installing Oracle GoldenGate 12c software as a ‘oracle’ user in the following directory GOLDENGATE_HOME=/u01/app/ogg/12g
  • Configuring, creating subdirs for Oracle GoldenGate 12c in source database (cdb1)
  • Create and configure Manger, Replicat processes for uni-directional between Oracle 12c database with multiple pluggable databases (cdb1pdb1 & cdb1pdb2) and Oracle 12c database (cdb2) with multiple pluggable databases (cdb2pdb1 & cdb2pdb2).
  • Create database cdb2 with pluggable databases cdb2pdb1 & cdb2pdb2 with advanced option in DBCA with sample schemas.
  • Create database services in LISTENER for cdb1, cdb2pdb1 & cdb2pdb2.
  • Create services for cdb1, cdb2pdb1 & cdb2pdb2.

Creating container database (cdb2) with two pluggable databases (cdb2pdb1 & cdb2pdb2)

Multi PDBs Replicat GG12c Image5.jpg

Installing Oracle GoldenGate 12c as ‘oracle’ user in Source Database

Select the option “Oracle GoldenGate for Oracle Database 12c (506.0 MB)”

Multi PDBs Replicat GG12c Image6.jpg

Multi PDBs Replicat GG12c Image7.jpg

Successfully installed Oracle GoldenGate 12c software binaries for Oracle database 12c in Target database (cdb2).

Login to Target Container Database (cdb2) as a ‘sysdba’

1. Log into source database (cdb2) as a ‘sysdba’
2. Create GoldenGate tablespace
3. Create GoldenGate user ‘c##ogguser’
4. Assign privileges for ‘c##ogguser’ user
5. Add database level supplemental logging
5. dbms_goldengate_auth.grant_admin_privilege package grants the appropriate privileges for capture and apply within a multitenant container database.

This includes the container parameter, which must be set to ALL, as shown in the following

example:dbms_goldengate_auth.grant_admin_privilege(‘C##OGGUSER’,container=>all)

[oracle@ggnode2 ~]$ source 12c.env

[oracle@ggnode2 ~]$ sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Sun Jun 7 00:46:15 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved.

SQL> connect sys/oracle@192.168.56.106:1521/cdb2 as sysdba

Connected.

SQL> select con_id,name,open_mode from v$pdbs;

CON_ID NAME OPEN_MODE

---------- ---------------- ------------------

            2               PDB$SEED         READ ONLY

    3               CDB2PDB1         READ WRITE

    4               CDB2PDB2         READ WRITE

SQL> create tablespace goldengate datafile '/u01/app/oracle/oradata/cdb2/goldengate01.dbf' size 100M autoextend on;
Tablespace created.

SQL> create user c##ogguser identified by oracle container=all;

User created.

SQL> grant connect to c##ogguser container=all;

Grant succeeded.

SQL> grant dba to c##ogguser container=all;

Grant succeeded.

SQL> grant unlimited tablespace to c##ogguser container=all;

Grant succeeded.

SQL> grant create session to c##ogguser container=all;

Grant succeeded.

SQL> grant alter session to c##ogguser container=all;

Grant succeeded.

SQL> grant select any dictionary to c##ogguser container=all;

Grant succeeded.

SQL> alter database add supplemental log data;

Database altered.

SQL> alter database force logging;

Database altered.

SQL> alter system switch logfile;

System altered.

SQL> select supplemental_log_data_min,force_logging from v$database;

SUPPLEME
-------------

YES

FORCE_LOGGING
--------------
YES

SQL> exec dbms_goldengate_auth.grant_admin_privilege('C##OGGUSER',container=>'all');

PL/SQL procedure successfully completed.

Login to Pluggable Database (cdb2pdb1) as a 'sys' user and create user 'pdb1user' and assign privileges

SQL> connect sys/oracle@192.168.56.106:1521/cdb2pdb1 as sysdba

Connected.

SQL> create user pdb1user identified by oracle;

User created.

SQL> grant connect,resource to pdb1user;

Grant succeeded.

SQL> grant create session to pdb1user;

Grant succeeded.

SQL> alter user pdb1user quota unlimited on users;

User altered.

Login to Pluggable Database (cdb2pdb1) as a 'pdb1user' and create object 'inventory'

SQL> connect pdb1user/oracle@192.168.56.106:1521/cdb2pdb1

Connected.

SQL> create table inventory (
prod_id number,
prod_category varchar2(20),
qty_in_stock number,
last_dml timestamp default systimestamp);

Table created.

SQL> alter table inventory add constraint pk_inventory primary key (prod_id);

Table altered.

SQL> grant all on inventory to c##ogguser;

Grant succeeded.

Login to Pluggable Database (cdb2pdb2) as a 'sys' user and create user 'pdb1user' and assign privileges

SQL> connect sys/oracle@192.168.56.106:1521/cdb2pdb2 as sysdba

Connected.

SQL> create user pdb1user identified by oracle;

User created.

SQL> grant connect,resource to pdb1user;

Grant succeeded.

SQL> grant create session to pdb1user;

Grant succeeded.

SQL> alter user pdb1user quota unlimited on users;

User altered.

Login to Pluggable Database (cdb2pdb2) as a 'pdb1user' and create object 'inventory'

SQL> connect pdb1user/oracle@192.168.56.106:1521/cdb2pdb2

Connected.

SQL> create table inventory (
prod_id number,
prod_category varchar2(20),
qty_in_stock number,
last_dml timestamp default systimestamp);

Table created.

SQL> alter table inventory add constraint pk_inventory primary key (prod_id);

Table altered.

SQL> grant all on inventory to c##ogguser;

Grant succeeded.

Configuring Oracle GoldenGate 12c in Target Database (Container Database (cdb2))

[oracle@ggnode2 ~]$ source 12c.env [

oracle@ggnode2 ~]$ cd $GG

[oracle@ggnode2 12g]$ ./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 12c on Sep 25 2013 02:33:54
Operating system character set identified as UTF-8.
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.

GGSCI (ggnode2.oracle.com) 1> create subdirs
Creating subdirectories under current directory /u01/app/ogg/12g

Parameter files /u01/app/ogg/12g/dirprm: already exists
Report files /u01/app/ogg/12g/dirrpt: created
Checkpoint files /u01/app/ogg/12g/dirchk: created
Process status files /u01/app/ogg/12g/dirpcs: created
SQL script files /u01/app/ogg/12g/dirsql: created
Database definitions files /u01/app/ogg/12g/dirdef: created
Extract data files /u01/app/ogg/12g/dirdat: created
Temporary files /u01/app/ogg/12g/dirtmp: created
Credential store files /u01/app/ogg/12g/dircrd: created
Masterkey wallet files /u01/app/ogg/12g/dirwlt: created
Dump files /u01/app/ogg/12g/dirdmp: created

Login to Pluggable Database (cdb2pdb1) in target database as ‘c##ogguser”

GGSCI (ggnode2.oracle.com) 1> dblogin userid c##ogguser@cdb2pdb1,password oracle

Successfully logged into database CDB2PDB1.

The following command will add replicat process (RS01) for pluggable database (cdb2pdb1).

GGSCI (ggnode2.oracle.com) 2> add replicat rs01 integrated exttrail ./dirdat/rt

REPLICAT (Integrated) added.

Login to Pluggable Database (cdb2pdb2) in target database as ‘c##ogguser”

GGSCI (ggnode2.oracle.com) 3> dblogin userid c##ogguser@cdb2pdb2,password oracle

Successfully logged into database CDB2PDB2.

The following command will add replicat process (RS01) for pluggable database (cdb2pdb2).

GGSCI (ggnode2.oracle.com) 4> add replicat rs02 integrated exttrail ./dirdat/pt

REPLICAT (Integrated) added.

GGSCI (ggnode2.oracle.com) 5> edit param mgr

GGSCI (ggnode2.oracle.com) 6> view param mgr

PORT 7810

Creating and configuring two replicat processes for two pluggable databases (cdb2pdb1 & cdb2pdb2)

GGSCI (ggnode2.oracle.com) 7> edit param rs01

GGSCI (ggnode2.oracle.com) 8> view param rs01

replicat rs01
USERID c##ogguser@cdb2pdb1,password oracle

assumetargetdefs
map cdb1pdb1.pdb1user.*,target cdb2pdb1.pdb1user.*;

GGSCI (ggnode2.oracle.com) 10> edit param rs02

GGSCI (ggnode2.oracle.com) 9> view param rs02

replicat rs02

USERID c##ogguser@cdb2pdb2,password oracle

assumetargetdefs
map cdb1pdb2.pdb1user.*,target cdb2pdb2.pdb1user.*;

Start the Manager, Replicat Processes (RS01 & RS02) in Target database

GGSCI (ggnode2.oracle.com) 12> start mgr

Manager started.

GGSCI (ggnode2.oracle.com) 13> start replicat rs01

Sending START request to MANAGER ... REPLICAT RS01 starting

GGSCI (ggnode2.oracle.com) 14> start replicat rs02

Sending START request to MANAGER ... REPLICAT RS02 starting

Check the status of Manager, Replicat Processes (RS01 & RS02) in Target database

GGSCI (ggnode2.oracle.com) 15> info all

| Program | Status | Group | Lag at Chkpt | Time Since Chkpt |
| MANAGER | RUNNING | | |
| REPLICAT | RUNNING | RS01 | 00:00:00 | 00:00:00 |
| REPLICAT | RUNNING | RS02 | 00:00:01 | 00:00:00 |

GGSCI (ggnode2.oracle.com) 21>

Login to Oracle GoldenGate for Source Database (ggnode1)

Start the Manager, Extract Processes (ES01 & ES02) in Source database

GGSCI (ggnode1.oracle.com) 26> start er *

Sending START request to MANAGER ... EXTRACT ES01 starting

Sending START request to MANAGER ... EXTRACT PS01 starting

Sending START request to MANAGER ... EXTRACT PS02 starting

Check the status of Manager, Extract Processes (ES01 & ES02) in Source database

GGSCI (ggnode1.oracle.com) 27> info all

| Program | Status | Group | Lag at Chkpt | Time Since Chkpt |
| MANAGER | RUNNING | | | |
| EXTRACT | STARTING | ES01 | 00:00:00 | 00:30:41 |
| EXTRACT | RUNNING | PS01 | 00:00:00 | 00:30:01 |
| EXTRACT | RUNNING | PS02 | 00:00:00 | 00:29:33 |

Note: The Extract Process (ES01) still reports a status of “STARTING” after running the info all command. Since the Extract Process (ES01) is running in Integrated Capture Mode it requires extra startup time.

| Program | Status | Group | Lag at Chkpt | Time Since Chkpt |
| MANAGER | RUNNING | | | |
| EXTRACT | RUNNING | ES01 | 00:31:39 | 00:00:00 |
| EXTRACT | RUNNING | PS01 | 00:00:00 | 00:00:03 |
| EXTRACT | RUNNING | PS02 | 00:00:00 | 00:00:03 |

Login to Source first Pluggable database (cdb1pdb1) and make some changes in 'Inventory' Table and confirming the changes replicated to target first pluggable database (cdb2pdb1)

Multi PDBs Replicat GG12c Image8.jpg

Login to Source second Pluggable database (cdb1pdb2) and make some changes in Inventory Table and confirming the changes replicated to target second pluggable database (cdb2pdb2)

Multi PDBs Replicat GG12c Image9.jpg

Login to Golden Gate command interface in Source Database and Check the Statistics for Extract Process (ES01) and check the total operations

Multi PDBs Replicat GG12c Image10.jpg

Login to Golden Gate command interface in Source Database and Check the Statistics for Pump Processes (PS01 & PS02) and check the total operations

Multi PDBs Replicat GG12c Image11.jpg

Login to Golden Gate command interface in Target Database and Check Statistics for Replicat Process (RS01) and check the total operations

Multi PDBs Replicat GG12c Image12.jpg

Login to Golden Gate command interface in Target Database and Check Statistics for Replicat Process (RS02) and check the total operations

Multi PDBs Replicat GG12c Image13.jpg

Summary

All Pluggable Databases (PDBs) belonging to one single Container Database (CDB) share the same redo stream. So Oracle GoldenGate has to filter out the redo records for PDBs which it does not need. At the same time each Pluggable Database (PDB) has its own data dictionary so Oracle GoldenGate needs to track multiple data dictionaries.

About the Authors

Nassyam Basha @"CKPT"

Nassyam Basha is a Database Administrator, Oracle ACE Director. He holds a Master's Degree in Computer Applications from the University of Madras. He started learning with dBase,FoxPro, and has participated in several projects with FoxPro before he started working with Oracle database technologies in 2006. He is an Oracle 11g Certified Master, Exadata Implementation Specialist and having good knowledge in Oracle technologies such as Data Guard, RMAN, RAC, Exadata. He actively participates in Oracle-related forums such as OTN and also contributes to many Oracle-Lists. He maintains an Oracle technology-related blog, and he co-authored the book "Oracle Data Guard 11gR2 administration beginners guide" for PACKT publications. He is a frequent contributor to OTN in many languages and is a moderator on the Oracle Community Platform. He is speaker @AIOUG, OTN , IOUG, SANGAM and he is co-founder of oraworld team( www.oraworld-team.com ). Learn more from his profile at @"CKPT"

YV Ravi Kumar @"LaserSoft"

YV RaviKumar is an Oracle ACE and Oracle Certified Master (OCM) with 17 years of experience in Banking, Financial Services and Insurance (BFSI) vertical and played various roles like Senior Database Architect and Production DBA. He is also OCP in Oracle 8i, 9i, 10g

Comments
Post Details
Added on Mar 15 2016
4 comments
6,356 views