Introduction: Recently, I often see some posts about Oracle GG implementation cases in forums. It is true that GG does not have a lot of comprehensive information in various forums, especially the real implementation cases are even more rare. In view of this, I will share with you the GG implementation I have done for you today, this article is about "replication between the same databases". If you don't talk much about it, hurry up.
Lab environment: oracle10g + RedHat4 + goldengate
1. Install redhat4
Ii. Steps for installing oracle10g
3. Install goldengate. Be sure to select the correct version.
1. source installation and configuration
1.1 install goldengate
Linux: mkdir/u01/oracle/ggate
Cd/u01/oracle/ggate
Upload the goldengate zip software to/u01/oracle/ggate through ftp
Unzip decompress to generate a tar file
Tar-xvf *. tar
1.2 Configure. bash_profile
Vi. bash_profile
Add:
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/u01/oracle/ggate
Export GGATE_HOME =/u01/oracle/ggate
Note that LD_LIBRARY_PATH can be added after the oracle installation.
Run source ~. /Bash_profile
1.3 create the goldengate directory
Cd/u01/oracle/ggate
./Ggsci (go to The goldengate command line interface)
Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.0.0 Build 078
Linux, x86, 32bit (optimized), Oracle 10 on Jul 28 2010 13:24:18
Copyright (C) 1995,201 0, Oracle and/or its affiliates. All rights reserved
Working in the goldengate command line now
Create subdirs
1.4 configure the database archive mode and enter the SQL command line (if disabled, it is recommended to enable it)
Sqlplus "/as sysdba"
Alter system set log_archive_format = '% s _ % t _ % r. log' scope = spfile;
Alter system set log_archive_dest_1 = 'location =/u02/oracle/arc ';
Shutdown immediate;
Startup mount;
Alter database archivelog;
Enable force log mode: alter database force logging;
Alter database open;
Now you can check whether the archive is up, archive log list
1.5 enable minimal supplemental logging
-- Alter database add supplemental log data; this setting is described in many documents. However, if there is a problem with a non-primary key or a unique index table, it is found that an error occurs during the test, maybe not done well elsewhere!
Alter database add supplemental log data (primary key, unique) columns; this is my configuration!
1.6 disable the recycle bin
Alter system set recyclebin = off scope = spfile;
1.7 configure replication DDL support
Create user authorization:
Create user ggate identified by ggate default tablespace users temporary tablespace temp quota unlimited on users;
Grant connect, resource, dba to ggate;
Grant execute on utl_file to ggate;
Grant restricted session to ggate;
@ $ GGATE_HOME/marker_setup. SQL;
SCHEMA: GGATE
@ $ GGATE_HOME/ddl_setup. SQL;
Select input. Otherwise, a problem may occur!
@ $ GGATE_HOME/role_setup. SQL;
Authorize a role:
Grant GGS_GGSUSER_ROLE to ggate;
@ $ GGATE_HOME/ddl_enable. SQL;
1.8 create source users (users used for synchronization)
Create user sender identified by ggate default tablespace users temporary tablespace temp quota unlimited on users;
Grant dba, connect, resource to ggate;
Grant select on v _ $ session to ggate;