Install Oracle 12c Golden Gate on Oracle Linux
Step-by-step guide to install GoldenGate 12c 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
Virtual Machine Setup
Create two virtual machines in VirtualBox as per below configurations
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
GGDEV
Install 12c on GGPROD and create proddb database: Use below options to install Oracle 12c on GGPROD server
Installation option: Install database software only
Single instance database installation
Enterprise Edition
Oracle Base: /u01/app/oracle
Software Location: /u01/app/oracle/product/12.1.0/dbhome_1
Inventory Directory: /u01/app/oraInventory
oraInventory Group Name: oinstall
Operating system groups: dba (set all to dba)
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
Database Option: Create Database
Creation Mode: Advanced Mode
Database Template: General Purpose
Database SID: proddb (Container Database – uncheck / disabled)
Management Options: All options unchecked
Database Credentials: Provide sys user password
Listener Configuration: Uncheck (we will configure listener manually)
Storage Locations: a. User common locations for all database files b. Enable FRA with 20 GB size c. Enable archiving
Database Options: Check Sample Schemas
Install 12c on GGDEV and create devdb database: User below option to install Oracle 12c on GGDEV server
Installation option: Install database software only
Single instance database installation
Enterprise Edition
Oracle Base: /u01/app/oracle
Software Location: /u01/app/oracle/product/12.1.0/dbhome_1
Inventory Directory: /u01/app/oraInventory
oraInventory Group Name: oinstall
Operating system groups: dba (set all to dba)
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
Database Option: Create Database
Creation Mode: Advanced Mode
Database Template: General Purpose
Database SID: proddb (Container Database – uncheck / disabled)
Management Options: All options unchecked
Database Credentials: Provide sys user password
Listener Configuration: Uncheck (we will configure listener manually)
Storage Locations: a. User common locations for all database files b. Enable FRA with 20 GB size c. Enable archiving
Database Options: Do not Check Sample Schemas (we will replication sample schema from proddb to devdb using golden gate)
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
Do not start the manager process as we will start it later
Add GG_HOME variable to .bash_profile
export GG_HOME=/u01/app/oracle/product/gg
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 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
Do not start the manager process as we will start it later
Add GG_HOME variable to .bash_profile
export GG_HOME=/u01/app/oracle/product/gg
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
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
Enjoy!