Oracle GoldenGate Installation

Introduction

This document describes how to Install GoldenGate 11.2.1.0.1 for one way replication with sequence and DDL support.

Environment

Source Database Server

Server Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
Database version is 11.2.0.2
Hostname is server1

Target Database Server

Server Solaris 5.11
Database version is 11.2.0.3
Hostname is server2

GoldenGate Software Downloads

Based on your environment, download the proper version of GoldenGate and copy it over to source and target servers. Downloads an be found on Oracle’s website.

GoldenGate Installation on Source Server

Unzipping the Software

Login to the source server as the Oracle software owner, usually oracle, and copy the downloaded software to the golden_gate directory shown below.

> cd /u01/app/oracle/product/golden_gate
> unzip ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip

Archive: ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip
inflating: fbo_ggs_Linux_x64_ora11g_64bit.tar
inflating: OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf
inflating: Oracle GoldenGate 11.2.1.0.1 README.txt
inflating: Oracle GoldenGate 11.2.1.0.1 README.doc

> tar -xf fbo_ggs_Linux_x64_ora11g_64bit.tar

Environment Settings

Add the following lines to $HOME/.bash_profile, or whatever file is used to set oracle’s environment when logging into the server.

export PATH=$GG_HOME:$PATH
export LD_LIBRARY_PATH=$GG_HOME:$LD_LIBRARY_PATH
export GG_HOME=/u01/app/oracle/product/golden_gate

Source the file to set your current environment.

> . .bash_profile

Installation

After setting your environment, you can then login to ggsci and install the GoldenGate software

> cd /u01/app/oracle/product/golden_gate
> ggsci
GGSCI> create subdirs

Creating subdirectories under current directory /u01/app/oracle/product/golden_gate
Parameter files /u01/app/oracle/product/golden_gate/dirprm: already exists
Report files /u01/app/oracle/product/golden_gate/dirrpt: created
Checkpoint files /u01/app/oracle/product/golden_gate/dirchk: created
Process status files /u01/app/oracle/product/golden_gate/dirpcs: created
SQL script files /u01/app/oracle/product/golden_gate/dirsql: created
Database definitions files /u01/app/oracle/product/golden_gate/dirdef: created
Extract data files /u01/app/oracle/product/golden_gate/dirdat: created
Temporary files /u01/app/oracle/product/golden_gate/dirtmp: created
Stdout files /u01/app/oracle/product/golden_gate/dirout: created

GGSCI> exit

Create Database User in Source Database

> sqlplus / as sysdba

SQL> CREATE USER GGATE
IDENTIFIED BY ggate
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
ACCOUNT UNLOCK;

SQL> ALTER USER GGATE DEFAULT ROLE ALL;

SQL> GRANT UNLIMITED TABLESPACE TO GGATE;

Here are the privileges required for the GoldenGate Extract process.

SQL> grant create session to ggate;

SQL> grant alter session to ggate;

SQL> grant resource to ggate;

SQL> grant connect to ggate;

SQL> grant select any dictionary to ggate;

SQL> grant flashback any table to ggate;

SQL> grant select any table to ggate;

SQL> grant select on dba_clusters to ggate;

SQL> grant execute on dbms_flashback to ggate;

SQL> grant select any transaction to ggate;

Enabling Database-Level Supplemental Logging

GGSCI provides commands to configure the source database to log the appropriate key

values whenever it logs a row change, so that they are available to Oracle GoldenGate in

the redo record. By default, the Oracle database only logs column values that are changed.

The appropriate command must be issued before you start Oracle GoldenGate processing.

Because redo volume is increased as the result of logging key values, you might want to

wait until just before you start Oracle GoldenGate processing to enable the logging.

Otherwise, you can issue them any time before processing starts.

SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

SQL> ALTER SYSTEM SWITCH LOGFILE;

Verify that supplemental logging is enabled at the database level with this command :

SQL> SELECT SUPPLEMENTAL_LOG_DATA_MIN FROM V$DATABASE;

The output must be YES or IMPLICIT.

Create the GLOBALS file

> cd $GG_HOME

> ggsci

GGSCI> edit params ./GLOBALS
-- DDL support
GGSCHEMA ggate

Exit out of the editor when done.

Enabling Sequence Support

Oracle GoldenGate ensures that the target sequence values will always be higher than

those of the source (or equal to them, if the cache is 0).

The following SQL script will prompt for a username; enter ggate at the prompt.

> sqlplus / as sysdba

SQL> @sequence

SQL> alter table sys.seq$ add supplemental log data (primary key) columns;

Enabling DDL Support

The following SQL scripts will prompt for a username; enter ggate at the prompt.

> sqlplus / as sysdba

SQL> grant execute on utl_file to ggate;

SQL> @marker_setup

SQL> @ddl_setup

SQL> @role_setup

SQL> GRANT GGS_GGSUSER_ROLE TO ggate;

