Você está na página 1de 8

Actions that must be done on both Source and Target Servers: ---------------------------------------------------------- Install Window XP 2002 with Service

Pack 3 - Install VC++ 2005 SP1 redistributable package - Install Oracle Database 10g Release 2 - Set ORACLE_HOME and ORACLE_SID environment variables e.g. - Enable logging at database level - Check if database tables have same structure on both Source and Target Databas e and Primary key constraints are enabled. - Download Golden Gate 32bit for Oracle 10g, Unzip it in a location with no spac es in its path - Run Golden Gate and Create subdirectories with Golden Gate - Write Manager Process name in GLOBAL Parameter File - Write port number in Manager Parameter File - Run Manager Process

Actions that must be done only on Source Server: ---------------------------------------------- Register the source tables in Golden Gate Actions to Insert all the records from Source Tables to Target empty Tables thro ugh Golden Gate: --------------------------------------------------------------------------------------------On Source Server: ----------------- Add an Extract Group - Create Extract Parameter File - Write Extraction commands in Extract Parameter File On Target Server: ----------------- Add a Replicate Group - Create Replicate Parameter File - Write Replication commands in Replicate Parameter File Start Data Population from Source to Target: -------------------------------------------- Run Manager Process on both Source and Target (If not Running already) - Start Extrcation on Source - Start Replication on Target

Actions to Simulate only all the changes made in Source Tables into the Target T ables through Golden Gate: -----------------------------------------------------------------------------------------------------On Source Server: -----------------

Add an Extract Group Create Extract Parameter File Write Extraction commands in Extract Parameter File Add Remote (Target) Trail

On Target Server: ----------------Add Checkpoint table in GLOBALS Parameter File Add Checkpoint table in Database from Golden Gate Add a Replicate Group Create Replicate Parameter File Write Replication commands in Replicate Parameter File

Start Data Population from Source to Target: -------------------------------------------- Run Manager Process on both Source and Target (If not Running already) - Start Extrcation on Source - Start Replication on Target

---------------------------------------------------------DML Replication process through Golden Gate is done in two STEPS: 1. In first step Insert all the records from Source Tables to Target empty Table s through Golden Gate 2. In second step Simulate only all the changes made in Source Tables into the Ta rget Tables through Golden Gate Note: Both steps are independent of each other, so h of these steps or either of the both. With First step of Second step and with Second step you can not ep. If you want to implement both steps then you first and then implement second Step you may need to implement bot you can not achieve the goals achieve the goals of first st must implement First Step in

Regardless which STEP you are implementing, some actions are necessary and some depends on the STEP you are implementing Actions that must be done on both Source and Target Servers: ---------------------------------------------------------1. 2. 3. 4. Install Window XP 2002 with Service Pack 3 Install VC++ 2005 SP1 redistributable package Install Oracle Database 10g Release 2 Set ORACLE_HOME and ORACLE_SID environment variables e.g. ORACLE_HOME = C:\Installed\MYDB10g ORACLE_SID = MYDB10G 5. Enable logging at database level as follows SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

SQL> ALTER SYSTEM SWITCH LOGFILE; 6. Check if database tables have same structure on both Source and Target Databa se and Primary key constraints are enabled. 7. Download Golden Gate 32bit for Oracle 10g and Unzip it in a location that con tains no spaces in its path e.g C:\GGATE OR C:\MYGATE me> 8. Run Golden Gate and Create subdirectories with Golden Gate (a). From Command Prompt (DOS Prompt) change the directory to GGATE e.g C:\GGATE> (b). Run Golden Gate as follows: C:\GGATE>ggsci.exe (c). Create subdirectories with Golden Gate as follows: GGSCI (haris) 1> CREATE SUBDIRS Note: Where "GGSCI (haris) 1>" is the Golden Gate Prompt after executing ggsci.exe file 9. Write Manager Process name in GLOBAL Parameter File (a). Edit GLOBAL Parameter file as follows: GGSCI (haris) 2> EDIT PARAMS ./GLOBALS (b). Write Manager Process name in GLOBAL Parameter File MGRSERVNAME GGSRCMGR Name with no spaces in it> OR MGRSERVNAME <Any Eight (8) character OR C:\<any directory with no spaces in its na

Note: Manager Process names should be different on Source and Target Ser vers. Save and the changes and close the file and exit from Golden Gate Prompt and Run Golden Gate (ggsci.exe) again to makes changes in GLOBAL Parameter file effective 10. Write port number in Manager Parameter File (a). Edit Manager Parameter File as follows: EDIT PARAMS MGR (b). Write port number in Manager Parameter File PORT 9500 Note this is the port on which Golden Gate Manager Process will be liste ning 11. Run Manager Process as follows

GGSCI (haris) 3> START MGR Action that must be done only on Source Server: ---------------------------------------------11. Register the source tables in Golden Gate (a). Get login to Source Database from Golden Gate Prompt as follows: GGSCI (haris) 3> dblogin userid src, password src Note: Where src is the name/password of Source Databse User (b). Register the source tables in Golden Gate GGSCI (haris) 4> add trandata src.dept GGSCI (haris) 4> add trandata src.emp OR GGSCI (haris) 4> add trandata src.* Note: Where src is the source schema name, and dept and emp as tables in that schema

