Golden Gate Initial Load :
Prerequisites for the Golden Gate Initial Load
Before starting the Golden Gate initial load, ensure the following
1) You must disable any foreign-key constraints on the target tables to prevent errors/speed up performance.
2) Disable any triggers on the target tables.
3) You may want to drop indexes on your target tables to speed up performance.
Procedure 1. Using
SOURCEISTABLE and RMTTASK/SPECIALRUN
Source
Database:
1. Note the SCN from source database:
SQL>
select dbms_flashback.get_system_change_number() from dual;
SQL>
select current_scn from v$database ;
2.Create
EXTRACT/PUMP/REPLICATE :./ggsci
GGSCI>
dblogin userid ogg, password ogg
GGSCI>
ADD EXTRACT EJAY1, INTEGRATED TRANLOG, BEGIN NOW
GGSCI>
register extract EJAY1 database
GGSCI>
add exttrail ./dirdat/sa, extract EJAY1
GGSCI> add trandata JAY.TBL1
GGSCI>
edit param EJAY1
EXTRACT
EJAY1
USERID ogg,
PASSWORD ogg
EXTTRAIL
./dirdat/sa
TABLE
JAY.TBL1;
3. Create
PUMP:
GGSCI>
Add extract PJAY1, EXTTRAILSOURCE ./dirdat/sa
GGSCI>
Add rmttrail ./dirdat/rf, extract PJAY1
GGSCI>
edit param Pschema1D1
EXTRACT
PJAY1
USERID ogg,
PASSWORD ogg
RMTHOST
ggdev, MGRPORT 7809
RMTTRAIL
./dirdat/ra
TABLE
JAY.TBL1;
4. Replicate
Database:
GGSCI>
dblogin userid ogg, password ogg
GGSCI>
add replicat RJAY1, integrated exttrail ./dirdat/ra
GGSCI>
edit param RJAY1
REPLICAT
RJAY1
USERID ogg,
PASSWORD ogg
ASSUMETARGETDEFS
MAP JAY.TBL1
TARGET JAY.TBL1;
5. Configure initial load extract:
GGSCI>
ADD EXTRACT ELOAD, SOURCEISTABLE >>>> for initial load extract
GGSCI>
EDIT PARAM ELOAD
EXTRACT
ELOAD
userid ogg,
password ogg
RMTHOST
dev.ip.com, mgrport 7840
RMTTASK REPLICAT, GROUP RLOAD >>>> To auto start
initial load replicate
TABLE
JAY.TBL1;
6. initial
Replicate:
GGSCI> ADD REPLICAT RLOAD, SPECIALRUN >>>> for initial load
Replicate
GGSCI>
EDIT PARAM RLOAD
REPLICAT
RLOAD
userid ogg,
password ogg
ASSUMETARGETDEFS
MAP
JAY.TBL1, TARGET JAY.TBL1;
7. Start Change Sync EXTRACT and PUMP but NOT Replicate:
START EJAY1
START PJAY1
[ HOLD Replicate for change sync process]
8. Now start
the initial load extract. Remember, this will automatically
start the initial load replicate on
target :
mgr.prm at
Target add (ACCESSRULE, PROG *, IPADDR *, ALLOW) (otherwise - ERROR OGG-01201
Error reported by MGR : Access denied.)
GGSCI>
refresh mgr
START ELOAD
INFO ELOAD
At Target:
sqlplus / as
sysdba
select *
from JAY.TBL1;
9) Start
sync Replicate using SCN
GGSCI>
start RJAY1, aftercsn <Initial_scn_from_step#1>
x
Procedure 2. Using
expdp with SCN number :
1) Start the
Extract
While your
source database is running, you first need to start the extract so that the
transactions are captured by Oracle Golden Gate.
GGSCI>start
extract exext, begin now
2) Check the
Source DB SCN
Check the
database SCN after the extract started, so that you make sure all the new
transactions after this SCN are captured by Oracle Golden Gate.
SQL>
select dbms_flashback.get_system_change_number() from dual;
SQL>
select current_scn from v$database ;
3) Export
Data from the Source Database
Export the
database with with the flashback_scn option.
expdp
directory=pump_dir flashback_scn=xxx dumpfile=src.dmp logfile=sourcedb.log (schema=xxx)
4) Import
Data to the Target Database:
impdp
directory=pump_dir dumpfile=src.dmp logfile=sourcedb_imp.log (schemas=xxx)
5) Start the
Replicate:
Starting the
replicat with aftercsn.
GGSCI>
start replicat exrep, AFTERCSN XXX