Book Image

Instant Oracle GoldenGate

By : Tony Bruzzese
Book Image

Instant Oracle GoldenGate

By: Tony Bruzzese

Overview of this book

Oracle GoldenGate is a comprehensive package for low-impact, real-time data capture, distribution, and delivery of transactional data across heterogeneous systems for continuous availability, zero downtime migration, and disaster recovery. All in all, it is a precise tool for data replication, regardless of the platform that you use in today’s environment. Instant Oracle GoldenGate exemplifies the ease of use of this package through the use of real-world examples. This book gives a good overview and hands-on approach to the most commonly used implementations in an Oracle GoldenGate environment.This How-to book will take you through a number of real-world examples quickly and effectively by eliminating much of the guess work for all users from novices to experienced users. You will learn about the key components of the architecture and simple one-way replication for a number of database tables or an entire schema. You’ll be covering key concepts and the implementation of high availability configurations such as Oracle RAC, encryption, and many different ways to transform and filter data to your target systems.
Table of Contents (7 chapters)

Installing Oracle GoldenGate (Simple)


This recipe will go through the process of downloading and installing OGG on Unix.

Getting ready

You could obtain the OGG software either from http://otn.oracle.com (click on the DOWNLOADS tab, scroll down to the Middleware section, and click on GoldenGate) for trial purposes, or if you have a valid email / password account go to My Oracle Support and buy a license to use OGG, from http://edelivery.oracle.com.

In this example, both source and target environments are of identical configurations. Of course, in real-world examples, there will be mixed platform configurations as well. The configuration used in this example is as follows:

  • Platform: AIX

  • Operating System Version: 6.1

  • Database Version: Oracle 11.2.0.3.0

  • GoldenGate Version: 11.2.1.0.1

How to do it...

Steps for installing Oracle GoldenGate on the source host are as follows:

  1. Log in to the source host as the "oracle" user.

  2. Create an installation directory to host the OGG binaries. I'm using a sandbox; ideally, you'll have a specific mount point for OGG. We do it using the following command:

    $ mkdir –p /u01/app/oracle/gg
    
  3. Change the directory to the top level directory of your software installation, as follows:

    $ cd /u01/app/oracle/gg
    
  4. Download the OGG software to the download directory created in step 3.

  5. When you download the OGG software, make sure you choose the correct software for your operating system and database version from either Oracle Technology Network (OTN) or Oracle eDelivery.

  6. After downloading the ZIP file for AIX, we do the listing of directory contents by using the following command:

    $ ls –l
    

    The output of the preceding command will be as follows:

    -rw-r--r--    1 oracle   oinstall   49963147 Nov 14 13:51 ogg112101_ggs_AIX_ppc_ora11g_64bit.zip
    
  7. Now we're ready to inflate the ZIP file, we do it by using following command:

    $ unzip ogg112101_ggs_AIX_ppc_ora11g_64bit.zip
    

    The output of the preceding command will be as follows:

    Archive:  ogg112101_ggs_AIX_ppc_ora11g_64bit.zip
      inflating: ggs_AIX_ppc_ora11g_64bit.tar
      inflating: OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf
      inflating: Oracle GoldenGate 11.2.1.0.1 README.doc
      inflating: Oracle GoldenGate 11.2.1.0.1 README.txt
    
  8. The inflated files contain another tar file which contains the actual software distribution. We need to untar this file, using the following command:

    $ tar xvf ggs_AIX_ppc_ora11g_64bit.tar
    
  9. Complete untaring the file. You now have successfully installed the OGG distribution.

  10. Next we need to ensure we set up our environment variables accordingly. In your current shell, you need to export the following variables:

    $ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
    $ export ORACLE_SID=SRC100
    
  11. We would now be setting the library path for AIX. For AIX systems, this export is mandatory and is done by using the following command:

    $ export LIBPATH="${ORACLE_HOME}/lib
    
  12. Next step is to invoke Oracle GoldenGate to create the subdirs directories where the parameter files, trail files, temp directory, traces, and so on will be stored. Change the directory to your OGG home and create the following subdirectories:

    $ cd /u01/app/oracle/gg
    $ ./ggsci
    GGSCI> create subdirs
    

    The output of the preceding commands will be as follows:

    Creating subdirectories under current directory /u01/app/oracle/gg
    
    Parameter files               /u01/app/oracle/gg/dirprm: already exists
    Report files                  /u01/app/oracle/gg/dirrpt: created
    Checkpoint files              /u01/app/oracle/gg/dirchk: created
    Process status files          /u01/app/oracle/gg/dirpcs: created
    SQL script files              /u01/app/oracle/gg/dirsql: created
    Database definitions files    /u01/app/oracle/gg/dirdef: created
    Extract data files            /u01/app/oracle/gg/dirdat: created
    Temporary files               /u01/app/oracle/gg/dirtmp: created
    Stdout files                  /u01/app/oracle/gg/dirout: created
    
  13. At this stage we have completed the OGG installation, we now exit the installation using the following command:

    GGSCI> exit
    

The steps for installing Oracle GoldenGate in the target host are the same as the preceding steps. Repeat the steps from 1 to 13 in your target host.

How it works...

In order to download the correct Oracle GoldenGate version for your platform and database you must know your operating system version and chipset (x86, x86 64bit, IA64, and so on) including your database version and kernel bit information (32-bit or 64-bit).

After you have downloaded the software and installed it, you need to update your environment settings. Make sure you do this on the target host as well.

You need to ensure you have your ORACLE_HOME and ORACLE_SID variables set accordingly in your environment.

If you're using the Korn Shell/Bourne Shell then you can set these in your .profile file. If you're using the Bash shell, then you can update your .bash_profile file. For example, we perform the update using the following command:

$ vi .bash_profile

And add the following command lines to the file:

   export ORACLE_HOME="/u01/app/oracle/product/11.2.0/db_1"
   export ORACLE_SID="SRC100"
   export LIBPATH="{ORACLE_HOME}/lib"

Then save the file and exit.

LIBPATH was used in our preceding recipe that is specific to AIX. For other platforms, the shared libraries are referenced in the following table:

Platform

Environment variable

HP-UX

SHLIB_PATH

Sun Solaris

HP True64 (OSF/1)

Linux

LD_LIBRARY_PATH

In 64-bit platforms with 32-bit Oracle databases, OGG requires the LD_LIBRARY_PATH variable to include the 32-bit Oracle libraries.

When Oracle GoldenGate and the database are running on the same server, the following software must have the same bit type; all either 32-bit, 64-bit, or IA64:

  • Oracle library versions

  • Oracle GoldenGate version

  • Database versions

When Oracle GoldenGate connects remotely to the database server via SQL*Net, the following processes are required:

  • Extract

  • Replicat

The Oracle client library and the Oracle GoldenGate build of both Extract and Replicat processes must have the same Oracle version, bit type, and operating system version.

Note

The top level software directory on the target server in my sandbox is /u01/app/oracle/goldengate. Although this could be any arbitrary directory path, in real-world environments you would ideally create a standard mount point location for all your OGG installations across the enterprise.