Configure the Golden Gate on one schema to another schema in one database for learning

 Steps to Configure Golden Gate in a Single Database

Preinstallation steps for GGSCI performed on Oracle Database

  1. Verify the your Oracle Database in archive log mode
-- Verify that its enabled or disabled
archive log list;

-- Enable archive mode of database
shutdown immediate;
starup mount;
alter database archivelog;
alter database open;

2. Enable the supplemental logging in Oracle database


ALTER database add supplemental log data;
alter database add supplemental log data (ALL) columns;
ALTER system switch logfile;

-- Verify the supplemental logging enabled 
select minimal,primary_Key,unique_key,foreign_key,all_column,procedural from dba_supplemental_logging;

3. Create a tablespace for gguser used for golden gate

create tablespace gg_tablespace datafile '/u01/app/oracle/oradata/pdb1/gg_files01.dbf'

4. Add gguser and grant permission to user.

-- Create user
Create user gguser identified by password default tablespace gg_tablespace temporary tablespace temp;

-- Permission
Grant UNLIMITED TABLESPACE to gguser;
GRANT CONNECT, RESOURCE TO gguser;
GRANT CREATE SESSION TO gguser;
GRANT ALTER SESSION TO gguser;
GRANT SELECT ANY DICTIONARY TO gguser;
GRANT FLASHBACK ANY TABLE TO gguser;
GRANT SELECT ANY TABLE TO gguser;
GRANT INSERT ANY TABLE TO gguser;
GRANT UPDATE ANY TABLE TO gguser;
GRANT DELETE ANY TABLE TO gguser;
GRANT EXECUTE ON DBMS_FLASHBACK TO gguser;

-- For integrated process capture (we are not using currently)
exec dbms_goldengate_auth.grant_admin_privilege('GGUSER');
grant insert on system.logmnr_restart_ckpt$ to gguser;
grant update on sys.stream$_capture_process to gguser;

5. Install or setup the golden gate. Follow the link: Golden Gate setup on Linux

6.After setup, we need to check the manager process is running with INFO ALL command.

[oracle@localhost gg]$ ./ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 21.3.0.0.0 OGGCORE_21.3.0.0.0_PLATFORMS_210728.1047_FBO
Oracle Linux 7, x64, 64bit (optimized), Oracle Database 21c and lower supported versions on Jul 29 2021 03:59:23
Operating system character set identified as UTF-8.
Copyright (C) 1995, 2021, Oracle and/or its affiliates. All rights reserved.

GGSCI (localhost.localdomain) 1> info all
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
MANAGER     RUNNING  

7. Suppose we have hr and scott schema in the database with emp table in it.

SQL> conn hr@pdb1
Enter password: 
Connected.

SQL> create table emp (id number,name varchar(100), salary number);   
Table created.

8. Create a Integrated extract process on the golden gate and start for emp table

Note: No, Classic Extract is not supported in Oracle GoldenGate 21c. It has been deprecated since version 18c and completely desupported in 21c and beyond.

edit param ext01

extract ext01
userid gguser@pdb1,password gguser
rmthost localhost,mgrport 7809
rmtrail /u01/app/oracle/product/gg/dirdat/ext01/et
table hr.emp;

9. Start the integrated extract process.

GGSCI (localhost.localdomain as gguser@orcl) 9> start extract ext01
Error: Extract group EXT01 does not exist.

GGSCI (localhost.localdomain as gguser@orcl) 10> dblogin userid gguser@pdb1,password gguser
Successfully logged into database.

GGSCI (localhost.localdomain as gguser@orcl) 14> add extract ext01 tranlog,begin now
Integrated Extract added.


GGSCI (localhost.localdomain as gguser@orcl) 22> ADD RMTTRAIL /u01/app/oracle/product/gg/dirdat/ext01/et, EXTRACT ext01, MEGABYTES 100
RMTTRAIL added.   

GGSCI (localhost.localdomain as gguser@orcl) 15> info all          
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
MANAGER     RUNNING                                           
EXTRACT     STOPPED     EXT01       00:00:00      00:00:24   

