Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

DML Replication using Goldengate 12c Multitenant Architecture

Aim: Pluggable database is pdborcl. Replicate the data of SA.TEST to SA1.TEST1. Both
schemas and tables are part of PDBORCL pluggable database.

Prerequisites:

At Database Level:

Source:

Connect to database to container database.

$>sqlplus / as sysdba

1. alter system set enable_goldengate_replication=TRUE;


2. Create a user in container database with prefix c##. In 12c this user is common to all the
pluggables present. (In 12c all common users and roles are created with prefix c##)

SQL>create user c##ggadmin identified by ggadmin default tablespace ggs_tblsp;

3. SQL>alter database add supplemental log data (all) columns


4. SQL>grant dba to c##ggadmin container=pdborcl; -- here pdborcl is pluggable
5. Database should be in archive log mode.

SQL>select log_mode from v$database;

Target:

Connect to database to container database.

$>sqlplus / as sysdba

1. alter system set enable_goldengate_replication=TRUE;


2. SQL>create user c##ggadmin identified by ggadmin default tablespace ggs_tblsp;
3. SQL> alter session set container=pdborcl;
4. SQL>grant dba to c##ggadmin container=pdborcl; -- here pdborcl is pluggable

At GGSCI Prompt:
6. Add trandata for the tables for which replication is required.

GGSCI>dblogin userid c##ggadmin@pdb1,password ggadmin

Note: Connection is made to Pluggable DB above for adding trandata:

GGSCI>add trandata pdborcl.SA.TEST

Now make connection to container database in below step :

GGSCI>dblogin userid c##ggadmin,password ggadmin

Note: Connection is made to Container DB above for adding and registering extract:

SQL>alter table SA.test add supplemental log data (all) columns;

7. Edit param mgr

Port 8080

8. Create the Extract process

GGSCI 1> ADD EXTRACT extint, INTEGRATED TRANLOG, BEGIN NOW


EXTRACT added.

9. Register the extract

GGSCI> REGISTER EXTRACT EXTINT DATABASE CONTAINER (pdborcl)

10. Create a local trail

Using the ADD EXTRAIL command we will now create a local trail on the source system where
the Extract process will write to and which is then read by the Data Pump process. We will link
this local trail to the Primary Extract group we just created, extint

GGSCI (devu007) 3> ADD EXTTRAIL pint /goldengate/dirdat/lt, EXTRACT extint


EXTTRAIL added.

11. Create the Data Pump group

On the source system create the Data Pump group and using the EXTTRAILSOURCE keyword
specify the location of the local trail which will be read by the Data Pump process
GGSCI (devu007) 4> ADD EXTRACT pint, EXTTRAILSOURCE /goldengate/dirdat/lt
EXTRACT added.

12. Create the parameter file for the Primary Extract group

GGSCI (devu007) 5> EDIT PARAMS extint

EXTRACT extint
USERID c##ggadmin, PASSWORD ggadmin --connection to CDB$ROOT database
TRANLOGOPTIONS INTEGRATEDPARAMS (MAX_SGA_SIZE 100)
EXTTRAIL /goldengate/dirdat/lt
TABLE pdborcl.SA.TEST;

13. Specify the location of the remote trail on the target system

Use the RMTTRAIL to specify the location of the remote trail and associate the same with the
Data Pump group as it will be wriiten to over the network by the data pump process

GGSCI (devu007) 6> ADD RMTTRAIL /ggs/dirdat/rt, EXTRACT pint


RMTTRAIL added.

14. Create the parameter file for the Data Pump group

Note- the parameter PASSTHRU signifies the mode being used for the Data Pump which means
that the names of the source and target objects are identical and no column mapping or filtering
is being performed here.

GGSCI (devu007) 2> EDIT PARAMS pint

EXTRACT pint
USERID c##ggadmin, PASSWORD ggadmin
RMTHOST 10.3.88.198, MGRPORT 7809
RMTTRAIL /ggs/dirdat/rt
PASSTHRU
TABLE pdborcl.SA.TEST;

ON TARGET SYSTEM

15. Create the Replicat group

DBLOGIN:
GGSCI>dblogin userid c##ggadmin@pdborcl,password ggadmin

Note: In Integrated Replicat connection is done to pluggable DB. Hence


@PLUGGABLEDATABASE needs to be given.

GGSCI > ADD REPLICAT repint,integrated EXTTRAIL /ggs/dirdat/rt

REPLICAT added.

16. Create the parameter file for the Replicat group

GGSCI (redhat346.localdomain) 3> EDIT PARAMS repint

REPLICAT repint
USERID C##GGADMIN@PDBORCL, PASSWORD ggadmin –Connection to pluggable
DBOPTIONS INTEGRATEDPARAMS(parallelism 6)
ASSUMETARGETDEFS
MAP PDBORCL.SA.TEST, TARGET PDBORCL.SA1.TEST1;

17. Start the extract and data pump processes.


18. Start the replicat process.

You might also like