上一篇配置了ogg 基础部分,包括环境准备及数据初始化,采用的是Direct Load Method,
链接:http://chinadm123.blog.51cto.com/3952657/989629
Configure Change Capture
1. Add the Extract group
Execute the following command on the <source> system to add an Extract group
named EORA<unique id>.
GGSCI (ogg1) 20> add extract eorass, tranlog, begin now, threads 1
EXTRACT added.
2. Create the Extract parameter file
Execute the following commands on the <source> system.
GGSCI (ogg1) 22> edit params eorass
EXTRACT EORASS
USERID ggusr, PASSWORD ggusr
RMTHOST 192.168.1.87, MGRPORT 7809
RMTTRAIL ./dirdat/tt
TABLE ggtest.tcustmer;
TABLE ggtest.tcustord;
3. Define the GoldenGate trail
Execute the following command on the <source> to add the trail that will store the
changes on the target.
GGSCI (ogg1) 24> add rmttrail ./dirdat/tt, extract eorass, megabytes 5
RMTTRAIL added.
4. Start the capture process
GGSCI (ogg1) 37> start extract eorass
Sending START request to MANAGER ...
EXTRACT EORASS starting
Verify the results:
GGSCI (ogg1) 38> info extract eorass, detail
GGSCI (ogg1) 39> view report eorass
Configure Change Delivery
Set up the checkpoint table
1. Create a GLOBALS file on the target system
Execute the following commands on the <target> system.
Create and edit the GLOBALS parameter file to add the checkpoint table.
GGSCI (ogg2) 1> edit params ./GLOBALS
CHECKPOINTTABLE ggusr.ggschkpt
2. Activate the GLOBALS parameters
For the GLOBALS configuration to take effect, you must exit the session in which
the changes were made. Execute the following command to exit GGSCI.
GGSCI (ogg2) 4> exit
3. Add a Replicat checkpoint table
On the <target> system, execute the following commands in GGSCI:
GGSCI (ogg2) 1> dblogin userid ggusr, password ggusr
Successfully logged into database.GGSCI (ogg2) 2> add checkpointtable
No checkpoint table specified, using GLOBALS specification (ggusr.ggschkpt)...
Successfully created checkpoint table ggusr.ggschkpt.
Configure Change Delivery
4. Add the Replicat group
Execute the following command on the <target> system to add a delivery group
named RORA<unique id>.
GGSCI (ogg2) 3> add replicat roratt, exttrail ./dirdat/tt
REPLICAT added.
5. Create Replicat parameter file
Execute the following commands on the <target> system to bring up the parameter
file in the editor.
GGSCI (ogg2) 4> edit params roratt
REPLICAT RORATT
USERID ggusr, PASSWORD ggusr
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/RORATT.DSC, PURGE
map ggtest.tcustmer, target ggtest.tcustmer;
map ggtest.tcustord, target ggtest.tcustord;
6. Start the Replicat process
GGSCI (ogg2) 9> start replicat roratt
Sending START request to MANAGER ...
REPLICAT RORATT starting
Verify the results:
GGSCI (ogg2) 12> info replicat roratt
Generate Activity and Verify Results
Generate database operations
1. Execute miscellaneous update, insert, and delete operations
Execute the following commands on the <source> system.
[oracle@ogg1 ogg]$ sqlplus ggtest/ggtest
SQL> @demo_ora_misc.sql
Verify change capture and delivery
2. Verify results on the source system
Execute the following commands on the <source> system.
SQL> select * from tcustmer;
SQL> select * from tcustord;
SQL> exitGenerates an interim statistical report to the Extract report file.
GGSCI (ogg1) 49> send extract eorass, report
GGSCI (ogg1) 50> view report eorass
3. Verify your results on the target system
Execute the following commands on the <target> system to verify the target data.
[oracle@ogg2 ogg]$ sqlplus ggtest/ggtest
SQL> select * from tcustmer;
SQL> select * from tcustord;
SQL> exitGenerates an interim statistical report to the Extract report file.
GGSCI (ogg2) 18> send replicat roratt, report
GGSCI (ogg2) 19> view report roratt
到这里,ogg同步功能已经实现,再来用图来说明一下都配置了哪些部件: