top of page

Install Oracle 12c Golden Gate on Oracle Linux

In this comprehensive blog post, we guide you through the step-by-step process to install Oracle 12c Golden Gate on Oracle Linux 6.5, empowering you to establish robust data replication with precision and ease.

Below is our high level Golden Gate configuration setup between prod and dev

install oracle 12c golden gate on oracle linux - oracle 12c golden gate

Virtual Machine Setup


Create two virtual machines in VirtualBox as per below configurations

install oracle 12c golden gate on oracle linux - virtual machine setup

Disable firewall on both machines

/etc/rc.d/init.d/iptables status
/etc/rc.d/init.d/iptables stop
service iptables stop
chkconfig iptables off
echo 0 > /selinux/enforce

Update /etc/hosts file on both server, update your IP address for both machines

192.168.0.166 ggprod
192.168.0.167 ggdev

Update YUM repository on both servers

yum -y update

Install Oracle 12c pre-install package which will complete all the pre-requisites

yum -y install oracle-rdbms-server-12cR1*

Change the password for Oracle user on both server

passwd oracle

Create necessary directories for Oracle 12c software installation on both servers

mkdir -p /u01 /u02
chmod -R 775 /u01 /u02
chown -R oracle:oinstall /u01 /u02


Install Oracle 12c Database


Now we are going to install Oracle 12c R1 database software on both virtual machines.


Oracle Database Software: 12.1.0.2


Copy the 12c installation zip files on both the servers under /u02.

GGPROD

install oracle 12c database - oracle database software

GGDEV

install oracle 12c database - oracle database software

Install 12c on GGPROD and create proddb database: Use below options to install Oracle 12c on GGPROD server

  1. Installation option: Install database software only

  2. Single instance database installation

  3. Enterprise Edition

  4. Oracle Base: /u01/app/oracle

  5. Software Location: /u01/app/oracle/product/12.1.0/dbhome_1

  6. Inventory Directory: /u01/app/oraInventory

  7. oraInventory Group Name: oinstall

  8. Operating system groups: dba (set all to dba)

  9. Proceed to install the database software

Set the environment variables, Start DBCA and create proddb database with below options

Set below under bash profile:
export ORACLE_SID=proddb
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/bin
  1. Database Option: Create Database

  2. Creation Mode: Advanced Mode

  3. Database Template: General Purpose

  4. Database SID: proddb (Container Database – uncheck / disabled)

  5. Management Options: All options unchecked

  6. Database Credentials: Provide sys user password

  7. Listener Configuration: Uncheck (we will configure listener manually)

  8. Storage Locations: a. User common locations for all database files b. Enable FRA with 20 GB size c. Enable archiving

  9. Database Options: Check Sample Schemas

Install 12c on GGDEV and create devdb database: User below option to install Oracle 12c on GGDEV server

  1. Installation option: Install database software only

  2. Single instance database installation

  3. Enterprise Edition

  4. Oracle Base: /u01/app/oracle

  5. Software Location: /u01/app/oracle/product/12.1.0/dbhome_1

  6. Inventory Directory: /u01/app/oraInventory

  7. oraInventory Group Name: oinstall

  8. Operating system groups: dba (set all to dba)

  9. Proceed to install the database software

Set the environment variables, Start DBCA and create devdb database with below options

Set below under bash profile:
export ORACLE_SID=devdb
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/bin
  1. Database Option: Create Database

  2. Creation Mode: Advanced Mode

  3. Database Template: General Purpose

  4. Database SID: proddb (Container Database – uncheck / disabled)

  5. Management Options: All options unchecked

  6. Database Credentials: Provide sys user password

  7. Listener Configuration: Uncheck (we will configure listener manually)

  8. Storage Locations: a. User common locations for all database files b. Enable FRA with 20 GB size c. Enable archiving

  9. Database Options: Do not Check Sample Schemas (we will replication sample schema from proddb to devdb using golden gate)

  10. Create database