SQL> @ddl_enable

Configure the MGR File

GGSCI> edit params mgr

port 7809
userid ggate@SID1, password ggate

Exit out of the editor when done. Then, start the manager process.

GGSCI> start mgr

GoldenGate Installation on Target Server

Unzipping the Software

Login to the source server as the Oracle software owner, usually oracle, and copy the downloaded software to the golden_gate directory shown below.

> cd /u01/app/oracle/product/golden_gate
> unzip ogg112101_fbo_ggs_Solaris_sparc_ora11g_64bit.zip

Archive: ogg112101_fbo_ggs_Solaris_sparc_ora11g_64bit.zip
inflating: fbo_ggs_Solaris_sparc_ora11g_64bit.tar
inflating: OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf
inflating: Oracle GoldenGate 11.2.1.0.1 README.txt
inflating: Oracle GoldenGate 11.2.1.0.1 README.doc</pre>

> tar -xf fbo_ggs_Solaris_sparc_ora11g_64bit.tar

Environment Settings

Add the following lines to $HOME/.bash_profile, or whatever file is used to set oracle’s environment when logging into the server.

export PATH=$GG_HOME:$PATH
export LD_LIBRARY_PATH=$GG_HOME:$LD_LIBRARY_PATH
export GG_HOME=/u01/app/oracle/product/golden_gate

Source the file to set your current environment.

> . .bash_profile

Installation

After setting your environment, you can then login to ggsci and install the GoldenGate software

> cd /u01/app/oracle/product/golden_gate
> ggsci
GGSCI> create subdirs

Creating subdirectories under current directory /u01/app/oracle/product/golden_gate
Parameter files /u01/app/oracle/product/golden_gate/dirprm: already exists
Report files /u01/app/oracle/product/golden_gate/dirrpt: created
Checkpoint files /u01/app/oracle/product/golden_gate/dirchk: created
Process status files /u01/app/oracle/product/golden_gate/dirpcs: created
SQL script files /u01/app/oracle/product/golden_gate/dirsql: created
Database definitions files /u01/app/oracle/product/golden_gate/dirdef: created
Extract data files /u01/app/oracle/product/golden_gate/dirdat: created
Temporary files /u01/app/oracle/product/golden_gate/dirtmp: created
Stdout files /u01/app/oracle/product/golden_gate/dirout: created

GGSCI> exit

Create Database User in Target Database

> sqlplus / as sysdba

SQL> CREATE USER GGATE
IDENTIFIED BY ggate
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
ACCOUNT UNLOCK;

SQL> ALTER USER GGATE DEFAULT ROLE ALL;

SQL> GRANT UNLIMITED TABLESPACE TO GGATE;

Here are the privileges required for the GoldenGate Replicat process.

SQL> grant create session to ggate;

SQL> grant alter session to ggate;

SQL> grant resource to ggate;

SQL> grant connect to ggate;

SQL> grant select any dictionary to ggate;

SQL> grant select any table to ggate;

-- ddl support

SQL> grant create table to ggate;

SQL> grant create any table to ggate;

SQL> grant lock any table to ggate;

SQL> grant execute on utl_file to ggate;

– the following can be done at a later time when the target tables are know

SQL> grant insert,update,delete on [ALL TARGET TABLES]

Add Checkpoint Table

> cd $GG_HOME
> ggsci
GGSCI> dblogin userid ggate, password ggate
GGSCI> add checkpointtable ggate.checkpoint

Create the GLOBALS file

> cd $GG_HOME
> ggsci
GGSCI> edit params ./GLOBALS

-- DDL support
GGSCHEMA ggate
CHECKPOINTTABLE ggate.checkpoint

Exit out of the editor when done.

Configure the MGR File

GGSCI> edit params mgr

port 7809
userid ggate@SID2, password ggate

Exit out of the editor when done, then start the manager process.

GGSCI> start mgr

This completes the GoldenGate Software Installation.

The software is now ready to be used for replication.

Advertisements

4 thoughts on “Oracle GoldenGate Installation

  1. Pingback: GoldenGate Integrated Capture | Rick Miners' Oracle Blog

  2. Pingback: Using GoldenGate on the Oracle Database File System ( DBFS ) | Rick Miners' Oracle Blog

  3. Hi,
    we plan to replicate several databases from different servers to a one server.
    So, we would use the same installed goldengate software directory on the target and the same manager for those replications but different checkpoint tables.
    For each database, I plan to use a different GG user name, but, I notice that the GLOBALS file accept only one record, so, one GGSHEMA. Can you tell me if we can use one GLOBALS file for different GG users?

    Many thanks for your precious tutorials..

    Faiza

    • More than one checkpoint table can be used, such as to use a different one for each Replicat group, so you do not have to specify it in the GLOBALS file. Also, the GGSCHEMA is for DDL support, so if you use multiple replicat users w/o a capture process, you don’t have to worry about the GLOBALS file.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s