We have below details. we are going to replicate two schema “APP” and “SCOTT”
Source database:
11G database at 11.2.0.4
DB Name : ORCL
Target Database
19C database at 19.3.0.0.0
CDB Name : CDB
PDB NAme : ORCLPDB
Goldengate version 19.1.0.0.0.
On 11G database source database.
1.create tablespace for Goldengate SQL> CREATE TABLESPACE goldengate DATAFILE '/data/19C/CDB/goldengate01.dbf' SIZE 100M AUTOEXTEND ON; 2.create user for Goldengate and give required permission SQL> CREATE USER GGUSER IDENTIFED by gguser; SQL> ALTER USER gguser DEFAULT TABLESPACE goldengate; SQL> alter database add supplemental log data; Database altered. SQL> grant create session ,dba to gguser; Grant succeeded. SQL> execute dbms_goldengate_auth.grant_admin_privilege('GGUSER'); PL/SQL procedure successfully completed. 3. paramter at database end alter system set enable_goldengate_replication=true scope=both; 4. add credential store GGSCI (testlab1) 4> add CREDENTIALSTORE Credential store created. GGSCI (testlab1) 5> ALTER CREDENTIALSTORE ADD USER gguser@ORCL alias GGORCL11G; Password: Credential store altered. 5. Create extract paramter file. EXTRACT EXT_MIG --SETENV (ORACLE_SID="ORCL") --SETENV (ORACLE_HOME = "/app/oracle/product/11.2.0/dbhome_1") useridalias GGORCL11G --USERID gguser@ORCL, PASSWORD gguser logallsupcols --TRANLOGOPTIONS DBLOGREADER DDL INCLUDE MAPPED --fetchoptions fetchpkupdatecols EXTTRAIL /app/19.1/ggs/dirdat/ac TABLE scott.*; TABLE app.*; GGSCI (testlab1) 2> dblogin USERIDALIAS GGORCL11G; Successfully logged into database. GGSCI (testlab1 as gguser@ORCL) 23> add extract EXT_MIG, integrated tranlog, begin now EXTRACT (Integrated) added. GGSCI (testlab1 as gguser@ORCL) 3> add exttrail /app/19.1/ggs/dirdat/ac extract EXT_MIG megabytes 200 EXTTRAIL added. 6. Create pump parameter file and add EXTRACT PMP_MIG --USERID gguser@ORCL, PASSWORD gguser useridalias GGORCL11G passthru RMTHOST 192.168.100.54, MGRPORT 7809 RMTTRAIL /app/19C/ggs/dirdat/ad DDL INCLUDE MAPPED; TABLE scott.*; TABLE app.*; GGSCI (testlab1 as gguser@ORCL) 12> add extract PMP_MIG exttrailsource /app/19.1/ggs/dirdat/ac begin now EXTRACT added. GGSCI (testlab1 as gguser@ORCL) 13> add rmttrail /app/19C/ggs/dirdat/ad extract PMP_MIG RMTTRAIL added. GGSCI (testlab1 as gguser@ORCL) 16> register extract EXT_MIG database 2021-07-29 15:19:27 INFO OGG-02003 Extract EXT_MIG successfully registered with database at SCN 1053446.
Lets prepare target side now.
7.create tablespace, user and parameter and parameter at CDB level SQL> CREATE TABLESPACE goldengate DATAFILE '/data/19C/CDB/ORCLPDB/goldengate01.dbf' SIZE 100M AUTOEXTEND ON; SQL> create user C##GGUSER identified by gguser default tablespace goldengate; SQL> grant create session,dba to C##GGUSER container=all; SQL> execute dbms_goldengate_auth.grant_admin_privilege('C##GGUSER'); SQL> alter system set enable_goldengate_replication=true scope=both; 8. create tablespace,user at PDB level SQL> CREATE TABLESPACE goldengate DATAFILE '/data/19C/PDB/ORCLPDB/goldengate01.dbf' SIZE 100M AUTOEXTEND ON; SQL> create user GGUSER identified by gguser default tablespace goldengate; SQL> execute dbms_goldengate_auth.grant_admin_privilege('GGUSER'); 9. Create credential store GGSCI (testlab2) 4> add CREDENTIALSTORE Credential store created. GGSCI (testlab2) 1> ALTER CREDENTIALSTORE ADD USER c##gguser@CDB password gguser alias GGORCL19CCDB; Credential store altered. GGSCI (testlab2) 2> ALTER CREDENTIALSTORE ADD USER gguser@ORCLPDB password gguser alias GGORCL19CPDB; Credential store altered. 10. Create replicate REPLICAT MIGREP SETENV (ORACLE_SID='CDB') SETENV (ORACLE_HOME = "/app/oracle/product/19C") useridalias GGORCL19CPDB --DBOPTIONS INTEGRATEDPARAMS(parallelism 6) --USERID C##gguser@ORCLPDB, PASSWORD gguser --ASSUMETARGETDEFS ddl include mapped ddloptions report handlecollisions MAP SCOTT.*, TARGET ORCLPDB.SCOTT.*; MAP APP.*, TARGET ORCLPDB.APP.*; GGSCI (testlab2) 2> DBLOGIN USERIDALIAS GGORCL19CPDB Successfully logged into database ORCLPDB. GGSCI (testlab2 as gguser@CDB/ORCLPDB) 4> add replicat MIGREP, integrated, exttrail /app/19C/ggs/dirdat/ad REPLICAT (Integrated) added. GGSCI (testlab2 as gguser@CDB/ORCLPDB) 6> register REPLICAT MIGREP database 2021-07-29 16:49:34 INFO OGG-02528 REPLICAT MIGREP successfully registered with database as inbound server OGG$MIGREP. GGSCI (testlab2 as gguser@CDB/ORCLPDB) 8> start replicat MIGREP aftercsn 2313362 Sending START request to MANAGER ... REPLICAT MIGREP starting GGSCI (testlab2) 5> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING REPLICAT RUNNING MIGREP 00:06:32 00:00:00