Setting up a basic Oracle Golden Gate configuration

By: Justin Richard Bleistein

Oracle Golden Gate is software that is used to replicate data between databases. Golden Gate can work in a heterogeneous environment, so for example a Microsoft MS SQL server database can replicate to an Oracle database, etc. Golden Gate is positioned to replace Oracle Streams and Oracle Change Capture. Going forward Golden Gate is Oracle’s preferred database replication tool.

I have started to work with Golden Gate and I have been really impressed with just how powerful and flexible it is. I will demonstrate just how powerful and flexible it is in future blog entries but I will just cover the installation and configuration aspects of it in this blog entry.

Before we get into the installation and configuration of Oracle Golden Gate, we should cover some architecture. Oracle Golden Gate replicates DDL and DML. Golden Gate is available for many platforms, e.g. Microsoft Windows, UNIX, Linux, etc. Oracle Golden gate software needs to be installed on both the source and target Oracle database servers. There are processes/daemons which are started on both the source and target database servers, they are detailed below:

GG process:

Description:

MANAGER Runs on all servers involved in the replication. It is the master process which controls all GG activity.
EXTRACT Runs on the source database server. It extracts data from the Oracle database either directly or indirectly in the case of Integrated capture.
DATAPUMP Runs on the source database server. It is an optional process which transmits extracted data from the source database server to the target database server. (Optional because the EXTRACT process can do this directly).
SERVER COLLECTOR Runs on the target database server. Receives extracted data from source database server and stages it in the local trail files on the target database server for the REPLICAT process to apply it to the target database.
REPLICAT Runs on the target database server. Reads extracted data from the local trail file on the target database server and applies the data to the target database.

In my test environment I have two AIX LPARs running on IBM POWER 8 servers. AIX LPAR Dbhost1 is the source database server running Oracle database ORAGG01. AIX LPAR Dbhost2 is the target database server running Oracle database ORAGG02. This is a simple single instance Oracle environment. We are not using RAC, Dataguard, ASM or anything like that. We will be setting up Golden Gate in integrated mode in this example.

 

Test environment:

AIX LPAR # 1:

 

Hostname: Dbhost01

AIX 7.1 TL 3 SP 4 (7100-03-04-1441)

Oracle database SID: ORAGG01

Oracle version: 12.1.0

Oracle GG version: 12.2.0

 

AIX LPAR # 2:

 

Hostname: Dbhost02

AIX 7.1 TL 3 SP 4 (7100-03-04-1441)

Oracle database SID: ORAGG02

Oracle version: 12.1.0

Oracle GG version: 12.2.0

oracle-diagram

 

High level data flow in Golden Gate:

  • The data changes are extracted from the source database by the EXTRACT process running on the source database server. NOTE: LOGMINER does the data extraction for Integrated capture.
  • The extracted data changes from the source database are written to trail files on a filesystem on the source database server by the EXTRACT process running on the source database server.
  • The extracted data changes are read from the local trail files on the source database server by the DATAPUMP process running on the source database server.
  • The extracted data changes are transmitted over the network to the target database server by the DATAPUMP process running on the source database server.
  • The extracted data changes arrive on the target database server and are received by the SERVER COLLECTOR process running on the target database server where they are written to the local trail files on the target database server by the SERVER COLLECTOR process.
  • The extracted data changes are read from the local trail files on the target database server by the REPLICAT process running on the target database server.
  • The extracted data changes read from the local trail files and then written to the target database by the REPLICAT process on the target database server.

On the source database server we see database ORAGG01 running as well as the listener.

$ hostname 
dbhost01

$ ps -ef | grep -i smon | grep -iv grep
 oracle 21299352 1 0 11:31:26 - 0:00 ora_smon_ORAGG01

$ ps -ef | grep -i tns | grep -iv grep
 oracle 19071162 1 0 Dec 04 - 0:07 /u02/app/oracle/product/12.1.0/dbhome_1/bin/tnslsnr LISTENER –inherit

On the target database server we see database ORAGG02 running as well as the listener.

$ hostname
dbhost02

$ ps -ef | grep -i smon | grep -iv grep
 oracle 15597866 1 0 11:31:24 - 0:00 ora_smon_ORAGG02

$ ps -ef | grep -i tns | grep -iv grep
 oracle 3801326 1 0 Dec 04 - 0:10 /u02/app/oracle/product/12.1.0/dbhome_1/bin/tnslsnr LISTENER -inherit

