Tuesday 20 January 2015

Oracle 11g GoldenGate Installation. Part 1

 MY ENV.

2 DB 10g on two different
Machine 192.168.2.29    (10g)
Machine 192.168.2.30    (10g)
Each & every node install GG  because of the purpose to replicate a data. And tns / Listener configure.

Oracle 11g GoldenGate Installation.
Download the GoldenGate software from Oracle Edelivery.

Select a Product Pack: Oracle Fusion Middleware
Platform: Linux X86


Download the Oracle GoldenGate media pack.

Create the directory for GoldenGate.


1.
$ mkdir -p /u01/app/gg


2.
  Make changes in your bash profile.
  Add path variable.Like this.
  # PATH=/usr/sbin:/u01/app/gg:$PATH; export PATH
  # PATH=$ORACLE_HOME/bin:/u01/app/gg:$PATH; export PATH

  PATH=/u01/app/gg:$PATH; export PATH

  LD library entry should look something like this.
  # LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/u01/app/gg; export LD_LIBRARY_PATH

  LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/u01/app/gg; export LD_LIBRARY_PATH

3.
  Reload bash profile
  $ . ./.bash_profile

export PATH
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
GG_HOME=/u01/app/gg; export GG_HOME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=ORCLDB; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:/u01/app/gg:$PATH; export PATH
PATH=$ORACLE_HOME/bin:/u01/app/gg:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/u01/app/gg; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

4.
   copy the tar file to the "gg" directory and untar

   tar -xvof fbo_ggs_Linux_x86_ora11g_32bit.tar 

   Invoke the GoldenGate Software Command Interface.

-------------------------------------------------------------------------------------------------------------------------------------
5.
Using DB10g and GG11g
./ggsci      #Below Getting Error
./ggsci
./ggsci: error while loading shared libraries: libnnz11.so:
cannot open shared object file: No such file or directory

10g
[oracle@localhost gg]$ ln -s /u01/app/oracle/product/10.2.0/db_1/lib/libnnz10.so libnnz11.so
[oracle@localhost gg]$ ln -s /u01/app/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1 libclntsh.so.11.1

11g
ln -s /u01/app/oracle/product/11.2.0/db_1/lib/libnnz11.so libnnz11.so
ln -s /u01/app/oracle/product/11.2.0/db_1/lib/libclntsh.so.11.1 libclntsh.so.11.1


[oracle@localhost gg]$ pwd
/u01/app/gg
[oracle@localhost gg]$ ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100 
Linux, x86, 32bit (optimized), Oracle 11g on Oct 4 2011 23:53:33

Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.



GGSCI (localhost) 1> create subdirs
Code:
Creating subdirectories under current directory /u01/app/gg

Parameter files                /u01/app/gg/dirprm: created
Report files                   /u01/app/gg/dirrpt: created
Checkpoint files               /u01/app/gg/dirchk: created
Process status files           /u01/app/gg/dirpcs: created
SQL script files               /u01/app/gg/dirsql: created
Database definitions files     /u01/app/gg/dirdef: created
Extract data files             /u01/app/gg/dirdat: created
Temporary files                /u01/app/gg/dirtmp: created
Veridata files                 /u01/app/gg/dirver: created
Veridata Lock files            /u01/app/gg/dirver/lock: created
Veridata Out-Of-Sync files     /u01/app/gg/dirver/oos: created
Veridata Out-Of-Sync XML files /u01/app/gg/dirver/oosxml: created
Veridata Parameter files       /u01/app/gg/dirver/params: created
Veridata Report files          /u01/app/gg/dirver/report: created
Veridata Status files          /u01/app/gg/dirver/status: created
Veridata Trace files           /u01/app/gg/dirver/trace: created
Stdout files                   /u01/app/gg/dirout: created

GGSCI (localhost) 2> exit

Before going any further make sure your database is in
archivelog mode.

Prepare your database for replication.

In order to extract committed transactions from the source database
the database must be configured with supplemental logging on primary
key columns.

SQL> alter database add supplemental log data (primary key) columns;

Database altered.

Do a logswitch to start supplemental logging.

SQL> alter system switch logfile;

System altered.

SQL> select supplemental_log_data_min, supplemental_log_data_pk,
supplemental_log_data_ui from v$database;


SUPPLEME SUP SUP
-------- --- ---
IMPLICIT YES NO


SUPPLEMENTAL_LOG_DATA_MIN: Ensures that logminer will have sufficient information.
SUPPLEMENTAL_LOG_DATA_PK: Indicates whether all columns of the primary key are placed into
the redo log whenever an update is performed.
SUPPLEMENTAL_LOG_DATA_UI: Indicated whether all columns belonging to the unique key are placed
into the redo log if any of the unique columns are modified.

Create a Tablespace and user for GoldenGate.

SQL> create tablespace golden datafile'/u01/app/oracle/oradata/orcl/golden01.dbf' size 100m
2 autoextend on
3 extent management local
4 segment space management auto;

Tablespace created.

SQL> create user ggs_admin identified by ggs_admin temporary tablespace temp default tablespace golden quota unlimited on golden;

User created.


SQL> grant dba to ggs_admin;

Grant succeeded.

SQL> alter system set recyclebin=off scope=spfile;

System altered.

--Set recyclebin to off, Necessary for DDL Replication from Oracle 10g onwards.


SQL> shutdown immediate
SQL> startup




Installing GoldenGate for Oracle RAC (Doc ID 966181.1)

How do I install GoldenGate on an Oracle RAC?

There are multiple variations of installing GoldenGate for Oracle RAC.


Installing GoldenGate on Shared Drives

This approach works very well. The software is installed on shared drives that all the RAC nodes have access to. The manager and GoldenGate processes can be started from one of the nodes. If the node that the GoldenGate processes were started from fails, the checkpoints are maintained. The manager and GoldenGate processes then can be started from another node without making any modifications to any parameter files. If the database alone crashes on the node that GoldenGate was installed, then the manager process will need to be stopped on that node before it be restarted on another node.

Installing GoldenGate on local disk

This approach will not work in a fail over situation. If there was a database failure alone on this node, the software could be installed on a different node. For the replicat , all the trails would need to be moved to that node. The extract and replicat could be added and positioned to that last known good checkpoint. If there were a complete node failure, this would be very difficult to recover from. It would be impossible to know what the last good checkpoint was and we would have no access to any trails that were located on those local disks.

Connecting to the RAC instance from a application server using SQL*Net

The software is installed on a separate machine. GoldenGate is setup to connect to the RAC Instance via the Global Database name which is setup in TNSNAME.ORA. By connecting to the Global Database using SQL*Net, Oracle will handle the fail over. For extract, the oracle logs will need to be located on shared disk that this server has access to.

When adding your online Extract groups, be sure to specify the THREADS option on the ADD command.



Part 2

No comments: