- Source server – ggsource
- Source DB – germany
- Target Server – ggtarget
- Target DB – london
- Golden gate user – gguser
- Replicated user – u01
Host file
Setup host file on both source and target server


Connectivity Check
Ensure both source and target can ping each other.


Check port 7809 is open


Parameter values
Archive log mode, Supplemental logging, force logging and goldengate replication should be enabled on source and target.
select LOG_MODE from v$database;
select SUPPLEMENTAL_LOG_DATA_MIN, FORCE_LOGGING from v$database;
show parameter ENABLE_GOLDENGATE_REPLICATION
if not use below
shu immediate;
startup mount;
ALTER DATABASE ARCHIVELOG;
alter database open;
ALTER DATABASE FORCE LOGGING;
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER SYSTEM SET ENABLE_GOLDENGATE_REPLICATION=TRUE SCOPE=BOTH;


Create tbs for golden gate user both source / target
CREATE TABLESPACE goldentbs
DATAFILE
SIZE 100M
AUTOEXTEND ON;


Create user –
create user gguser identified by gguser default tablespace goldentbs quota unlimited on goldentbs;
grant create session,connect,resource,alter system to gguser;
EXEC
DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE(grantee=>'gguser',privilege_type=>'CAPTURE', grant_optional_privileges=>'*');


Go to golden gate installed location and run these scripts on source
@marker_setup
@ddl_setup
@role_setup.sql
GRANT GGS_GGSUSER_ROLE TO gguser;
@ddl_enable.sql



…..


Manager configuration source and target
GGSCI (ggsource.localdomain) 4> edit params mgr
PORT 7809
USERIDALAIS gguser
GGSCI (ggsource.localdomain) 5> view param mgr
GGSCI (ggsource.localdomain) 6> info mgr

Tnsnames.ora
Both source and target tnsnames.ora should contain entries for each other. Test remote connectivity




User replicated
In this demo we are replicating
user u01@germany:ggsource
to
user u01@London:ggtarget
Create user us01 in source and target (It may be an existing user also)
create user us01 identified by us01 default tablespace users temporary tablespace temp;
grant connect,resource,unlimited tablespace to us01;


Create table in source
For testing purpose, we are creating one table in source side in user us01.
conn us01/us01
create table t1 (id number, name varchar2(30));
insert into t1 values (1,'demo');
insert into t1 values (2,'ping');
commit
select * from t1;

Create initial load in target
We need to create initial load
I used db link in target to create initial load you can use any other method like export import.


Add trandata
Source side add trandata for particular table which we wants to replicate the data to target database. I am adding for all tables in us01 user.
Login as gguser
dblogin userid gguser password gguser

add trandata us01.*

Create source extract
edit param ext1
EXTRACT ext1
USERID gguser@germany, PASSWORD gguser
EXTTRAIL /u01/app/oracle/product/gghome/dirdat/aa
DDL INCLUDE ALL
TABLE us01.*;

Create the Extract group and the local Extract trail file and start the extract process
add extract ext1 tranlog begin now
add exttrail /u01/app/oracle/product/gghome/dirdat/aa extract ext1
start extract ext1


Create datapump
edit param dpump1
EXTRACT dpump1
USERID gguser@germany, PASSWORD gguser
RMTHOST ggtarget, MGRPORT 7809
RMTTRAIL /u01/app/oracle/product/gghome/dirdat/ab
DDL INCLUDE ALL
TABLE us01.*;
Create data pump group and the remote Extract trail file and start the data pump process.
add extract dpump1 exttrailsource /u01/app/oracle/product/gghome/dirdat/aa
add rmttrail /u01/app/oracle/product/gghome/dirdat/ab extract dpump1
start extract dpump1

Target –
Add checkpoint table
dblogin userid gguser password gguser
add checkpointtable gguser.chkpt
info checkpointtable gguser.chkpt

Create the Replicat parameter file.
REPLICAT rep1
USERID gguser@london, PASSWORD gguser
DDL INCLUDE ALL
DDLERROR DEFAULT IGNORE
ASSUMETARGETDEFS
MAP us01.*, TARGET us01.*;
ASSUMETARGETDEFS – parameter avoids OGG-00423 Could Not Find Definition For {Table} Doc ID 1309972.1
Create and start the replicat process.
add replicat rep1 exttrail /u01/app/oracle/product/gghome/dirdat/ab checkpointtable gguser.chkpt
start replicat rep1

Create one sample table and generate insert operation into that table.
Created table T2 in source db (germany)

This table got replicated in target db (london)

If we insert some rows in this table it will replicate in target.


Verify that the table and rows were replicated into the target database.



