I am writing these with the aim of giving other IT professionals some tip in installing this very unique and valuable product from Oracle. When I first integrated this program, I had to go through several sources and made several experiments as not all sources would have the same instance as mine. Make sure you read something about Goldengate first before proceeding. So with the hopes of helping other people, here are my steps in installing Oracle Golden Gate:

Steps taken to install Oracle Database 11G

1. Download Oracle Database 11GR2 and Goldengate from website.
2. Open terminal, switch to root. Perform the following commands
bash> cd /etc/yum.repos.d
bash> wget http://public-yum.oracle.com or http://public-yum.oracle.com/public-yum-ol6.repo (mine worked with the former)
bash> yum install oracle-rdbms-server-11gR2-preinstall

(See reference at the bottom of the page to see the purpose of this package)
3. bash> export DISTR=/home/dba/app/oracle -> shortcut to database directory -> DISTR disappearing when changing user (this is optional but makes things easier)
4. bash unzip linux.zeries64_11gR2_database_1of2.zip and …_2of2.zip
5. cd $DISTR/database and type ./runInstaller -> configured settings using the GUI setup
-> no email
-> Create and configure a database
-> Desktop class
-> Oracle base – /home/dba/app/dba
-> SW – /home/dba/app/dba/product/11.2.0/dbhome_1
-> DB – /home/dba/app/dba/oradata
-> Global database name – orcl
-> oraInventory – dba
-> prompted for missing dependencies -> installed missing dependencies

(In this step, you can pretty much configure the options from the GUI tool but see above for my configuration. You can also see my source from pythian.org, see end of page, to see how he installed everything in one command)

6. At the end of the GUI installation, you may be prompted to install the missing dependencies. Use the command yum list | grep missingdependency to search for that dependency. For example,

bash> yum list | grep unixODBC -> yum install unixODBC-devel.x86_64
-> other missing dependencies are for i386 or i686 systems

In step 6, make sure you check each missing dependency and see if you need them. You’ll notice that some of them refer to specific cpu architecture. Check each dependency on your system if the one with the right architecture is installed. Sometimes, it may say that you haven’t installed the dependency. In my case I already installed unixODBC-devel.x86_64 but it says I haven’t installed unixODBC-devel.x86. If this happens just ignore the prompts for the missing dependencies IF you are sure you have already installed them.

7. Installation
-> executed scripts required by installer using sh (On this part, just follow the prompts from the installer. I used the command sh to install the scripts)
-> installation successful:
Enterprise Manager Database Control URL – (orcl):
https://localhost:1158/em

Next I set up the environmental variables, make sure you point them to the right directory. We may have different directories.
8. export ORACLE_HOME=/home/dba/app/dba/product/11.2.0/dbhome_1
9. export PATH=$ORACLE_HOME/bin:$PATH
10. dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName base11r2 -sysPassword ***** -systemPassword ***** -emConfiguration NONE -datafileDestination /home/dba/app/oracle/oradata -storageType FS (This is to create a sample database)
11. lsnrtctl start (Starts up the listener)

Steps taken to install Oracle GoldenGate

