GoldenGate Replication Setup Requirements

GOLDENGATE TUTORIAL

Oracle Golden Gate Setup Step By Step

The following prerequisites should be met to prepare an environment for the Goldengate installation. These steps are applicable to both Linux and Windows environments and must be satisfied on both source and target servers.

Related Links
Provision VirtualBox using Pre-Built Developer VMs to test GoldenGate
Adding Disk Storage to Oracle VirtualBox
GoldenGate Binary Download

Goldengate Replication Setup Requirements

Operating System
a. Memory – Ensure that there is enough memory. This will determine the number of GoldenGate processes which be configured on the server.

b. Memory Per Process – Dependent on the size of the transactions and the amount of concurrent transactions in the database. By default one Goldengate extract or replicat process can take up to 8G of memory.

c. Swap space – Configure reasonable swap space in case Goldengate processes swap due to low memory.

d. Disk space – Enough disk space to hold the trail files for the required retention period. As a starting point it could be made approximately the same as the amount of archive logs generated in a specific time period.

Goldengate Software
Download the Oracle Goldengate Media Pack Fusion Middleware Software from the edelivery site. Ensure you have the appropriate software for the source and target based on the Host Operating System and the Database version.

Windows Server
When using a Windows hosts Microsoft Visual C++ 2005 Redistributable software should be installed on the server.

Database
The requirements in this section are for the the source database ONLY.

Archive logging
Enable archiving of logs on the source databases servers, if not already enabled.

Force Logging
Enable force logging at the database level. If you are using Oracle 12c Database however, you can alternatively turn force logging at the tablespace level.

SQL>ALTER DATABASE FORCE LOGGING;
SQL>ALTER SYSTEM SWITCH LOGFILE;

OR
-- 12c only
SQL>ALTER DATABASE NO FORCE LOGGING;
SQL>ALTER TABLESPACE tablespace_name FORCE LOGGING;
SQL>ALTER TABLESPACE tablespace_name NOLOGGING;

Supplemental logging
Enable at the Database level and switch logfile.

SQL>ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
SQL>alter system switch logfile;


Object level supplemental logging
Turn on supplemental logging on the source database. This can be done either using sqlplus or GGSCI command line.

If you are using GGSCI this needs to be done after the GoldenGate Binary has been installed. At the GGSCI prompt, connect to the database run the “ADD TRANDATA” commands below.

At the GGSCI prompt add supplemental logging.

DBLOGIN USERID OGG_USER PASSWORD hsdgeh#die4fsG
ADD TRANDATA [schema_name].*
INFO TRANDATA [schema_name].*


Recycle bin
Turn OFF recyclebin, to support DDL replication. This can be done using the command below.

For 11g:ALTER SYSTEM SET RECYCLEBIN=OFF DEFERRED;
For 10g:ALTER SYSTEM SET RECYCLEBIN=OFF;


Primary Keys
Ensure that all tables have Primary or Unique Key. This is one of the MOST important requirement to ensure proper replication of data without discrepancies. If not an alternative method of surrogate keys can be used.

Goldengate User
To support the Oracle Goldengate replication, a user must be created on both source and target databases with the required privileges. This user will be used to extract data and lookup data dictionary information. However before the user is created a new empty table space is required for this user.

SQL>create tablespace GG_TBS datafile '/u01/app/data/gg_ts01.dbf' size 5g;
SQL>create user OGG_USER identified by hsdgeh#die4fsG default tablespace GG_TBS;
SQL> grant CONNECT, RESOURCE, DBA to OGG_USER;

Binary Installation and Setup

First create the directory where GoldenGate will be installed and export the GG_HOME variable.

mkdir /u01/ggs/
export GG_HOME=/u01/ggs/
export PATH=$PATH:$GG_HOME


For 12c use the Oracle User Interface or the silent installation instructions.

For Goldengate 11g unzip and untar the binaries in the home directory on both SOURCE and TARGET.

Make sure you are in the GG_HOME directory.

$cd $GG_HOME
$pwd
$unzip V5165437.zip
$untar ggg-name.tar


Create the subdirectories using the ggsci command.

ggsci>create subdirs

Prepare for DDL Replication

The script below needs to be run on the source database, to create the procedure, trigger and table to capture the DDL statements. In Oracle database 12c, DDL replication does not require any setup of triggers as it is natively supported at the database level. So if you are setting up GoldenGate on a 12c SOURCE database this section can be skipped.

a. Navigate to the directory where the Oracle Goldengate software is installed.

b. Connect to the Oracle database as sysdba.

SQL> sys/password as sysdba


c. For DDL synchronization setup, run the marker_setup.sql script. Provide ‘OGG_USER’ schema name and tablespace name, when prompted.


SQL> @marker_setup.sql

d. Then run the ddl_setup.sql script. Provide the setup detail information below.

SQL> @ddl_setup.sql
Start the installation : yes
Schema Name : OGG_USER
Installation mode : initialsetup


e. Run the role_setup.sql script. Provide ‘OGG_USER’ schema name, when prompted.

SQL> @role_setup.sql

f. Then grant the ggs_ggsuser_role to the OGG_USER.

SQL> grant ggs_ggsuser_role to OGG_USER;


g. Run the ddl_enable.sql & ddl_pin.sql script

SQL> @ddl_enable;
SQL> @ddl_pin OGG_USER;


GoldenGate replication setup requirements completed!

Oracle Golden Gate Basics – Other Articles

GoldenGate Replication Pre-requisites
GoldenGate Manager
GoldenGate Classical Extract
GoldenGate Pump
GoldenGate Replicat
Uni-directional Replication Summary