Version:
OS: Enterprise Linux Server release 5.7
Db: Release 10.2.0.1.0
Ogg: Version 11.2.1.0.1
Prepare beforehand (both nodes must be prepared ):
1. Install and start Oracle, upload ogg installation media to/ogg, and decompress
2. Create a ggusr tablespace, create a ggusr user, and authorize
Create a tablespace
SQL> create tablespace ggusr datafile '/s01/oradata/prod1/ggusr01.dbf' size 1000 M autoextend on;
Create user
SQL> create user ggusr identified by ggusr default tablespace ggusr;
Authorization
SQL> grant connect, resource to ggusr;
SQL> grant create session, alter session to ggusr;
SQL> grant select any dictionary, select any table to ggusr;
SQL> grant flashback any table to ggusr;
SQL> grant dba to ggusr;
Here we will also create the test user together:
SQL> create user ggtest identified by ggtest;
SQL> grant connect, resource to ggtest;
3. modify oracle environment variables
In this example, you plan to use oracle users to install ogg. You need to modify the. bash_profile file of oracle.
ORACLE_BASE =/s01
ORACLE_HOME =/s01/oracle/app/product/db_1
ORA_CRS_HOME =/s01/oracle/app/product/crs_1
ORACLE_SID = prod1
PATH = $ PATH: $ HOME/bin: $ ORACLE_HOME/bin: $ ORA_CRS_HOME/bin:/ogg
LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/ogg: $ LD_LIBRARY_PATH ------- the red part is the content to be added, and the/ogg is the installation directory of ogg.
Export PATH ORACLE_BASE ORACLE_HOME ORA_CRS_HOME ORACLE_SID LD_LIBRARY_PATH
4. Install ogg Software
[Oracle @ ogg1 media] $ unzip ogg112101_fbo_ggs_Linux_x86_ora11g_32bit.zip
[Oracle @ ogg1 ogg] $ tar-xvof media/fbo_ggs_Linux_x86_ora11g_32bit.tar
[Oracle @ ogg1 ogg] $ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 oggcore_11.2.1.0.20.platforms_120423.0230_fbo
Linux, x86, 32bit (optimized), Oracle 10g on Apr 23 2012 07:06:02
Copyright (C) 1995,201 2, Oracle and/or its affiliates. All rights reserved.
GGSCI (ogg1) 1> create subdirs
Creating subdirectories under current directory/ogg
Parameter files/ogg/dirprm: already exists
Report files/ogg/dirrpt: created
Checkpoint files/ogg/dirchk: created
Process status files/ogg/dirpcs: created
SQL script files/ogg/dirsql: created
Database definitions files/ogg/dirdef: created
Extract data files/ogg/dirdat: created
Temporary files/ogg/dirtmp: created
Stdout files/ogg/dirout: created
Specific oracle configurations (only on the source side)
1. Enable supplemental logging at the database level
SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
SQL> ALTER SYSTEM SWITCH LOGFILE;
Configure ogg (oracle to oracle)
The overall configuration plan is as follows:
1. Initial Data Import Configuration
There are many ways to initialize data, such as exp/imp and backup/restore. The ogg initialization method is shown here.
Configure Change Capture (on the source side)
Configure the Manager process on the source
[Oracle @ ogg1 ogg] $ ggsci
GGSCI> EDIT PARAMS MGR
Enter the following content in the file and save it:
Port 7809
Start mgr:
GGSCI (ogg1) 4> start mgr
Manager started.
View mgr information:
GGSCI (ogg1) 5> info mgr
Manager is running (IP port ogg1.7809 ).
Create the source tables and load the initial data.
Shell> cd <install location>
Shell> sqlplus ggtest/ggtest
SQL> @ demo_ora_create
SQL> @ demo_ora_insert
Verify the results:
SQL> select * from tcustmer;
SQL> select * from tcustord;
SQL> exit
Add supplemental logging
GGSCI> dblogin userid ggusr, PASSWORD ggusr
GGSCI> add trandata ggtest. TCUSTMER
GGSCI> add trandata ggtest. TCUSTORD
Verify that supplemental logging has been turned on for these tables.
GGSCI> info trandata ggtest. TCUST *
Logging of supplemental redo log data is enabled for table GGTEST. TCUSTMER.
Columns supplementally logged for table GGTEST. TCUSTMER: CUST_CODE.
Logging of supplemental redo log data is enabled for table GGTEST. TCUSTORD.
Columns supplementally logged for table GGTEST. TCUSTORD: CUST_CODE, ORDER_DATE, PRODUCT_CODE, ORDER_ID.
Configure the Manager
Configure the Manager process on the target system
[Oracle @ ogg2 ogg] $ ggsci
GGSCI> EDIT PARAMS MGR
Enter the following content in the file and save it:
Port 7809
Start mgr:
GGSCI (ogg2) 4> start mgr
Manager started.
View mgr information:
GGSCI (ogg2) 7> info mgr
Manager is running (IP port ogg2.7809 ).
Create target Oracle tables
Shell> sqlplus ggusr/ggusr
SQL> @ demo_ora_create
Verify the results:
SQL> desc tcustmer;
SQL> desc tcustord;
SQL> exit
Initial Data Load using Direct Load Method
Initial data capture
1. Add the initial load capture batch task group
Execute the following commands on the <source> system
GGSCI (ogg1) 6> add extract einiss, sourceistable
EXTRACT added.
GGSCI (ogg1) 7> info extract *, tasks
Extract einiss Initialized 2012-09-13 Status STOPPED
Checkpoint Lag Not Available
Log Read Checkpoint Not Available
First Record 0
Task SOURCEISTABLE
2. Configure the initial load capture parameter file
GGSCI> EDIT PARAMS EINISS
Enter the following content:
EXTRACT EINISS
USERID ggusr, PASSWORD "ggusr"
RMTHOST 192.168.1.87 and MGRPORT 7809
Rmttask replicat, GROUP RINITT
TABLE ggtest. tcustmer;
TABLE ggtest. tcustord;
Initial data delivery
3. Add the initial load delivery batch task
Execute the following commands on the <target> system.
GGSCI (ogg2) 9> add replicat rinitt, specialrun
4. Configure the initial load delivery parameter file
GGSCI (ogg2) 9> add replicat rinitt, specialrun
GGSCI (ogg2) 12> view params rinitt
REPLICAT RINITT
ASSUMETARGETDEFS
USERID ggusr, PASSWORD ggusr
DISCARDFILE./dirrpt/RINITT. dsc, PURGE
MAP ggtest. *, TARGET ggtest .*;
5. Execute the initial load process
Execute the following commands on the <source> system.
GGSCI> START EXTRACT EINISS
Verify the results on the <source> system:
GGSCI> VIEW REPORT EINISS
Verify the results on the <target> system:
GGSCI> VIEW REPORT RINITT
On the target side, check whether ggtest. tcustmer and ggtest. tcustord have data:
SQL> conn ggtest/ggtest
Connected.
SQL> select * from tcustmer;
CUST NAME CITY ST
--------------------------------------------------------
Will bg software co. SEATTLE WA
Jane rocky flyer inc. DENVER CO
SQL> select * from tcustord;
CUST ORDER_DAT PRODUCT _ ORDER_ID PRODUCT_PRICE PRODUCT_AMOUNT TRANSACTION_ID
------------------------------------------------------------------------
WILL 30-SEP-94 CAR 144 17520 3 100
JANE 11-NOV-95 PLANE 256 133300 1 100
The initialization is successful.
| [Content navigation] |
| Page 1: Environment configuration and data Initialization |
Page 2: Configure Change Capture and delivery |