Setup the tnsnames.ora file on both database servers, so that Oracle tools on both servers can get to the database on the other:

$ cd $TNS_ADMIN
$ pwd
/u02/app/oracle/product/12.1.0/dbhome_1/network/admin

$ cat tnsnames.ora

ORAGG01 =
 (DESCRIPTION =
 (ADDRESS_LIST =
 (ADDRESS = (PROTOCOL = TCP)(HOST = dbhost01)(PORT = 1521))
 )
 (CONNECT_DATA =
 (SERVICE_NAME = ORAGG01)
 )
 )

ORAGG02 =
 (DESCRIPTION =
 (ADDRESS_LIST =
 (ADDRESS = (PROTOCOL = TCP)(HOST = dbhost02)(PORT = 1521))
 )
 (CONNECT_DATA =
 (SERVICE_NAME = ORAGG02)
 )
 )

$ tnsping ORAGG02

TNS Ping Utility for IBM/AIX RISC System/6000: Version 12.1.0.1.0 - Production on 13-DEC-2016 12:05:03

Copyright (c) 1997, 2013, Oracle. All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = dbhost02)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ORAGG02)))
OK (0 msec)

$ cd $TNS_ADMIN
$ pwd
/u02/app/oracle/product/12.1.0/dbhome_1/network/admin

$ cat tnsnames.ora

ORAGG01 =
 (DESCRIPTION =
 (ADDRESS_LIST =
 (ADDRESS = (PROTOCOL = TCP)(HOST = dbhost01)(PORT = 1521))
 )
 (CONNECT_DATA =
 (SERVICE_NAME = ORAGG01)
 )
)

ORAGG02 =
 (DESCRIPTION =
 (ADDRESS_LIST =
 (ADDRESS = (PROTOCOL = TCP)(HOST = dbhost02)(PORT = 1521))
 )
 (CONNECT_DATA =
 (SERVICE_NAME = ORAGG02)
 )
)

$ tnsping ORAGG01

TNS Ping Utility for IBM/AIX RISC System/6000: Version 12.1.0.1.0 - Production on 13-DEC-2016 12:05:51

Copyright (c) 1997, 2013, Oracle. All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = dbhost01)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ORAGG01)))
OK (70 msec)

Create the application schema user in both databases. This schema will hold the data we want to replicat:

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS01
TEMP

SQL> create tablespace app01 datafile '/u07/oradata/dbname/app01.dbf' size 200m;

Tablespace created.

SQL> create user app identified by app123;

User created.

SQL> alter user app default tablespace app;

User altered.

SQL> grant create session,create table to app;

Grant succeeded.

SQL> alter user app quota unlimited on app;

User altered.

Put both the source and target Oracle databases into archive log mode and set their memory parameters:

 
SQL> archive log list;

Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u02/app/oracle/product/12.1.0/dbhome_1/dbs/arch
Oldest online log sequence 114
Current log sequence 116

SQL> select log_mode from v$database;

LOG_MODE
------------
NOARCHIVELOG

SQL> alter system set log_archive_dest_1='location=/u12/arcdata/dbname/' scope=spfile;

System altered.

SQL> alter system set log_archive_format='%t_%s_%r.arc' scope=spfile;

System altered.

SQL> shutdown immediate;

Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;

ORACLE instance started.

Total System Global Area 250560512 bytes
Fixed Size 2358864 bytes
Variable Size 192938416 bytes
Database Buffers 50331648 bytes
Redo Buffers 4931584 bytes

Database mounted.

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u12/arcdata/dbname/
Oldest online log sequence 114
Next log sequence to archive 116
Current log sequence 116


SQL> select log_mode from v$database;

LOG_MODE
------------
ARCHIVELOG

SQL> show parameter memory_target;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
memory_target big integer 2G

SQL> show parameter memory_max_target;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
memory_max_target big integer 2G

Create a table called EMP in the APP schema in the source database and populate it with some data:

SQL> show user;

USER is "APP"

SQL> desc emp;

Name                                      Null?    Type
----------------------------------------- -------- ----------------------------
SSN                                       NOT NULL NUMBER(9)
LNAME                                              VARCHAR2(20)
FNAME                                              VARCHAR2(20)

SQL> select * from emp;

      SSN LNAME                FNAME
