Saturday, April 9, 2016

GoldenGate Tutorial: Zero downtime database migration goldengate | zero downtime migration oracle


https://www.youtube.com/watch?v=s-m8TACtRG0&index=2&list=PLZSKX9aay1XvIQjy0lWJ5RSn0iuCWGrnL&nohtml5=False

there are different types of setups for zero downtime database migration by using datapump ,rman
concept of zero downtime migration we do intital data load from source database to target database while doing dataload  some initial dataload
some application could be doing update what ever changes happen during dataload that changes will also get migrated to target
on source database
select * from src.supplier

lets say it displays 3 record

check status target
select * from src.supplier
no records

make sure goldengate process are running


cd /wyshied/gg_home/
./ggsci
>info all
make sure all process are running



on target stop extract
cd /wyshied/gg_home/
./ggsci
>info all
>stop replicat rep01


on source find out current scn
===============================
SQL>select current_scn from v$database;

let say 100

we will use this scn to start export
.oraenv
PrimeDG
expdp schemas=SRC dumpfile=src_old.dmp  flashback_scn=100
Username: / as sysdba
copy dumpfile
/wysheid/11.2.0/admin/source/dpdump/src.dmp

scp /wysheid/11.2.0/admin/source/dpdump/src.dmp oracle@192.168.1.100 : /wysheid/gg_home/

BEFORE YOU DO IMPORT INSERT FEW RECORDS TO SOURCE TABLE
==========================================================
SQLPLUS / AS SYSDBA
SQL> select * from src.supplier;
SQL>insert into src.suppliet values (13,'after','later');
/
/
/
/
commit;

varify these records are there in target
SQL> select * from src.supplier;
NO


THIS WILL NOT BE REPLICATED ON TARGET BECAUSE WE HAVE STOPPED REPLICAT

CHECK STATUS OF REPLICAT
> info all

IT SHOWS REPLICAT STOPPED

find out userdump destination of target  and copy to target
show parameter user_dump_dest

once file is copied


NOW START IMPORT PROCESS ON TARGET
Impdp schemas=SRC dumpfile=SRC.dmp TABLE_EXISTS_ACTION=truncate

Username: / as sysdba

VARIFY IF THE RECORDS ARE UPDATED

sqlplus / as sysdba

SQL>select * from src.supplier;

you will not see records that get updated during export


so on target ask replicat to start from that scn
./ggsci

>info all
> start replicat rep01,aftercsn 100
>info all


VARIFY IF THE RECORDS ARE UPDATED

sqlplus / as sysdba

SQL>select * from src.supplier;

you will see ee records that get updated during export



==================================================================

No comments:

Post a Comment