• Arun Kumar

Install Oracle 12c Golden Gate on Oracle Linux

In this article we will look at the steps to install oracle 12c Golden Gate on Oracle Enterprise Linux 6.5. The steps involved are


Virtual Machine Setup


To proceed with golden gate lab practice, create two virtual machines in VirtualBox as per below configurations

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

Partitions created while installing OEL 6.5

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

Note: To learn how to install OEL 6.5, complete the free video course –


https://oraclegenesis.com/p/foundation-for-dba


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

Once your machines are ready, complete below pre-requisites on both. 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 at the end of the file.

Do not delete the first two lines in the file

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.166 ggprod
192.168.0.167 ggdev

Perform update for all yum repository on both server. This command will take 20-30 min.

yum -y update

Install Oracle 12c pre-install package which will complete all the pre-requisites for us on both servers

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 Golden Gate software on both the virtual machines.


Oracle Golden Gate Software: 12.2.0.1


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 install product
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

Create Golden Gate sub directories: Connect to ggsci utility and create golden gate sub directories

cd $GG_HOME
./ggsci
GGSCI> create subdirs GGSCI> exit

Output

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 install product
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

Create Golden Gate sub directories: Connect to ggsci utility and create golden gate sub directories

cd $GG_HOME
./ggsci
GGSCI> create subdirs GGSCI> exit

Output

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 5
00M;
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;

Create sbdirs


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


1,927 views

Recent Posts

See All