--------- -------------------- --------------------
157801378 bleistein            justin
123456789 Manning              larry
333333333 johnson              roy
999999999 anson                harold
222222222 german               lia
555555555 lewis                john
111111111 rogers               hanson
455555555 rogers               roy
122222222 rogers               mary
777777777 wang                 jim

10 rows selected.

Connect to the source database as SYSDBA and create a directory database object which points to a filesystem path on the source database server:

SQL> create directory export as '/u12/export_import';

Directory created.

Export the table from the APP schema from the source database:

$ pwd
/u12/export_import

$ df -gI .
Filesystem    GB blocks      Used      Free %Used Mounted on
/dev/u12lv1        6.88      3.70      3.18   54% /u12

$ ls
$

$ expdp tables=app.emp directory=export
Export: Release 12.1.0.1.0 - Production on Tue Dec 13 12:00:00 2016
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Starting "SYS"."SYS_EXPORT_TABLE_01":  /******** AS SYSDBA tables=app.emp directory=export
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
. . exported "APP"."EMP"                                 6.093 KB      10 rows
Master table "SYS"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_TABLE_01 is:
/u12/export_import/expdat.dmp
Job "SYS"."SYS_EXPORT_TABLE_01" successfully completed at Tue Dec 13 12:00:26 2016 elapsed 0 00:00:21

Transfer the export file from the source database server to the target database server:

$ scp expdat.dmp 192.168.240.197:/u12/export_import/expdat.dmp   

Connect to the target database as SYSDBA and create a directory database object which points to a filesystem path on the target database server:

SQL> create directory import as '/u12/export_import';

Directory created.

Import the table into the target database:

$ cd /u12/export_import
$ pwd
/u12/export_import

$ df -gI .
Filesystem    GB blocks      Used      Free %Used Mounted on
/dev/u12lv1        2.88      1.99      0.89   70% /u12

$ ls -ltr
total 304
-rw-r-----    1 oracle   oinstall     155648 Dec 13 12:00 expdat.dmp

$ impdp dumpfile=expdat.dmp directory=import

Import: Release 12.1.0.1.0 - Production on Tue Dec 13 12:03:03 2016

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Master table "SYS"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_FULL_01":  /******** AS SYSDBA dumpfile=expdat.dmp directory=import
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "APP"."EMP"                                 6.093 KB       10 rows
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Job "SYS"."SYS_IMPORT_FULL_01" successfully completed at Tue Dec 13 12:03:20 2016 elapsed 0 00:00:12

Verify the data just imported into the target database:

SQL> show user;
USER is "APP"

SQL> desc emp;
Name                                      Null?    Type
----------------------------------------- -------- ----------------------------
SSN                                       NOT NULL NUMBER(9)
LNAME                                              VARCHAR2(20)
FNAME
VARCHAR2(20)
SQL> select * from emp;

      SSN LNAME                FNAME
--------- -------------------- --------------------
157801378 bleistein            justin
123456789 Manning              larry
333333333 johnson              roy
999999999 anson                harold
222222222 german               lia
555555555 lewis                john
111111111 rogers               hanson
455555555 rogers               roy
122222222 rogers               mary
777777777 wang                 jim

10 rows selected.

Install the Oracle Golden Gate software on both database servers. You download the Golden Gate sotware from the Oracle OTN (Oracle Technology Network) site and it’s under the Oracle Fusion Middleware software category. You can also download it from the Oracle eDelivery site.

$ ls
OGG-12.2.0.1-README.txt          fbo_ggs_AIX_ppc_shiphome
OGG-12.2.0.1.1-ReleaseNotes.pdf  fbo_ggs_AIX_ppc_shiphome.zip

$ cd fbo_ggs_AIX_ppc_shiphome
$ ls
Disk1

$ cd Disk1
$ ls
install       response      runInstaller  stage

Golden Gate installs with the Oracle Universal Installer JAVA based utility, just like its database software. There is also a silent installation method.

$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB.   Actual 9731 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 8960 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-12-13_12-57-48PM. Please wait ...

image001

Select the radio button next to the database version you want to replicate. Click the “Next” button.

image002

Select the location where you want to install the GG software. Click the “Next” button:

image003

Click the “Install” button to begin the GG installation process.

image004

image005

Click the “Close” button to exit the OUI utility.

On both databases enable supplemental logging.

SQL> alter database add supplemental log data;

Database altered.

SQL> alter database force logging;

Database altered.

On both databases create the Golden Gate user schema to hold the database objects Golden Gate will need to function.

SQL> create tablespace gguser01 datafile '/u06/oradata/ORAGG01/gguser01.dbf' size 500m;

Tablespace created.

SQL> create user gguser identified by ora123;

User created.

SQL> alter user gguser default tablespace gguser01;

User altered.

SQL> alter user gguser quota unlimited on gguser01;

User altered.

SQL> grant create session,dba to gguser;

Grant succeeded.

The following PL/SQL procedure will grant the GGUSER schema user all of the database permission it requires for Golden Gate to function. 

SQL> exec dbms_goldengate_auth.grant_admin_privilege('gguser');

PL/SQL procedure successfully completed.

Now on both database servers, create the directories GG will need in its home directory and start the manager process/daemon. You will be using the ggsci utility to configure Golden Gate. The ggsci utility is the command line interpreter for Golden Gate, kind of like Sqlplus.

$  cd /gg/app/gguser/product/12.2.0/dbhome_1
$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO
AIX 6, ppc, 64bit (optimized), Oracle 12c on Jan 22 2016 00:48:45
Operating system character set identified as ISO-8859-1.

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

GGSCI (dbhost01) 2> create subdirs

Creating subdirectories under current directory /gg/app/gguser/product/12.2.0/dbhome_1

Parameter files                /gg/app/gguser/product/12.2.0/dbhome_1/dirprm: created
Report files                   /gg/app/gguser/product/12.2.0/dbhome_1/dirrpt: created
Checkpoint files               /gg/app/gguser/product/12.2.0/dbhome_1/dirchk: created
Process status files           /gg/app/gguser/product/12.2.0/dbhome_1/dirpcs: created
SQL script files               /gg/app/gguser/product/12.2.0/dbhome_1/dirsql: created
Database definitions files     /gg/app/gguser/product/12.2.0/dbhome_1/dirdef: created
Extract data files             /gg/app/gguser/product/12.2.0/dbhome_1/dirdat: created
Temporary files                /gg/app/gguser/product/12.2.0/dbhome_1/dirtmp: created
Credential store files         /gg/app/gguser/product/12.2.0/dbhome_1/dircrd: created
Masterkey wallet files         /gg/app/gguser/product/12.2.0/dbhome_1/dirwlt: created
Dump files                     /gg/app/gguser/product/12.2.0/dbhome_1/dirdmp: created

Please refer to my other blogs and/or Oracle documentation regarding what the different dir* directories are used for.

Configure the manager process parameter file. This process only have one required parameter – PORT. This is the TCP/IP port the manager process will listen on.

GGSCI (dbhost01) 1> edit params mgr
…
PORT 7809
…

Run the following command to display the different GG processes configured on this GG instance:

GGSCI (dbhost01) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     STOPPED

Start the manager process:

GGSCI (dbhost01) 2> start manager

Manager started.

Verify the manager process is running:

GGSCI (dbhost01) 3> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING

…

You can see that starting a GG process from the GG command line, starts the process on the database server itself:

$ ps -ef | grep -i gguser | grep -iv grep | grep -i mgr

gguser 21364926        1   0 13:57:20      -  0:00 ./mgr PARAMFILE /gg/app/gguser/product/12.2.0/dbhome_1/dirprm/mgr.prm REPORTFILE /gg/app/gguser/product/12.2.0/dbhome_1/dirrpt/MGR.rpt PROCESSID MGR USESUBDIRS

$

Add supplemental logging of the table we are replicating so that GG will have all the info it needs to replicate the table:

GGSCI (dbhost1) 4> dblogin userid gguser@ORAGG01, password ora123
Successfully logged into database.

GGSCI (dbhost01 as gguser@ORAGG01) 5> add trandata app.emp

Logging of supplemental redo data enabled for table APP.EMP.
TRANDATA for scheduling columns has been added on table 'APP.EMP'.
TRANDATA for instantiation CSN has been added on table 'APP.EMP'.
…

Create the extract parameter file. Our extract process will be called ext1:

GGSCI (dbhost01) 2> edit params ext1

…

EXTRACT ext1

USERID gguser@oragg01, password or123

EXTTRAIL ./drdat/aa

TABLE APP.EMP;

…

In the extract parameter file, we specify the type of process it is (EXTRACT), connect string so the extract process knows how to connect to the source database (USERID), the location on the source database server where to write the trail files which will contain the extracted data (EXTTRAIL – . means the GG home directory) and the (TABLE) the extract process is to extract.

Add the extract process to Golden Gate and instruct GG that you will be using the integrated capture method.

GGSCI (dbhost01) 3> add extract ext1, integrated tranlog, begin now

EXTRACT (Integrated) added.

Add the trail file location to GG:

GGSCI (dbhost01) 4> add exttrail ./dirdat/aa, extract ext1, megabytes 100

EXTTRAIL added.

Connect to the source database from the ggsci utility and register the GG extract process with that source database:

GGSCI (dbhost01) 6> dblogin userid gguser@ORAGG01, password ora123

Successfully logged into database.

GGSCI (dbhost01 as gguser@ORAGG01) 7> register extract ext database
2016-12-13 14:03:23  INFO    OGG-02003  Extract EXT1 successfully registered with database at SCN 385750.

Create the datapump parameter file:

GGSCI (dbhost01 as gguser@ORAGG01) 9> edit params datapmp1
…

EXTRACT datapmp1
USERID gguser@ORAGG01, password ora123
RMTHOST dbhost02, MGRPORT 7809
RMTTRAIL ./dirdat/bb
TABLE APP.EMP;

The extract parameter tells GG this is an extract process and its name (EXTRACT), the (USERID) parameter tells this process how to connect to the source database, the (RMTHOST) parameter tells the Data pump process the resolved hostname of the target database server, the (RMTTRAIL) parameter tells the Data pump where the trail files are to be written to once they reach the target database and the (TABLE) parameter tells the Data pump what database object we are replicating.

Add the datapump process to GG:

GGSCI (dbhost01 as gguser@ORAGG01) 10> add extract datapmp1, exttrailsource ./dirdat/aa begin now
EXTRACT added.

Add the remote trail file location to GG:

GGSCI (dbhost01 as gguser@ORAGG01) 11> add rmttrail ./dirdat/bb extract datapmp1

RMTTRAIL added.

Check the GG processes created:

GGSCI (dbhost01 as gguser@ORAGG01) 13> info all
Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     STOPPED     DATAPMP1    00:00:00      00:00:38
EXTRACT     STOPPED     EXT1    00:00:00      00:05:31

Start the newly created GG processes:

GGSCI (dbhost01 as gguser@ORAGG01) 14> start datapmp1

Sending START request to MANAGER ...
EXTRACT DATAPMP1 starting

Note, the Datapump process on the source database server will automatically start the server collector process on the target database server when data is being transmitted. This is like a lazy process.

GGSCI (dbhost01 as gguser@ORAGG01) 15> start ext1

Sending START request to MANAGER ...
EXTRACT EXTRACT1 starting

GGSCI (dbhost01 as gguser@ORAGG01) 18> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     DATAPMP1    00:00:00      00:01:06
EXTRACT     RUNNING     EXT1    00:00:02      00:00:03

On the target database server in the ggsci utility create the replicate process parameter file:

GGSCI (dbhost02) 2> edit params rep1
…

REPLICAT rep1
USERID gguser@ORAGG02, password ora123
MAP APP.EMP, TARGET APP.EMP;

The (REPLICAT) parameter identifies what type of process this is and the name of the process, the (USERID) parameter defines to the replicate process how to connect to the target database, and the (MAP) parameter instructs the replicate process how to table is to be mapped when replicated, i.e. its destination name and schema.

Add the replicat process to GG:

GGSCI (dbhost02) 1> dblogin userid gguser@ORAGG02, password ora123
Successfully logged into database.

GGSCI (dbhost02 as gguser@ORAGG02) 2> add replicat rep1 integrated exttrail ./dirdat/bb
REPLICAT (Integrated) added.

GGSCI (dbhost02 as gguser@ORAGG02) 3> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    STOPPED     REP1    00:00:00      00:00:03

Start the replicate process:

GGSCI (dbhost02 as gguser@ORAGG02) 5> start rep1

Sending START request to MANAGER ...
REPLICAT REPLCAT1 starting

GGSCI (dbhost02 as gguser@ORAGG02) 6> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    STARTING    REP1    00:00:00      00:00:13

GGSCI (dbhost02 as gguser@ORAGG02) 7> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    RUNNING     REP1    00:00:00      00:00:15
…

$ ps -ef | grep -i gguser | grep PARAM | grep -iv grep
gguser 12583160 15139278   0 14:39:45      -  0:46 /gg/app/gguser/product/12.2.0/gghome_1/replicat PARAMFILE /gg/app/gguser/product/12.2.0/gghome_1/dirprm/rep1.prm REPORTFILE /gg/app/gguser/product/12.2.0/gghome_1/dirrpt/REP1.rpt PROCESSID REP1 USESUBDIRS
gguser 15139278        1   0 14:33:51      -  0:09 ./mgr PARAMFILE /gg/app/gguser/product/12.2.0/gghome_1/dirprm/mgr.prm REPORTFILE /gg/app/gguser/product/12.2.0/gghome_1/dirrpt/MGR.rpt PROCESSID MGR USESUBDIRS

On the source database:

SQL> select * from emp;

      SSN LNAME                FNAME
--------- -------------------- --------------------
157801378 bleistein            justin
123456789 Manning              larry
333333333 johnson              roy
999999999 anson                harold
222222222 german               lia
555555555 lewis                john
111111111 rogers               hanson
455555555 rogers               roy
122222222 rogers               mary
777777777 wang                 jim

10 rows selected.

On the target database:

SQL> select * from emp;

SSN LNAME                FNAME
---------- -------------------- --------------------
157801378 bleistein            justin
123456789 Manning              larry
333333333 johnson              roy
999999999 anson                harold
222222222 german               lia
555555555 lewis                john
111111111 rogers               hanson
455555555 rogers               roy
122222222 rogers               mary
777777777 wang                 jim

10 rows selected.

On the target database go ahead and perform an UPDATE DML on the data in the EMP table, the table we have setup GG to replicat.

SQL> update emp set fname = 'JUSTIN' where fname = 'justin';

1 row updated.

SQL> commit;

Commit complete.

SQL> select * from emp;

      SSN LNAME                FNAME
--------- -------------------- --------------------
157801378 bleistein            JUSTIN
123456789 Manning              larry
333333333 johnson              roy
999999999 anson                harold
222222222 german               lia
555555555 lewis                john
111111111 rogers               hanson
455555555 rogers               roy
122222222 rogers               mary
777777777 wang                 jim

10 rows selected.

On the target database after a few seconds, we’ll see the change to the data. GG has replicated the change:

SQL> select * from emp;

      SSN LNAME                FNAME
--------- -------------------- --------------------
157801378 bleistein            JUSTIN
123456789 Manning              larry
333333333 johnson              roy
999999999 anson                harold
222222222 german               lia
555555555 lewis                john
111111111 rogers               hanson
455555555 rogers               roy
122222222 rogers               mary
777777777 wang                 jim

10 rows selected.

On the source database perform a DELETE DML against the data in the table:

SQL> delete from emp where fname = 'roy';

2 rows deleted.

SQL> commit;

Commit complete.

SQL> select * from emp;

      SSN LNAME                FNAME
--------- -------------------- --------------------
157801378 bleistein            JUSTIN
123456789 Manning              larry
999999999 anson                harold
222222222 german               lia
555555555 lewis                john
111111111 rogers               hanson
122222222 rogers               mary
777777777 wang                 jim

8 rows selected.

On the target database after a few seconds, we’ll see the change to the data. GG has replicated the change:

SQL> select * from emp;

      SSN LNAME                FNAME
--------- -------------------- --------------------
157801378 bleistein            JUSTIN
123456789 Manning              larry
999999999 anson                harold
222222222 german               lia
555555555 lewis                john
111111111 rogers               hanson
122222222 rogers               mary
777777777 wang                 jim

8 rows selected.

On the source database perform an INSERT DML against the data in the table:

SQL> insert into emp values(333333333,'wilson','george');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from emp;

      SSN LNAME                FNAME
--------- -------------------- --------------------
157801378 bleistein            JUSTIN
123456789 Manning              larry
999999999 anson                harold
222222222 german               lia
555555555 lewis                john
111111111 rogers               hanson
122222222 rogers               mary
777777777 wang                 jim
333333333 wilson        George

9 rows selected.

On the target database after a few seconds, we’ll see the change to the data. GG has replicated the change:

SQL> select * from emp;

      SSN LNAME                FNAME
--------- -------------------- --------------------
157801378 bleistein            JUSTIN
123456789 Manning              larry
999999999 anson                harold
222222222 german               lia
555555555 lewis                john
111111111 rogers               hanson
122222222 rogers               mary
777777777 wang                 jim
333333333 wilson        George

9 rows selected.