Actions to Insert all the records from Source Tables to Target empty Tables thro ugh Golden Gate: --------------------------------------------------------------------------------------------On Source Server: ----------------1. Add an Extract Group as follows GGSCI (haris) 7> ADD EXTRACT EXTFULL, SOURCEISTA BLE 2. Create an Extract Parameter File as follows GGSCI (haris) 8> EDIT PARAMS EXTFULL 3. Write following in the newly created Extract Parameter File --- GoldenGate Initial Data Capture -- for SRC.DEPT -EXTRACT EXTFULL USERID SRC, PASSWORD SRC RMTHOST localhost, MGRPORT 9501 RMTTASK REPLICAT, GROUP REPFULL TABLE SRC.DEPT; TABLE SRC.EMP;

Where: - EXTFULL is the name of extraction group that w e created in step 7 (GGSCI (haris) 7>) - SRC is the name of source database schema and password - RMTHOST localhost is the name of Target Golden Gate Host, in my case both source and targets were on same machine so i wrote l ocalhost - MGRPORT 9501 is port on which Target Golden Ga te is listening. - GROUP REPFULL is the name of Target Replicate group (On source we create Exraction group and on target we create Replicate gro up) On Target Server: ----------------1. Add a Replicate Group as follows GGSCI (tharis) 5> ADD REPLICAT REPFULL, SPECIALR UN 2. Create Replicate Parameter File GGSCI (tharis) 6> EDIT PARAMS REPFULL 3. Write Replication commands in Replicate Parameter File --- GoldenGate Initial Load Delivery -REPLICAT REPFULL ASSUMETARGETDEFS USERID TGT, PASSWORD TGT DISCARDFILE ./dirrpt/REPFULL.dsc, PURGE MAP SRC.*, TARGET TGT.*; Start Data Population from Source to Target: -------------------------------------------1. Run Manager Process on both Source and Target (If not Running already) GGSCI (haris) 3> START MGR 2. Start Extrcation on Source GGSCI (haris) 9> START EXTRACT EXTFULL 3. Start Replication on Target GGSCI (haris) 9> START REPLICAT REPFULL Note: This step is optional. When you start Extraction, Repli cation is done automatically

Actions to Simulate only all the changes made in Source Tables into the Target T ables through Golden Gate: -----------------------------------------------------------------------------------------------------On Source Server: ----------------1. Add an Extract Group as follows GGSCI (haris) 9> ADD EXTRACT EXTCHG, TRANLOG, BEGIN NOW, THREADS 1 2. Create Extract Parameter File as follows GGSCI (haris) 9> EDIT PARAM EXTCHG 3. Write Extraction commands in Extract Parameter File --- Change Capture parameter file to capture -- TCUSTMER and TCUSTORD Changes( where TT=Trail for Tar get by farooq any name of two characters can be here) -EXTRACT EXTCHG USERID SRC, PASSWORD SRC RMTHOST localhost, MGRPORT 9501 RMTTRAIL ./dirdat/TT TABLE SRC.DEPT; TABLE SRC.EMP; - Where EXTCHG is the name of Extract Group that you hav e already created - RMTHOST localhost mean name of Target Server (In my ca se both Source and Target are on same machine so I wrote localhost - MGRPORT 9501 is the port on which Target Golden Gate i s listening - RMTTRAIL ./dirdat/TT is location and name of Remote Tr ail - TT is the name of Remote Trail File and ./dirdat/ is t he location of Remote Trail (Target Trail) - Where Remote Trail location and name must be same when you create Replicate Group on Target 4. Add Remote (Target) Trail as follows GGSCI (haris) 9> ADD RMTTRAIL ./dirdat/TT, EXTRACT EXTCH G, MEGABYTES 5

On Target Server: ----------------1. Add Checkpoint table in GLOBALS Parameter File

(a). Edit GLOBALS Parameter File as follows GGSCI (haris) 9> EDIT PARAMS ./GLOBALS (b). Add following line in GLOBALS Parameter File CHECKPOINTTABLE TGT.ggschkpt Where TGT is the Target Schema and ggschkpt is the name of checkpoint table, You can write any name instead of ggschkpt (c). When you made changes in GLOBALS file then you have to get exit from Golden Gate to make changes effective. So EXIT at G olden Gate prompt GGSCI (tharis) 3> EXIT 2. Add Checkpoint table in Database from Golden Gate (a). Get login to Source Database from Golden Gate Promp t as follows: GGSCI (tharis) 1> DBLOGIN USERID TGT, PASSWORD TGT (b). Add Checkpoint table in Target Database as follows GGSCI (tharis) 2> ADD CHECKPOINTTABLE 3. Add a Replicate Group GGSCI (tharis) 2> ADD REPLICAT REPCHG, EXTTRAIL ./dirda t/TT 4. Create Replicate Parameter File EDIT PARAM REPCHG 5. Write Replication commands in Replicate Parameter File

--- Change Delivery parameter file to apply -- DEPT Changes -REPLICAT REPCHG USERID TGT, PASSWORD TGT HANDLECOLLISIONS ASSUMETARGETDEFS DISCARDFILE ./dirrpt/REPCHG.DSC, PURGE MAP SRC.DEPT, TARGET TGT.DEPT;

Start Data Population from Source to Target: -------------------------------------------1. Run Manager Process on both Source and Target (If not Running already) GGSCI (haris) 3> START MGR 2. Start Extrcation on Source GGSCI (haris) 4> START EXTRACT EXTCHG GGSCI (haris) 5> SEND EXTRACT EXTCHG, REPORT

3. Start Replication on Target by simulating changes on Target S erver GGSCI (tharis) 4> START REPLICAT REPCHG GGSCI (tharis) 4> SEND REPLICAT REPCHG, REPORT

Você também pode gostar