1. Download Oracle GoldenGate 11g
2. extract folder to /home/dba/app/gg (using built-in Archive Manager) -> ogg11 folder created
3. export GGATE=/home/dba/app/dba/product/gg/ogg11 (again, this is optional but may simplify things)
4. tar -xf <goldengate>.tar
5. export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/home/dba/app/dba/product/gg/ogg11 (This is very important, not setting this up will not make ./ggsci work)
6. bash> ./ggsci (This runs goldengate program and you will enter a command console for goldengate)
7. ggsci> create subdirs (This command creates needed folders for goldengate
8. exit

Preparing the replication process
1. verified vi tnsnames.ora (make sure the file exists)
2. export ORACLE_SID=base11r2 (this should refer to the name of the database, see step 10 from Installing Oracle Database)
3. run the shell and type sqlplus / as sysdba then:
a. sqlplus> shutdown immediate
b. sqlplus> startup mount
c. sqlplus> alter database archivelog;
d. sqlplus> alter database open;
e. sqlplus> alter database add supplemental log data;
f. sqlplus> alter system set recyclebin=off scope=spfile;
g. sqlplus> create user ggate identified by qwerty default tablespace users temporary tablespace temp; (user ggate created)
h. sqlplus> grant connect, resource, unlimited tablespace to ggate;
grant execute on utl_file to ggate; (priveleges granted to ggate)

**NOTE: goldengate directory should be located on the same directory for oracle scripts (inside installation of oracle DB)
4. run goldengate scripts inside sqlplus with schema ggate:
a. sqlplus> @$GGATE/marker_setup.sql
b. sqlplus> @$GGATE/ddl_setup.sql
c. sqlplus> @$GGATE/role_setup.sql
d. sqlplus> grant GGS_GGSUSER_ROLE to ggate;
e. sqlplus> @$GGATE/ddl_enable.sql
5. creating test schemas with schema sender to schema receiver
a. sqlplus> create user sender identified by qwerty default tablespace users temporary tablespace temp;
b. sqlplus> grant connect, resource, unlimited tablespace to sender;
c. sqlplus> create user receiver identified by qwerty default tablespace users temporary tablespace temp;
d. sqlplus> grant connect, resource, unlimited tablespace to receiver;

Configuring the processes in goldengate – take note that I am using localhost 127.0.0.1 as both target and source system to demonstrate goldengate
Starting in source system:
1. bash> ./ggsci

ggsci> EDIT PARAMS MGR  (a .prm file will be created, in the file type PORT 7089)
2. ggsci> START MGR

ggsci>  INFO MGR (check if MGR is running)
3. ggsci> ADD EXTRACT INITLOD1, TRANLOG, BEGIN NOW
4. ggsci> ADD EXTTRAIL /home/dba/app/dba/product/gg/ogg11/dirdat/el, extract INITLOD1
5. ggsci> EDIT PARAMS INITLOD1 (A new text file will open for the configuration, input the following)

EXTRACT INITLOD1
USERID ggate, PASSWORD qwerty
RMTHOST localhost, MGRPORT 7089
RMTTRAIL /home/dba/app/dba/product/gg/ogg11/dirdat/el
DDL INCLUDE MAPPED OBJNAME sender.*;
TABLE sender.*;

(Save and close the file.)
Notes: INITLOD1 will be your extract process

For target system:
1. ggsci> EDIT PARAMS ./GLOBAL -> creates checkpoint table
2. ggsci> DBLOGIN USERID GGATE -> login successful
3. ggsci> ADD CHECKPOINTTABLE ggate.checkpoint
4. ggsci> ADD REPLICAT CHGSYNC, EXTTRAIL /home/dba/app/dba/product/gg/ogg11/dirdat/el, checkpointtable ggate.checkpoint
5. ggsci> EDIT PARAMS CHGSYNC (This will be your Replicat process)

REPLICAT CHGSYNC
ASSUMETARGETDEFS
USERID ggate, PASSWORD qwerty DISCARDFILE /home/dba/app/dba/product/gg/ogg11/discard/chgsync_discard.txt, APPEND, MEGABYTES 10

DDL MAP sender.*, TARGET receiver.*;

(Save and close the file.)

6. ggsci> START EXTRACT INITLOD1 and START REPLICAT CHGSYNC

wait for a few seconds and check with INFO ALL, make sure MGR, EXTRACT and REPLICAT are running

CHECKING:

Log in the database with the command sqlplus / as sysdba from the shell:
1. sqlplus> create table sender.test_table1 (id number, rnd_str varchar2(12));
2. sqlplus> insert into sender.test_table1 values (1, ‘test_1’);
3. sqlplus> commit; -> to save transaction
4. sqlplus> select * from receiver.test_table1;

Notes: After you insert a value on the database and commit the transaction in the sender.test_table1, you should be able to see those same values in the receiver.test_table2

SPECIAL THANKS TO THE AUTHOR OF THE FOLLOWING LINKS:

http://www.oracle.com/technetwork/articles/servers-storage-admin/ginnydbinstallonlinux6-1845247.html

http://www.pythian.com/blog/oracle-goldengate-installation-part-1/

Advertisements