Objective: In the previous article, we learned about the Oracle goldengate Introduction. This document details the installation and configuration of Oracle GoldenGate v11.2.1.0.1 for Oracle 11g on Linux x86-64.
Step1: Installing Database
For Database Installation steps click here
Step2: Download Oracle Goldengate
Download Oracle Goldengate from Oracle website.
click on Download all to start downloading the goldengate file.
Now,
Create a GoldenGate OS user
[root@ggt1 ~]# useradd –G oinstall ggadmin [root@ggt1 ~]# passwd ggadmin Changing password for user ggadmin. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@ggt1 ~]# |
Make the GoldeGate software home
[root@ggt1 ~]# cd /u01/app/oracle [root@ggt1 oracle]# mkdir ggs ggs/11.2.0 [root@ggt1 oracle]# chown -R ggadmin:ggadmin ggs/ |
Set up Oracle Environment for the ggadmin user.
[ggadmin@ggt1 ~]$ cat env11g export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 export ORACLE_SID=ggdb1 export GG_HOME=/u01/app/oracle/ggs/11.2.0 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$GG_HOME:$LD_LIBRARY_PATH export PATH=GG_HOME:$ORACLE_HOME/bin:$PATH |
Copy the GoldenGate software to the GoldenGate software home and uncompress the file.
[ggadmin@ggt1 ~]$ cd $GG_HOME [ggadmin@ggt1 11.2.0]$ cp ~/ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip . [ggadmin@ggt1 11.2.0]$ unzip ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip Archive: ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip inflating: fbo_ggs_Linux_x64_ora11g_64bit.tar inflating: OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf inflating: Oracle GoldenGate 11.2.1.0.1 README.txt inflating: Oracle GoldenGate 11.2.1.0.1 README.doc [ggadmin@ggt1 11.2.0]$ tar xvf fbo_ggs_Linux_x64_ora11g_64bit.tar UserExitExamples/ UserExitExamples/ExitDemo_more_recs/ UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.HPUX UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.SOLARIS UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.LINUX UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.AIX < cut > server sqlldr.tpl tcperrs ucharset.h ulg.sql usrdecs.h zlib.txt |
Next, using GGSCI create the GoldGate working directories.
[ggadmin@ggt1 ~]$ cd $GG_HOME [ggadmin@ggt1 11.2.0]$ ./ggsci Oracle GoldenGate Command Interpreter for Oracle Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14 GGSCI (ggt1.odlabs.net) 1> create subdirs Creating subdirectories under current directory /u01/app/oracle/ggs/11.2.0 Parameter files /u01/app/oracle/ggs/11.2.0/dirprm: already exists Report files /u01/app/oracle/ggs/11.2.0/dirrpt: created Checkpoint files /u01/app/oracle/ggs/11.2.0/dirchk: created Process status files /u01/app/oracle/ggs/11.2.0/dirpcs: created SQL script files /u01/app/oracle/ggs/11.2.0/dirsql: created Database definitions files /u01/app/oracle/ggs/11.2.0/dirdef: created Extract data files /u01/app/oracle/ggs/11.2.0/dirdat: created Temporary files /u01/app/oracle/ggs/11.2.0/dirtmp: created Stdout files /u01/app/oracle/ggs/11.2.0/dirout: created GGSCI (ggt1.odlabs.net) 2> exit |
Create a database user and tables pace for GoldenGate
SQL> create tablespace ogg_data 2 datafile '/u01/app/oracle/oradata/ggdb1/oggdata01.dbf' size 300M; Tablespace created. SQL> create user ogg identified by password 2 default tablespace ogg_data 3 temporary tablespace temp; User created. SQL> |
Next, grant the following privilege to the GoldenGate user.
SQL> grant create session to ogg; Grant succeeded. SQL> grant alter session to ogg; Grant succeeded. SQL> grant select any dictionary to ogg; Grant succeeded. SQL> grant create table to ogg; Grant succeeded. SQL> grant execute on dbms_flashback to ogg; Grant succeeded. SQL> grant flashback any table to ogg; Grant succeeded. SQL> grant select any transaction to ogg; Grant succeeded. SQL> grant select on v_$database to ogg; Grant succeeded. SQL> |
Finally, Oracle GoldenGate requires supplemental logging to be enabled at the database level. You can verify that supplemental logging is enabled at the database level with the following query.
|
SQL> select supplemental_log_data_min 2 from v$database; SUPPLEME -------- NO SQL> |
The output must be YES or IMPLICIT. If the result is NO, as the SYS user, issue the following alter database to enable minimal supplemental logging at the database level. Be sure to switch the log file after adding supplemental logging.
SQL> alter database add supplemental log data; Database altered. SQL> alter system switch logfile; System altered. SQL> select supplemental_log_data_min 2 from v$database; SUPPLEME -------- YES SQL> |