2025-07-26 21:56:32  ERROR   OGG-02022  Logmining server does not exist on this 
Oracle database.

GGSCI (localhost.localdomain as gguser@orcl) 45> REGISTER EXTRACT ext01 DATABASE
2025-07-26 22:12:25  INFO    OGG-02003  Extract group EXT01 successfully registered with database at SCN 6034876.

GGSCI (localhost.localdomain) 2> start extract ext01
Sending START request to Manager ...
Extract group EXT01 starting.

GGSCI (localhost.localdomain as gguser@orcl) 67> info all
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
MANAGER     RUNNING                                           
EXTRACT     RUNNING     EXT01       00:00:00      00:20:48      

10. Add the checkpoint table in the GoldenGate

GGSCI (localhost.localdomain) 69> dblogin userid gguser@pdb1, password gguser
Successfully logged into database.

GGSCI (localhost.localdomain as gguser@orcl) 70> add checkpointtable gguser.chkpt
Successfully created checkpoint table gguser.chkpt.

11. Create a replicate process of GoldenGate

edit param rep01

REPLICAT rep01
USERID gguser@pdb1, PASSWORD gguser
DISCARDFILE /u01/app/oracle/product/gg/dirout/rep01.dsc, APPEND
MAP hr.emp, TARGET scott.emp;

12. Add replicate process

ADD REPLICAT rep01, EXTTRAIL /u01/app/oracle/product/gg/dirdat/et, CHECKPOINTTABLE gguser.chkpt

13. Check the status of all process


GGSCI (localhost.localdomain) 15> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     EXT01       00:00:00      21:33:26    
REPLICAT    RUNNING     REP01       00:00:00      00:00:09    

14. Verify the operation in database from HR schema to SCOTT Schema data start moving:

SQL> alter session set container=pdb1; 
Session altered.

SQL> conn hr@pdb1 
Enter password: 
Connected.

SQL> select * from emp;
no rows selected

SQL> desc emp;
Name					   Null?    Type
----------------------------------------- -------- ----------------------------
ID						    NUMBER
NAME						    VARCHAR2(100)
SALARY 					            NUMBER

SQL> insert into emp values(1, 'RAM',10000)
1 row created.

SQL> select * from scott.emp;
no rows selected

SQL> commit;
Commit complete.

SQL> select * from scott.emp;
	ID      NAME                         SALARY
----------     ----------------------------  ------------------------
	 1     RAM                           10000

15. Verify from Golden gate at extract process:

GGSCI (localhost.localdomain) 34> stats extract ext01

Sending STATS request to Extract group EXT01 ...

Start of statistics at 2025-07-27 19:51:34.

Output to /u01/app/oracle/product/gg/dirdat/et:

Extracting from HR.EMP to HR.EMP:

*** Total statistics since 2025-07-27 19:51:26 ***
    Total inserts                              1.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           1.00

*** Daily statistics since 2025-07-27 19:51:26 ***
    Total inserts                              1.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           1.00

*** Hourly statistics since 2025-07-27 19:51:26 ***
    Total inserts                              1.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           1.00

*** Latest statistics since 2025-07-27 19:51:26 ***
    Total inserts                              1.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           1.00

End of statistics.

Verify at replicate process:

GGSCI (localhost.localdomain) 35> stats replicat rep01

Sending STATS request to Replicat group REP01 ...

Start of statistics at 2025-07-27 19:57:54.

Replicating from HR.EMP to PDB1.SCOTT.EMP:

*** Total statistics since 2025-07-27 19:51:57 ***
    Total inserts                              1.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           1.00

*** Daily statistics since 2025-07-27 19:51:57 ***
    Total inserts                              1.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           1.00

*** Hourly statistics since 2025-07-27 19:51:57 ***
    Total inserts                              1.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           1.00

*** Latest statistics since 2025-07-27 19:51:57 ***
    Total inserts                              1.00
    Total updates                              0.00
    Total deletes                              0.00
    Total upserts                              0.00
    Total discards                             0.00
    Total operations                           1.00

End of statistics.

Leave a Reply