schema replication using oracle golden gate 12c

12
Schema Replication using Oracle Golden gate 12c (Installation & Configuration) Index: 1. Introduction 2. System Configuration Description 3. Architecture 4. Parameter Change: 4a. Enable Supplemental log both source and target. 4b.Acrhivelog enable and enable_goldengate_replication 4c. Schema and Tablespace creation 5. Golden gate software install in both source and target system 6. Start Manager in both source and target system 7. Register the Integrated Extract 8. Add the Extract and Data Pump job and edit parameter in Source System 9. Add Replicate job and edit parameter in Target System 10. Start The All Five Job and enjoy the beauty of Golden Gate

Upload: uzzal-basak

Post on 18-Jan-2017

413 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Schema replication using oracle golden gate 12c

Schema Replication using Oracle Golden gate 12c (Installation & Configuration)

Index:

1. Introduction2. System Configuration Description

3. Architecture

4. Parameter Change:

4a. Enable Supplemental log both source and target.

4b.Acrhivelog enable and enable_goldengate_replication

4c. Schema and Tablespace creation

5. Golden gate software install in both source and target system6. Start Manager in both source and target system

7. Register the Integrated Extract

8. Add the Extract and Data Pump job and edit parameter in Source System

9. Add Replicate job and edit parameter in Target System

10. Start The All Five Job and enjoy the beauty of Golden Gate

Page 2: Schema replication using oracle golden gate 12c

Golden Gate is touted by Oracle as its future for data replication. It will slowly phase out Oracle Streams and will be more closely coupled with Oracle products. Golden Gate is relatively simpler to use and monitor than Oracle streams. In 12c Oracle stream is totally obsolete.

Below I will demonstrate how to configure ASYNC Schema Replication using oracle Golden Gate 12C in two different Operating system where source in Window machine and target is Solaris 10.

SID of Source: PDBORCLSID of Target: PRIPDBSource Server name: 172.25.200.1Target Server name: 172.25.200.10Source Schema name: BASAKTarget Schema name: BASAKTables: All tables

Os Version Source: Window 10

Os Version Target: Sun Solaris 10 X-86 Architecture

JOB is running in Both Source and Target System

Source System (Name) Target System (Name)Manager ManagerExtractor EXT1 Replicate rpe1Dump EXTDP1

Here is Visible Architecture of Golden Gate

Page 3: Schema replication using oracle golden gate 12c

If above five process is running and configuring correctly then you can see the beauty the Golden gate

Parameter Change

1. Enable Supplemental log data in both Source and target database2. Enable Archivelog in both Source and Target database

alter database add supplemental log data;

Few Things of Supplemental Log

Database-level supplemental logging must be enabled for any Change Data Capture source database.

Supplemental logging places additional column data into the redo log file whenever an UPDATE operation is performed. At the least, minimal database-level supplemental logging must be enabled for any Change Data Capture source database.

Basically Redo log takes information of any change data

2 . Create the tablespace for both databases (source + target) like:

Create tablespace ggate datafile '/export/home/oracle/app/oracle/oradata/ggate01.dbf ' size 1000M AUTOEXTEND ON NEXT 500K;

Page 4: Schema replication using oracle golden gate 12c

3. GoldenGate schema creation into source and target database

Create OGG Extract User

The Extract user for a Multitenant environment must be a common user and must log into the root container. In the following example, the extract userid is c##gadmin using the password ggadmin. The following commands are executed in CDB$ROOT.

$(unixserver1) sqlplus / as sysdba SQL> create user C##GADMIN identified by ggadmin; User created.

SQL> exec dbms_goldengate_auth.grant_admin_privilege('C##GADMIN',container=>'ALL'); PL/SQL procedure successfully completed.

SQL> grant dba to c##gadmin container=all; Grant succeeded.

4. Enable this parameter enable_goldengate_replication in both source and target system

Solution: SQL> ALTER SYSTEM set enable_goldengate_replication=true scope=both;

Install Golden Gate Software in Both Source and Target Database

Install Golden Gate Software (In both Source and Target System)

Step 1: unzip the Golden gate software

Page 5: Schema replication using oracle golden gate 12c

Run : /runInstaller

Page 6: Schema replication using oracle golden gate 12c

Software location must be where the golden gate software in unzip stage and mention the Manager Port here it is 7809 in target System in Source using 7777

