Ask Me

Golden Gate Installation and configuration on 12 Multitenant database

 Installation :

Step 1: Download oracle 12c goldengate software from oracle support                          121004_fbo_ggs_Linux_x64_shiphome.zip


Step 2: Installation of golden gate quite simple , 

we just need to unzip the binaries to respective golden gate base locations.

In 19c Oracle binary , we have GUI based installation option is available , that can be used .

Step 3 : Create directory for the software and extract it to the directory 
install oracle 19c Goldengate using install wizard .Check manager is up and running

Step 4: Create necessary database configurations:


Here i have demonstrated both source and target database on same server with 2 different pluggable databases

AS of you know how to create plug-gable databases.

\** make sure your  database are up and running and accessible remotely. 

[oracle@ora12c1 admin]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Sat Aug 6 18:41:23 2022

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> sho pdbs

    CON_ID CON_NAME                       OPEN MODE      RESTRICTED
----------     ------------------------------         ----------                 ----------
         2         PDB$SEED                       READ ONLY          NO
         3         OGG1                                READ WRITE         NO
         4         OGG2                                READ WRITE         NO

[oracle@ora12c1 ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 06-AUG-2022 19:58:31

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora12c1.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                06-AUG-2022 12:00:24
Uptime                    0 days 7 hr. 58 min. 6 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/ora12c1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora12c1.localdomain)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=ora12c1.localdomain)(PORT=5502))(Security=(my_wallet_directory=/u01/app/oracle/product/12.1.0/dbhome_1/admin/cdb12c/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "OGG1" has 1 instance(s).
  Instance "cdb12c", status READY, has 1 handler(s) for this service...
Service "OGG2" has 1 instance(s).
  Instance "cdb12c", status READY, has 1 handler(s) for this service...
Service "cdb12c" has 1 instance(s).
  Instance "cdb12c", status READY, has 1 handler(s) for this service...
Service "cdb12cXDB" has 1 instance(s).
  Instance "cdb12c", status READY, has 1 handler(s) for this service...
Service "oggtrg" has 1 instance(s).
  Instance "cdb12c", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@ora12c1 ~]$


Source Database (OGG1)

Target Database (OGG2)

1.       Source database , Extract process need a common user (EX. C##OGGSRC)

CREATE USER "C##OGGSRC" IDENTIFIED BY "XXXXXXX" DEFAULT TABLESPACE "OGGTABSP" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMTED ON "OGGTABSP"  ;

 

Note : make sure OGGTABS should exist on all pluggable database .

Else you are use USERS by default  it will be there

Errors:

2.       Provide enecessary privileges .

  GRANT "CONNECT" TO "C##OGGSRC"

  GRANT "RESOURCE" TO "C##OGGSRC"

  GRANT "SELECT_CATALOG_ROLE" TO "C##OGGSRC"

  GRANT FLASHBACK ANY TABLE TO "C##OGGSRC" WITH ADMIN OPTION

  GRANT SELECT ANY DICTIONARY TO "C##OGGSRC" WITH ADMIN OPTION

  GRANT DELETE ANY TABLE TO "C##OGGSRC" WITH ADMIN OPTION

  GRANT UPDATE ANY TABLE TO "C##OGGSRC" WITH ADMIN OPTION

  GRANT INSERT ANY TABLE TO "C##OGGSRC" WITH ADMIN OPTION

  GRANT SELECT ANY TABLE TO "C##OGGSRC" WITH ADMIN OPTION

  GRANT ALTER ANY TABLE TO "C##OGGSRC" WITH ADMIN OPTION

  GRANT ALTER SESSION TO "C##OGGSRC" WITH ADMIN OPTION

  GRANT CREATE SESSION TO "C##OGGSRC" WITH ADMIN OPTION

  GRANT ALTER SYSTEM TO "C##OGGSRC" WITH ADMIN OPTION

grant create session to C##oggsrc container=all;


exec dbms_goldengate_auth.grant_admin_privilege('C##OGGSRC',container=>'all')

 

3.       Put database  in archive log mode.

4.       Enable supplemental logdata

ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

5.       Enable force logging .

alter database force logging;

 

 

 

 

 

 

1.       Target database need a user under pluggable database (OGGTRG)

CREATE USER "OGGTRG" IDENTIFIED BY XXXXXXXX  DEFAULT TABLESPACE "OGGDATA" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMTED ON "OGGDATA";

 

 

2.       Provide enecessary privileges .

 

  GRANT "CONNECT" TO "OGGTRG"

  GRANT "RESOURCE" TO "OGGTRG"

  GRANT "SELECT_CATALOG_ROLE" TO "OGGTRG"

  GRANT FLASHBACK ANY TABLE TO "OGGTRG"

  GRANT SELECT ANY DICTIONARY TO "OGGTRG"

  GRANT DELETE ANY TABLE TO "OGGTRG"

  GRANT UPDATE ANY TABLE TO "OGGTRG"

  GRANT INSERT ANY TABLE TO "OGGTRG"

  GRANT SELECT ANY TABLE TO "OGGTRG"

  GRANT ALTER ANY TABLE TO "OGGTRG"

  GRANT ALTER SESSION TO "OGGTRG"

  GRANT CREATE SESSION TO "OGGTRG"

  GRANT ALTER SYSTEM TO "OGGTRG"

Exec dbms_goldengate_auth.grant_admin_privilege('OGGTRG’);

 

Golden gate setup (source)

Golden gate setup (Target)

1.       Check manager should be running , else prepare manage param file and start .

 

[oracle@ora12c1 ogg_src]$ ./ggsci

 

Oracle GoldenGate Command Interpreter for Oracle

Version 12.2.0.1.0 OGGCORE_12.2.0.1.0_PLATFORMS_151101.1925.2_FBO

Linux, x64, 64bit (optimized), Oracle 12c on Nov 11 2015 03:53:23

Operating system character set identified as UTF-8.

Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.

 

GGSCI (ora12c1.localdomain) 1> info mgr

Manager is running (IP port ora12c1.localdomain.7809, Process ID 8281).

 

GGSCI (ora12c1.localdomain) 2> view param mgr

PORT 7809

Dynamicportlist 7810-7820

AUTORESTART ER *, RETRIES 5, WAITMINUTES 2, RESETMINUTES 120

GGSCI (ora12c1.localdomain) 3>.

 

 

 

 

 

 

 

 

2.       Create credentials for gg user

GGSCI (ora12c1.localdomain) 6> create credentialstore

GGSCI (ora12c1.localdomain) 6>alter credentialstore add user c##oggsrc password xxxxxxx alias oggsrc

 

GGSCI (ora12c1.localdomain) 6> info credentialstore

 

Reading from ./dircrd/:

 

Default domain: OracleGoldenGate

 

  Alias: oggsrc

  Userid: c##oggsrc

 

GGSCI (ora12c1.localdomain) 7>

 

GGSCI (ora12c1.localdomain) 1> dblogin useridalias oggsrc

Successfully logged into database CDB$ROOT.

 

GGSCI (ora12c1.localdomain as c##oggsrc@cdb12c/CDB$ROOT) 2>

3.       Create a extract file (extracting all tables under use east under database ogg1)

GGSCI (ora12c1.localdomain) 3> view param EROGG1

extract EROGG1

exttrail ./dirdat/ER

useridalias oggsrc

table ogg1.east.*;

GGSCI (ora12c1.localdomain) 3> add extract EROGG1, integrated tranlog,begin now

GGSCI (ora12c1.localdomain) 3> add exttrail ./dirdat/ER, extract EROGG1

 

GGSCI (ora12c1.localdomain) 3> start EROGG1

Create a pump process :

GGSCI (ora12c1.localdomain) 4> view param PPOGG1

extract PPOGG1

RMTHOST ora12c1.localdomain,MGRPORT 7909

RMTTRAIL /u01/app/oracle/product/ogg_trg/dirdat/PP

PASSTHRU

TABLE OGG1.EAST.*;

GGSCI (ora12c1.localdomain) 3> add extract PPOGG1 , EXTTRAILSOURCE ./dirdat/ER

GGSCI (ora12c1.localdomain) 3> add rmttrail ./dirdat/PP, extract PPOGG1

GGSCI (ora12c1.localdomain) 3> start PPOGG1

 

 

 

GGSCI (ora12c1.localdomain) 5>

 

1.       Add check point table on global file

[oracle@ora12c1 ogg_trg]$ pwd

/u01/app/oracle/product/ogg_trg

[oracle@ora12c1 ogg_trg]$ cat GLOBALS

checkpointtable oggtrg.GGS_CHECKPOINT

 [oracle@ora12c1 ogg_trg]$ pwd

/u01/app/oracle/product/ogg_trg

 [oracle@ora12c1 ogg_trg]$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 12.2.0.1.0 OGGCORE_12.2.0.1.0_PLATFORMS_151101.1925.2_FBO

Linux, x64, 64bit (optimized), Oracle 12c on Nov 11 2015 03:53:23

Operating system character set identified as UTF-8.

Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.

GGSCI (ora12c1.localdomain) 1> view param mgr

PORT 7909

DYNAMICPORTLIST 7910-7920

 

GGSCI (ora12c1.localdomain) 2> info mgr

Manager is running (IP port ora12c1.localdomain.7909, Process ID 14303).

GGSCI (ora12c1.localdomain) 3> exit

 

 

 

 

 

2.       Create credentials for gg user

GGSCI (ora12c1.localdomain) 6> create credentialstore

GGSCI (ora12c1.localdomain) 6>alter credentialstore add user oggtrg  password xxxxxxx alias oggtrg

 

GGSCI (ora12c1.localdomain) 1> info credentialstore

 

Reading from ./dircrd/:

 

Default domain: OracleGoldenGate

 

  Alias: oggtrg

  Userid: oggtrg@ogg2

 

GGSCI (ora12c1.localdomain) 1> dblogin useridalias oggtrg

Successfully logged into database OGG2.

 

GGSCI (ora12c1.localdomain as c##oggsrc@cdb12c/CDB$ROOT) 2>

GGSCI (ora12c1.localdomain) 2>

3.       Add check point table

GGSCI (ora12c1.localdomain) 3>  add checkpointtable

4.       Prepare replicat parameter file

 

GGSCI (ora12c1.localdomain) 3> view param RROGG1

 

replicat RROGG1

ASSUMETARGETDEFS

DISCARDFILE ./dirdat/reast.dsc, PURGE

USERIDalias oggtrg

MAP OGG1.east.*, TARGET OGG2.west.*;

 

GGSCI (ora12c1.localdomain) 4> add replicat RROGG1, EXTTRAIL ./dirdat/PP

 GGSCI (ora12c1.localdomain) 4>  REGISTER EXTRACT EXSRC,DATABASE container(oggsrc);

GGSCI (ora12c1.localdomain) 4> start RROGG1

Create a table on OGG1

Create a  same  table in OGG2

GGSCI (ora12c1.localdomain as c##oggsrc@cdb12c/CDB$ROOT) 4> add trandata OGG1.east.*

 

Logging of supplemental redo log data is already enabled for table OGG1.EAST.ECONOMIC_ENTITY.

 

TRANDATA for instantiation CSN has been added on table 'OGG1.EAST.ECONOMIC_ENTITY'.

Logging of supplemental redo log data is already enabled for table OGG1.EAST.GDP_BY_YEAR.

 

TRANDATA for instantiation CSN has been added on table 'OGG1.EAST.GDP_BY_YEAR'.

Logging of supplemental redo log data is already enabled for table OGG1.EAST.GDP_GROWTH_BY_YEAR.

 

TRANDATA for instantiation CSN has been added on table 'OGG1.EAST.GDP_GROWTH_BY_YEAR'.

GGSCI (ora12c1.localdomain as c##oggsrc@cdb12c/CDB$ROOT) 5>

 

Run some inserts and the check stats .

 

GGSCI (ora12c1.localdomain as c##oggsrc@cdb12c/CDB$ROOT)  stats ER*

GGSCI (ora12c1.localdomain as c##oggsrc@cdb12c/CDB$ROOT)  stats PP*

GGSCI (ora12c1.localdomain as c##oggsrc@cdb12c/CDB$ROOT)  stats RR*

 

 



Popular Posts