Install Oracle 12c Golden Gate


Our next step is to install Oracle 12c (12.2.0.1) Golden Gate software on both the virtual machines. Download Oracle Golden Gate software and copy the golden gate installation zip files on both the servers under /u02.


Install Golden Gate on GGPROD


Unzip the golden gate zip file

$ cd /u02
$ unzip fbo_ggs_Linux_x64_shiphome.zip

Start installing Golden Gate on GGPROD server

cd fbo_ggs_Linux_x64_shiphome/Disk1
./runInstaller
install oracle 12c golden gate - oracle goldengate for oracle database 12c

Do not start the manager process as we will start it later

install oracle 12c golden gate - software location
oracle goldengate installation summary

install oracle 12c golden gate - oracle goldengate installation finish

Add GG_HOME variable to .bash_profile

export GG_HOME=/u01/app/oracle/product/gg
install oracle 12c golden gate - set bash profile

Execute the bash profile OR logout and login again as oracle user

. .bash_profile

Connect to ggsci utility and create golden gate sub directories

cd $GG_HOME
./ggsci
GGSCI> create subdirs GGSCI> exit
install oracle 12c golden gate - create subdirs

Install Golden Gate on GGDEV


Unzip the golden gate zip file

$ cd /u02
$ unzip fbo_ggs_Linux_x64_shiphome.zip

Start installing Golden Gate on GGPROD server

cd fbo_ggs_Linux_x64_shiphome/Disk1
./runInstaller
install golden gate - oracle goldengate for oracle database

Do not start the manager process as we will start it later

install golden gate - oracle goldengate software installation
install golden gate - oracle goldgate summary

install golden gate - oracle goldengate finish installation

Add GG_HOME variable to .bash_profile

export GG_HOME=/u01/app/oracle/product/gg
install golden gate - setup bash_profile

Execute the bash profile OR logout and login again as oracle user

. .bash_profile

Connect to ggsci utility and create golden gate sub directories

cd $GG_HOME
./ggsci
GGSCI> create subdirs GGSCI> exit
install golden gate - create subdirs


Prepare Golden Gate for Replication


Enable supplemental logging: The amount of data written to redo logs by default is not enough for replication. By enabling supplemental logging, database will write more details about transactions in redo log files

On both proddb and devdb:
=========================
select supplemental_log_data_min, force_logging from v$database;
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER DATABASE FORCE LOGGING;
select supplemental_log_data_min, force_logging from v$database;

Enable Golden Gate Replication Parameter: From 12.1.0.2 onwards, there is a new parameter which we need to enable in order to setup replication

SQL > ALTER SYSTEM SET ENABLE_GOLDENGATE_REPLICATION = TRUE;

Create GoldenGate Database User: We need to create a dedicated golden gate user on both source and target databases. The golden gate user on source reads the transactions and the golden gate user on target applies the transactions.


We will create new user with dedicated tablespace in both databases

On proddb:
==========
Create tablespace gg_tbs datafile '/u01/app/oracle/oradata/proddb/gg_tbs01.dbf' size 500M;

Create user ogg identified by ogg default tablespace gg_tbs;

On devdb:
=========
Create tablespace gg_tbs datafile '/u01/app/oracle/oradata/devdb/gg_tbs01.dbf' size 500M;

Create user ogg identified by ogg default tablespace gg_tbs;

Grant admin privileges to ogg user

On both proddb and devdb:
=========================
exec DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE('ogg');
grant DBA to ogg;

Configure and start manager process: While installing golden gate, we did not start the manager process. Let us configure the manager and start it on the source and target

On proddb:
==========
ggsci> edit param mgr

Add the below port number to the file

port 7809

start the manager process

ggsci> start mgr

To view the status of mgr process

ggsci> info mgr

Repeat same steps to configure manager process on devdb and start it

prepare golden gate for replication - start manager process

Enjoy!

Related Posts

Heading 2

Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.

bottom of page