Page 7: Schema replication using oracle golden gate 12c
Page 8: Schema replication using oracle golden gate 12c

Start the Manager:

Extract process must be set by using root database in 12c you have to create common user in any other process add you have to login root user

Note: here we are connecting to the pluggable database

GGSCI (DESKTOP-4C3J6DO as C##GADMIN@cdborcl/CDB$ROOT) 19> dblogin userid C##GADMIN@CDBORCL password ggadmin;Successfully logged into database CDB$ROOT.

GGSCI (orasql-001-dev.mydomain) 2> ADD SCHEMATRANDATA basak ALLCOLS

Page 9: Schema replication using oracle golden gate 12c

2016-08-01 02:26:26 INFO OGG-01788 SCHEMATRANDATA has been added on schema basak.

2016-08-01 02:26:30 INFO OGG-01976 SCHEMATRANDATA for scheduling columns has been added on schema basak.

2016-08-01 02:26:30 INFO OGG-01977 SCHEMATRANDATA for all columns has been added on schema basak.

Register the Integrated Extract

Note: here we are connecting to the root container database.

GGSCI (DESKTOP-4C3J6DO as C##GADMIN@cdborcl/CDB$ROOT) 21> REGISTER EXTRACT ext1 DATABASE CONTAINER (PDBORCL)

2016-08-01 02:53:28 INFO OGG-02003 Extract EXT1 successfully registered with database at SCN 3795382.

Add the Extract and Data Pump process groups

GGSCI (DESKTOP-4C3J6DO as C##GADMIN@cdborcl/CDB$ROOT) 22> ADD EXTRACT ext1 INTEGRATED TRANLOG, BEGIN NOW

EXTRACT (Integrated) added.

GGSCI (DESKTOP-4C3J6DO as C##GADMIN@cdborcl/CDB$ROOT) 23> ADD EXTTRAIL ./dirdat/lt EXTRACT ext1

EXTTRAIL added.

GGSCI (DESKTOP-4C3J6DO as C##GADMIN@cdborcl/CDB$ROOT) 24> ADD EXTRACT extdp1 EXTTRAILSOURCE ./dirdat/lt BEGIN NOW

EXTRACT added.

GGSCI (DESKTOP-4C3J6DO as C##GADMIN@cdborcl/CDB$ROOT) 25> ADD RMTTRAIL ./dirdat/rt EXTRACT extdp1

RMTTRAIL added.

EXTRACT and DUMP JOB PARAMETER

GGSCI (orasql-001-dev.mydomain) 12> edit params ext1EXTRACT ext1SETENV (ORACLE_SID='pdborcl')USERID C##GADMIN@CDBORCL, PASSWORD ggadminLOGALLSUPCOLSUPDATERECORDFORMAT COMPACTEXTTRAIL ./dirdat/ltSOURCECATALOG pdborclTABLE basak.*;

Page 10: Schema replication using oracle golden gate 12c

GGSCI (orasql-001-dev.mydomain) 12> edit params extdp1

EXTRACT extdp1SETENV (ORACLE_SID='pdborcl')USERID C##GADMIN@CDBORCL, PASSWORD ggadminRMTHOST 172.25.200.10, MGRPORT 7809 RMTTRAIL ./dirdat/rtSOURCECATALOG pdborclTABLE basak.*;

Add the Replicate process group connected to the target PDB PRIPDB

Note – we are using something new in 12c OGG called Integrated Replicate – we will discuss more about Integrated Replicates in another post.

GGSCI (SolarisM1) 3> DBLOGIN USERID C##gadmin@PRIPDB, PASSWORD ggadminSuccessfully logged into database PRIPDB.

GGSCI (SolarisM1 as C##gadmin@PriDB/PRIPDB) 4> ADD REPLICAT rep1 INTEGRATED EXTTRAIL ./dirdat/rtREPLICAT (Integrated) added.

GGSCI (orasql-001-test.mydomain) 5> edit params rep1REPLICAT rep1SETENV (ORACLE_SID='pripdb')DBOPTIONS INTEGRATEDPARAMS(parallelism 6)USERID C##GADMIN@pripdb, PASSWORD ggadminASSUMETARGETDEFSMAP pdborcl.basak.*, TARGET pripdb.basak.*

Start All JOB

In Source System:

In target System

Page 11: Schema replication using oracle golden gate 12c

Now enjoy the Beauty Of Golden Gate