I. Installation conditions
1. Prerequisites:
1). the source and target Oracle Database listening starts.
2). gg installation directory:/u01/app/ogg
3) The copied table must have a primary key.
4) check whether the extraction log directory configured by the process is valid. If the Process configuration is correct,
Directory inconsistency may cause the replication to fail.
5). Operating System
Rhel 5.4X64 (2.6.18-164. el5)
LANG = en_US.UTF-8
Database Software
Oracle 11.2.0.3.0 _ X64
Database Language and Character Set:
NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK"
NLS_LANGUAGE = "AMERICAN"
NLS_TERRITORY = "AMERICA"
NLS_CHARACTERSET = "ZHS16GBK"
Goldengate Software
Ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip
6) host information
Source: 192.168.100.5 linux1
Target: 192.168.100.6 linux2
2. directory permission
Chown-R oracle. oinstall/u01/app/ogg
Chmod-R 775/u01/app/ogg
3. Set Environment Variables
LD_LIBRARY_PATH, PATH
Add at the end of the oracle user environment file
Su-oracle
Vi. bash_profile
# User specific environment and startup programs
Export ORACLE_BASE =/u01/app/oracle -- oracle base Directory
Export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/dbhome_1 -- Oracle Home Directory
Export ORACLE_SID = oradb1 -- Oracle SID
Export PATH = $ PATH: $ HOME/bin: $ ORACLE_HOME/bin -- Oracle PATH directory
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib -- Oracle Share LIB directory
Export LD_LIBRARY_PATH =/u01/app/ogg: $ LD_LIBRARY_PATH -- gg Share LIB directory
Export PATH =/u01/app/ogg: $ PATH -- gg PATH directory
Alias gg = "cd/u01/app/ogg;./ggsci" -- command alias
4. gg directory Initialization
Su-oracle
Gg
GGSCI (linux1) 1> create subdirs
GGSCI (linux1) 2> exit
5. PROCESS DISTRIBUTION
1) source:
Mgr management process
Ep01 Extraction Process
Dp01 shipping process
2) target:
Mgr management process
Rp01 application process
Ii. source Database Configuration
1. Archive Mode
View Archives
Archive log list;
Non-Archive Processing
Shutdown immediate
Startup mount
Alter database archivelog;
Alter database open;
Archive log list;
2. Force log
Database open status
Alter database force logging;
Select force_logging from v $ database;
The output is yes.
Change the log file after Archiving
Alter system switch logfile;
3. Add logs
Alter database add supplemental log data;
Select supplemental_log_data_min from v $ database;
4. Disable the recycle bin.
To use DDL replication in goldengate 10, disable the recycle bin,
Goldengate 11 is no longer required
10.1
Alter system set "recyclebin" = false;
10.2
Alter system set recyclebin = off;
5. Create gg users and grant permissions
Create tablespace tbs_gg datafile '/u01/app/oracle/ogg1.dbf' size 50 m;
Create user ogg identified by ogg default tablespace tbs_gg;
Grant connect, resource to ogg;
Grant dba to ogg;
Create Test Users and tables
Create user user1 identified by user1;
Grant connect, resource to user1;
Conn user1/user1
Create table table1 (id number, name varchar2 (100 ));
6. GoldenGate settings
1) Add a checkpoint
Su-oracle
Gg
GGSCI (linux1) 8> dblogin userid ogg, password ogg
GGSCI (linux1) 9> add checkpointtable ogg. checkpoint
GGSCI (linux1) 10> edit params./GLOBALS
Checkpointtable ogg. checkpoint
2) configure the manager Process
GGSCI (linux1) 11> edit params mgr
Port 7809
Dynamicportlist 7810-7830
Purgeoldextracts/u01/app/ogg/dirdat/lt *, usecheckpoints, minkeepdays 7, minkeepfiles 20
Save and exit
Start mgr
3) configure the extract process
GGSCI (linux1) 4> edit params ep01
Extract ep01
Userid ogg, password ogg
Exttrail/u01/app/ogg/dirdat/lt
Table user1.table1;
Save and exit
Add extract ep01, tranlog, begin now
Add exttrail/u01/app/ogg/dirdat/lt, extract ep01, megabytes 20
Start ep01
5) configure the pump Process
GGSCI (linux1) 8> edit params dp01
Extract dp01
Passthru
Rmthost 192.168.100.6 and mgrport 7809
Rmttrail/u01/app/ogg/dirdat/rt
Table user1.table1;
Save and exit
Add extract dp01, exttrailsource/u01/app/ogg/dirdat/lt
Add rmttrail/u01/app/ogg/dirdat/rt, extract dp01, megabytes 20
Start dp01
Iii. target database
1. Create users and tables
Create tablespace tbs_gg datafile '/u01/app/oracle/ogg1.dbf' size 50 m;
Create user ogg identified by ogg default tablespace tbs_gg;
Grant connect, resource to ogg;
Grant dba to ogg;
Create Test Users and tables
Create user user1 identified by user1;
Grant connect, resource to user1;
Conn user1/user1
Create table table1 (id number, name varchar2 (100 ));
2. Configuration Management Process
GGSCI (linux2) 6> edit params mgr
Port 7809
Dynamicportlist 7810-7830
Purgeoldextracts/u01/app/ogg/dirdat/rt *, usecheckpoints, minkeepdays 7, minkeepfiles 20
Save and exit
Start mgr Process
GGSCI (linux2) 25> start mgr
3. Configure the replicate Process
1) edit the replicate Configuration
GGSCI (linux2) 26> edit params rp01
Replicat rp01
SETENV (NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK ")
Userid ogg, password ogg
Dboptions suppresstriggers
Assumetargetdefs
Map user1.table1, target user1.table1;
Save and exit
2) Add a checkpoint
GGSCI (linux2) 13> dblogin userid ogg, password ogg
GGSCI (linux2) 14> add checkpointtable ogg. checkpoint
GGSCI (linux2) 11> edit params./GLOBALS
Checkpointtable ogg. checkpoint
3) Add a replicat Process
GGSCI (linux2) 15> add replicat rp01, exttrail/u01/app/ogg/dirdat/rt, begin now, CHECKPOINTTABLE ogg. checkpoint
Start rp01 Process
GGSCI (linux2) 16> start rp01
DML insertion Test
This article is from the "yiyi" blog, please be sure to keep this source http://heyiyi.blog.51cto.com/205455/1294264