Category Archives: GoldenGate

goldengate make user


CREATE USER

create tablespace gg_data datafile '/u01/app/oracle/oradata/srcxxt01/gg_data.dbf' size 1024M;

create user ogguser identified by ogg
default tablespace gg_data temporary tablespace temp
quota unlimited on gg_data;
grant select any table to ogguser ;
grant select any transaction to ogguser ;
grant select any dictionary to ogguser ;
grant flashback  any table to ogguser ;
grant execute on dbms_flashback to ogguser ;
grant create session, alter session to ogguser ;
grant connect,resource to ogguser ;
grant alter any table to ogguser ;
grant alter system to ogguser ;
grant execute on sys.dbms_internal_clkm to ogguser ;
exec dbms_goldengate_auth.grant_admin_privilege('ogguser');






create user testrep identified by testrep
default tablespace users temporary tablespace temp;

grant connect to testrep;
alter user testrep default role connect;
grant create session to testrep;
grant resource to testrep;
alter user testrep quota unlimited on users;



truncate table stress1;
truncate table stress2;
truncate table stress3;
truncate table stress4;
truncate table stress5;
truncate table stress6;
truncate table stress7;




make_testrep_objects.sql

DROP TABLE STRESS1 CASCADE CONSTRAINTS ;

CREATE TABLE STRESS1 (
  FIELD1   VARCHAR2 (10)  NOT NULL,
  FIELD2   VARCHAR2 (10)  NOT NULL,
  FIELD3   VARCHAR2 (10)  NOT NULL,
  NUM1     NUMBER        NOT NULL,
  NUM2     NUMBER,
  DATE1    DATE,
  FIELD4   VARCHAR2 (20),
  FIELD5   VARCHAR2 (20),
  FIELD6   VARCHAR2 (20),
  NUM3     NUMBER,
  NUM4     NUMBER,
  FIELD7   VARCHAR2 (20),
  FIELD14  VARCHAR2 (20),
  FIELD8   VARCHAR2 (20),
  FIELD9   VARCHAR2 (20),
  FIELD10  VARCHAR2 (20),
  FIELD11  VARCHAR2 (20),
  FIELD12  VARCHAR2 (20),
  FIELD13  VARCHAR2 (20),
  DATE2    DATE,
  DATE3    DATE,
  NUM5     NUMBER,
  NUM6     NUMBER,
  NUM7     NUMBER,
  NUM8     NUMBER,
  NUM9     NUMBER,
  NUM10    NUMBER,
  NUM11    NUMBER,
  FIELD15  VARCHAR2 (20),
  CONSTRAINT STRESS1_PK
  PRIMARY KEY ( NUM1, FIELD1, FIELD2, FIELD3 )
    USING INDEX
     TABLESPACE USERS PCTFREE 10
     STORAGE ( INITIAL 128K NEXT 128K PCTINCREASE 0 ))
 TABLESPACE USERS
   PCTFREE 10   PCTUSED 40
   INITRANS 1   MAXTRANS 255
 STORAGE (
   INITIAL 2M NEXT 2M PCTINCREASE 0
   MINEXTENTS 1 MAXEXTENTS 4096 )
   NOCACHE;


drop sequence stress1_seq;


create sequence stress1_seq start with 1
increment by 1;


DROP TABLE STRESS2 CASCADE CONSTRAINTS ;


CREATE TABLE STRESS2 (
  FIELD1   VARCHAR2 (10)  NOT NULL,
  FIELD2   VARCHAR2 (10)  NOT NULL,
  FIELD3   VARCHAR2 (10)  NOT NULL,
  NUM1     NUMBER        NOT NULL,
  NUM2     NUMBER,
  DATE1    DATE,
  FIELD4   VARCHAR2 (20),
  FIELD5   VARCHAR2 (20),
  FIELD6   VARCHAR2 (20),
  NUM3     NUMBER,
  NUM4     NUMBER,
  FIELD7   VARCHAR2 (20),
  FIELD14  VARCHAR2 (20),
  FIELD8   VARCHAR2 (20),
  FIELD9   VARCHAR2 (20),
  FIELD10  VARCHAR2 (20),
  FIELD11  VARCHAR2 (20),
  FIELD12  VARCHAR2 (20),
  FIELD13  VARCHAR2 (20),
  DATE2    DATE,
  DATE3    DATE,
  NUM5     NUMBER,
  NUM6     NUMBER,
  NUM7     NUMBER,
  NUM8     NUMBER,
  NUM9     NUMBER,
  NUM10    NUMBER,
  NUM11    NUMBER,
  FIELD15  VARCHAR2 (20),
  CONSTRAINT STRESS2_PK
  PRIMARY KEY ( NUM1, FIELD1, FIELD2, FIELD3 )
    USING INDEX
     TABLESPACE USERS PCTFREE 10
     STORAGE ( INITIAL 128K NEXT 128K PCTINCREASE 0 ))
 TABLESPACE USERS
   PCTFREE 10   PCTUSED 40
   INITRANS 1   MAXTRANS 255
 STORAGE (
   INITIAL 2M NEXT 2M PCTINCREASE 0
   MINEXTENTS 1 MAXEXTENTS 4096 )
   NOCACHE;

drop sequence stress2_seq;



create sequence stress2_seq start with 1
increment by 1;


DROP TABLE STRESS3 CASCADE CONSTRAINTS ;

CREATE TABLE STRESS3 (
  FIELD1   VARCHAR2 (10)  NOT NULL,
  FIELD2   VARCHAR2 (10)  NOT NULL,
  FIELD3   VARCHAR2 (10)  NOT NULL,
  NUM1     NUMBER        NOT NULL,
  NUM2     NUMBER,
  DATE1    DATE,
  FIELD4   VARCHAR2 (20),
  FIELD5   VARCHAR2 (20),
  FIELD6   VARCHAR2 (20),
  NUM3     NUMBER,
  NUM4     NUMBER,
  FIELD7   VARCHAR2 (20),
  FIELD14  VARCHAR2 (20),
  FIELD8   VARCHAR2 (20),
  FIELD9   VARCHAR2 (20),
  FIELD10  VARCHAR2 (20),
  FIELD11  VARCHAR2 (20),
  FIELD12  VARCHAR2 (20),
  FIELD13  VARCHAR2 (20),
  DATE2    DATE,
  DATE3    DATE,
  NUM5     NUMBER,
  NUM6     NUMBER,
  NUM7     NUMBER,
  NUM8     NUMBER,
  NUM9     NUMBER,
  NUM10    NUMBER,
  NUM11    NUMBER,
  FIELD15  VARCHAR2 (20),
  CONSTRAINT STRESS3_PK
  PRIMARY KEY ( NUM1, FIELD1, FIELD2, FIELD3 )
    USING INDEX
     TABLESPACE USERS PCTFREE 10
     STORAGE ( INITIAL 128K NEXT 128K PCTINCREASE 0 ))
 TABLESPACE USERS
   PCTFREE 10   PCTUSED 40
   INITRANS 1   MAXTRANS 255
 STORAGE (
   INITIAL 2M NEXT 2M PCTINCREASE 0
   MINEXTENTS 1 MAXEXTENTS 4096 )
   NOCACHE;

drop sequence stress3_seq;

create sequence stress3_seq start with 1
increment by 1;


DROP TABLE STRESS4 CASCADE CONSTRAINTS ;

CREATE TABLE STRESS4 (
  FIELD1   VARCHAR2 (10)  NOT NULL,
  FIELD2   VARCHAR2 (10)  NOT NULL,
  FIELD3   VARCHAR2 (10)  NOT NULL,
  NUM1     NUMBER        NOT NULL,
  NUM2     NUMBER,
  DATE1    DATE,
  FIELD4   VARCHAR2 (20),
  FIELD5   VARCHAR2 (20),
  FIELD6   VARCHAR2 (20),
  NUM3     NUMBER,
  NUM4     NUMBER,
  FIELD7   VARCHAR2 (20),
  FIELD14  VARCHAR2 (20),
  FIELD8   VARCHAR2 (20),
  FIELD9   VARCHAR2 (20),
  FIELD10  VARCHAR2 (20),
  FIELD11  VARCHAR2 (20),
  FIELD12  VARCHAR2 (20),
  FIELD13  VARCHAR2 (20),
  DATE2    DATE,
  DATE3    DATE,
  NUM5     NUMBER,
  NUM6     NUMBER,
  NUM7     NUMBER,
  NUM8     NUMBER,
  NUM9     NUMBER,
  NUM10    NUMBER,
  NUM11    NUMBER,
  FIELD15  VARCHAR2 (20),
  CONSTRAINT STRESS4_PK
  PRIMARY KEY ( NUM1, FIELD1, FIELD2, FIELD3 )
    USING INDEX
     TABLESPACE USERS PCTFREE 10
     STORAGE ( INITIAL 128K NEXT 128K PCTINCREASE 0 ))
 TABLESPACE USERS
   PCTFREE 10   PCTUSED 40
   INITRANS 1   MAXTRANS 255
 STORAGE (
   INITIAL 2M NEXT 2M PCTINCREASE 0
   MINEXTENTS 1 MAXEXTENTS 4096 )
   NOCACHE;


drop sequence stress4_seq;

create sequence stress4_seq start with 1
increment by 1;



DROP TABLE STRESS5 CASCADE CONSTRAINTS ;

CREATE TABLE STRESS5 (
  FIELD1   VARCHAR2 (10)  NOT NULL,
  FIELD2   VARCHAR2 (10)  NOT NULL,
  FIELD3   VARCHAR2 (10)  NOT NULL,
  NUM1     NUMBER        NOT NULL,
  NUM2     NUMBER,
  DATE1    DATE,
  FIELD4   VARCHAR2 (20),
  FIELD5   VARCHAR2 (20),
  FIELD6   VARCHAR2 (20),
  NUM3     NUMBER,
  NUM4     NUMBER,
  FIELD7   VARCHAR2 (20),
  FIELD14  VARCHAR2 (20),
  FIELD8   VARCHAR2 (20),
  FIELD9   VARCHAR2 (20),
  FIELD10  VARCHAR2 (20),
  FIELD11  VARCHAR2 (20),
  FIELD12  VARCHAR2 (20),
  FIELD13  VARCHAR2 (20),
  DATE2    DATE,
  DATE3    DATE,
  NUM5     NUMBER,
  NUM6     NUMBER,
  NUM7     NUMBER,
  NUM8     NUMBER,
  NUM9     NUMBER,
  NUM10    NUMBER,
  NUM11    NUMBER,
  FIELD15  VARCHAR2 (20),
  CONSTRAINT STRESS5_PK
  PRIMARY KEY ( NUM1, FIELD1, FIELD2, FIELD3 )
    USING INDEX
     TABLESPACE USERS PCTFREE 10
     STORAGE ( INITIAL 128K NEXT 128K PCTINCREASE 0 ))
 TABLESPACE USERS
   PCTFREE 10   PCTUSED 40
   INITRANS 1   MAXTRANS 255
 STORAGE (
   INITIAL 2M NEXT 2M PCTINCREASE 0
   MINEXTENTS 1 MAXEXTENTS 4096 )
   NOCACHE;

drop sequence stress5_seq;


create sequence stress5_seq start with 1
increment by 1;


DROP TABLE STRESS6 CASCADE CONSTRAINTS ;
                                                                               265,1         42%
begin
  for loop_var in 1..overall loop
     for loop_ins in 1..ins loop
       insert into stress7 values(
       'thisisa','temporary','tablevalue',stress7_seq.nextval,12345,sysdate,
       'newwewil','determine','helloworld',12345,987654,
       '10charvld','11charfld','another1','biggest','smallest',
       'ashortone','dkdksjj',NULL,sysdate-1,sysdate-2,
       12345,23456,34567,45678,56789,98766,56783,
       'thelastone');
   end loop;
   commit;
   end loop;
end;
/

create or replace procedure rock_and_roll
(ins in number default 10, overall in number default 10)
as
 loop_var number(38);
 loop_ins number(38);
 tmpvar varchar2(50);
begin
  for loop_var in 1..overall loop
     for loop_ins in 1..ins loop
       insert into stress1 values(
       'thisisa','temporary','tablevalue',stress1_seq.nextval,12345,sysdate,
       'newwewil','determine','helloworld',12345,987654,
       '10charvld','11charfld','another1','biggest','smallest',
       'ashortone','dkdksjj',NULL,sysdate-1,sysdate-2,
       12345,23456,34567,45678,56789,98766,56783,
       'thelastone');
       insert into stress2 values(
       'thisisa','temporary','tablevalue',stress2_seq.nextval,12345,sysdate,
       'newwewil','determine','helloworld',12345,987654,
       '10charvld','11charfld','another1','biggest','smallest',
       'ashortone','dkdksjj',NULL,sysdate-1,sysdate-2,
       12345,23456,34567,45678,56789,98766,56783,
       'thelastone');
       insert into stress3 values(
       'thisisa','temporary','tablevalue',stress3_seq.nextval,12345,sysdate,
       'newwewil','determine','helloworld',12345,987654,
       '10charvld','11charfld','another1','biggest','smallest',
       'ashortone','dkdksjj',NULL,sysdate-1,sysdate-2,
       12345,23456,34567,45678,56789,98766,56783,
       'thelastone');
       insert into stress4 values(
       'thisisa','temporary','tablevalue',stress4_seq.nextval,12345,sysdate,
       'newwewil','determine','helloworld',12345,987654,
       '10charvld','11charfld','another1','biggest','smallest',
       'ashortone','dkdksjj',NULL,sysdate-1,sysdate-2,
       12345,23456,34567,45678,56789,98766,56783,
       'thelastone');
       insert into stress5 values(
       'thisisa','temporary','tablevalue',stress5_seq.nextval,12345,sysdate,
       'newwewil','determine','helloworld',12345,987654,
       '10charvld','11charfld','another1','biggest','smallest',
       'ashortone','dkdksjj',NULL,sysdate-1,sysdate-2,
       12345,23456,34567,45678,56789,98766,56783,
       'thelastone');
       insert into stress6 values(
       'thisisa','temporary','tablevalue',stress6_seq.nextval,12345,sysdate,
       'newwewil','determine','helloworld',12345,987654,
       '10charvld','11charfld','another1','biggest','smallest',
       'ashortone','dkdksjj',NULL,sysdate-1,sysdate-2,
       12345,23456,34567,45678,56789,98766,56783,
       'thelastone');
       insert into stress7 values(
       'thisisa','temporary','tablevalue',stress7_seq.nextval,12345,sysdate,
       'newwewil','determine','helloworld',12345,987654,
       '10charvld','11charfld','another1','biggest','smallest',
       'ashortone','dkdksjj',NULL,sysdate-1,sysdate-2,
       12345,23456,34567,45678,56789,98766,56783,
       'thelastone');
   end loop;
   commit;
   end loop;
end;
/


GoldenGate Readiness Scripts from Oracle

GoldenGate DB Ready

Complete Database Profile OGG readiness check for Classic Extract

MOS Note:1298562.1:
Oracle 
GoldenGate database Complete Database Profile check script for Oracle DB (All Schemas) Classic Extract 

This script is intended to query all of the non default database users to identify current configuration and identify any unsupported data types or types that may need special considerations for Oracle GoldenGate in an Oracle environment.

GoldenGate Integrated Capture and Integrated Replicat Healthcheck Script (Doc ID 1448324.1)

GoldenGate Setup For The Hub

GoldenGate Setup for the Hub

Steps to setup a new environment on a node.

Assumptions.

  • The required disk has been make available to the Hub database system.
  • XAG has been installed, 9.1 is the current version.
  • All required software has been installed (fuse, GoldenGate, CRS, XAG  etc.)
  • All required setting and logging is configured at the DB level.
  • All installs are in the same location on all servers.

 

These are all the manual steps required to implement resiliency for the GoldenGate hub.   Mike Culp has written scripts to do this process. In general, using scripting for a process that covers many different servers is a best practice approach, as it insures the installs are done in an identical fashion.  This reduces complexity of all maintenance.

 

Setup Overview

Each cluster on the Hub has its’ own database.  This database is used to supply a file system(s) for the trail files and other OGG files required for recovery.   The DBFS filesystem for the OGG files can only be mounted on one node at a time as a best practice. Otherwise duplicate processes could be started, which could cause corruption in the replication hub.  The data disk can be mounted on all systems if desired. If there is only one data group in a replication instance, it is possible to put all files on that one mount, and mount it to only one node at a time. But it is very difficult to undo that decision.

 

  1. Create a directories off the root filesystem system.
  2. Grant the oracle user full control of the dir.
  3. Create the tablespace for DBFS – standard create tablespace command.  The following example uses a bigfile tablespace but that is NOT required.
    1. create bigfile tablespace dbfs_tblsp datafile ‘+DBFS_DG’ size 32g autoextend on next 8g maxsize 300g NOLOGGING EXTENT MANAGEMENT LOCAL AUTOALLOCATE  SEGMENT SPACE MANAGEMENT AUTO ;
  4. Create a user for that tablespace.
    1. At minimum, database users must have the following privileges to create a file system: GRANT CONNECT, CREATE SESSION, RESOURCE, CREATE TABLE, and CREATE PROCEDURE, and DBFS_ROLE
      1. create user dbfs_user identified by dbfs_passwd default tablespace dbfs_tblsp quota unlimited on dbfs_tblsp;
      2. grant create session, create table, create view, create procedure, dbfs_role to dbfs_user;
  5. Create the file system, logging in as the user created above.
    1. start dbfs_create_filesystem dbfs_tblsp dbfs_mnt
      1. This script takes two arguments:
        1. dbfs_tblsp: tablespace for the DBFS database objects
        2. dbfs_mnt : filesystem name, this can be any string and will appear as a directory under the mount point
    2. Validate the system is configured with nocache, logging
      1. SQL>  SELECT logging, cache FROM dba_lobs WHERE tablespace_name=’DBFS_TBLSP’;

LOGGING CACHE

——- ———-

YES     NO

  1. Modify/rename the mount-dbfs.conf and mount-dbfs.sh scripts for this instantiation.  Each OGG instance will have its own “name” used to identify it within crs. As such a different set of conf and sh script will be needed for each OGG instance.
  2. Test the mount-dbfs.sh script.  (start, stop , status). This validates the setup.
    1. Start should mount the file system.
    2. Stop should unmount.
    3. Status should return the status.
  3. Create a service for the instantation.
    1. srvctl add service -database db_name -service ggname_svc -preferred node1 -available node2
  4. Create the clusterware setup for the dbfs file system.  Use cluster resource to only allow it to be mounted one one node.  The data dbfs system can use local_resource.
    1. $GRID_HOME/bin/crsctl add resource dbfs_mnt \

-type cluster_resource \

-attr “ACTION_SCRIPT=/ora01/scripts/ggcommon/mount-dbfs.sh CHECK_INTERVAL=30 RESTART_ATTEMPTS=10 , \  START_DEPENDENCIES=’hard(ora.raca_domain.db)pullup(ora.raca_domain.db)’,STOP_DEPENDENCIES=’hard(ora.raca_domain.db)’,SCRIPT_TIMEOUT=300”

 

  1. Test crsctl to start,stop and relocate to validate it works.

$GRID_HOME/bin/start resource dbfs_mnt

  1. Create the goldengate soft links to the dbfs mounts.
    1. cd $GG_HOME
    2. mv dirprm dirprm.old
    3. mv dirchk dirchk.old
    4. mv dircrd dircrd.old
    5. mv dirrpt dirrpt.old
    6. ln –s /mnt/dbfs_mnt/dirprm dirprm
    7. ln –s /mnt/dbfs_mnt/dirchk dirchk
    8. ln –s /mnt/dbfs_mnt/dircrd dircrd
    9. ln –s /mnt/dbfs_mnt/dirrpt dirrpt
  2. Create the crs definition for goldengate using the XAG interface
    1. $XAG_HOME/bin/agctl add goldengate GG_SOURCE \ –gg_home /u01/oracle/goldengate \ –oracle_home /u01/app/oracle/product/12.2.0/dbhome_1 \  –db_services ggname_svc –use_local_services –filesystems dbfs_mnt
  3. Create the manager parameter file
  4. Start and stop the goldengate instance using agctl.   Validate the mgr process started.
  5. Create the required data dbfs file systems for the data.
  6. Create the crsctl definitions, if desired.  The only difference is -cluster_resource is not used, as the data can be mounted on all systems with no issues.  The only reason for the crsctl definitions is to startup the mount system automatically, there is no failover required.

The system is ready for replication, however the same setup, with the exception of the XAG and CRS configuration is required for all nodes/clusters that may run this instantiation of GoldenGate.  The XAG and the crs setup is only done once per cluster.

 

gg_common.ksh 04172019


#!/bin/ksh
############################################################################
# Script Name..: gg_common.ksh
# Description..: Common GG Hub functions for inclusion to all driver scripts
# Author.......: Michael Culp
# Date.........: 04/23/2010
# Version......: .65
# Modified By..: Michael Culp
# Date Modified: 06/07/2017
# Comments.....: Change this library to make mods to all functions
# Schema owner.: N/A
# Dependent on.: N/A
# Script type..: function library
# Function list:
############################################################################

############################################################################
#
############################################################################

gg_init()
##########################################################
# These variables should be set prior to setup
# Call this function anytime the variables need to be
# set for values that will be utilized in other functioons
# gg_init should be used to determine which environment
# needs to be setup
#########################################################
{

# Take a parameter for the instance
gginst=$1


# Do not change the following 2 variables
#########################################################
ggcomver=".92"
ggcomdt="10/18/2018"

######################################################### 
# set -xv
# This will set the ggini file based on the hostname
#########################################################
initflnm=`hostname -a`".ggini"

echo "Display the init file name"
echo $initflnm

# Test to see if the is an init file first
# if so read it, otherwise set these variables

#   future enhancement check for various scripts standard names
echo
echo
echo "Checking for the existance of the ggini initialization file.."
echo


# if [ -f /oracle/admin/scripts/ggcommon/`hostname -a`.ggini ]; then
if [ -f /oracle/admin/scripts/ggcommon/`hostname -a`.gginix ]; then
   echo "....file exists...."
   echo
   echo " The ggini file was read ....Y"
   echo
   echo "....reading variables from the .ggini file....."
   echo
#   . ./`hostname -a`.ggini
   . /oracle/admin/scripts/ggcommon/`hostname -a`.ggini
else
   echo "....file does not exist"
   echo
   echo " The ggini file was not read ...."
   echo
   echo "....reading variables from the gg_init function....."
   echo
   #########################################################
   # Set the Oracle inventory location
   #########################################################
   orainv="/oracle/oraInventory"

   echo
   echo "Running gg_init function()......."
   echo

   #######################################################
   # GoldenGate operational directory
   # This needs to be set during build of additional
   # GoldenGate instances
   #######################################################
   # gg_dir="/oracle/product/gg123"
   # gg_dir="/oracle/product/gg123ms"
   # gg_dir="/oracle/product/gg122"

   # gg_dir="/oracle/product/ggvad001"
   # gg_dir="/oracle/product/ggvad001"
   # gg_dir="/oracle/product/ggvad001"
   # gg_dir="/oracle/product/ggtxd003"
   # gg_dir="/oracle/product/ggtxd002"
   # gg_dir="/oracle/product/ggtxd001"
   # gg_dir="/oracle/product/ggtxd006"
   # gg_dir="/oracle/product/ggtxd007"
   gg_dir="/oracle/product/ggvat004"

   # gg_dir="/oracle/product/gg121"

   export GGS_HOME=$gg_dir

   export OGG_HOME=$GGS_HOME

   #######################################################
   # GoldenGate version
   # We support GG 12.1, 12.2, 12.3 currently
   #######################################################
   ggver="12.3"
   # ggver="12.2"
   # ggver="12.1"

   # export DBFS_MNT=/dbfs

   #######################################################
   # GoldenGate source version
   #######################################################
   ggsrcver="12.1"

   #######################################################
   # ggflnm - is the zip file name of the GG distro
   # This is the name of the goldengate zip files
   #######################################################
   # File below is 12.3.0.1.2
   ggflnm="123014_fbo_ggs_Linux_x64_shiphome.zip"

   # File below is 12.3.0.1.2
   # ggflnm="123012_fbo_ggs_Linux_x64_shiphome.zip"

   # File below is 12.2
   # ggflnm="V100692-01.zip"

   # File below is 12.3 Micro Service Architecture
   # ggflnm="123010_fbo_ggs_Linux_x64_shiphome.zip"
   #######################################################


   #######################################################
   # ggdir_dist - directory of the distro zip file
   # This is the name of the directory where the distribution GoldenGate software is stored
   # Choose one and uncomment it
   #######################################################
   ##### GoldenGate ver. 12.3
   # ggdir_dist="/ora01/Oracle_SW/gg123/"
   ##### GoldenGate ver. 12.3.0.1.4
   ggdir_dist="/ora01/Oracle_SW/gg123/123014/"
   ##### GoldenGate ver. 12.3 MicroService Architecture
   # ggdir_dist="/ora01/Oracle_SW/gg123ms/"
   # ggdir_dist="/ora01/Oracle_SW/gg122/"
   # ggdir_dist="/ora01/Oracle_SW/gg121/"

   #######################################################
   # gginstdir - Location of the installer
   # GoldenGate installer directory
   #######################################################
   gginstdir=$ggdir_dist"fbo_ggs_Linux_x64_shiphome/Disk1"

   #######################################################
   # ggrspfldir - Response file directory
   # Response file directory
   #######################################################
   ggrspfldir=$ggdir_dist"fbo_ggs_Linux_x64_shiphome/Disk1/response"

   #######################################################
   # ggrspfl - response file name
   # Response file name for install of the GG binaries
   #######################################################
   ggrspfl="oggcore_mrc.rsp"

   #######################################################
   # XAG version
   #######################################################
   # xagver="7.1b"
   # xagver="8.1b"
   xagver="9.1"

   #######################################################
   # This is the name of the directory where the XAG software is stored
   #######################################################
   # xagdir_dist="/ora01/Oracle_SW/xag71/"
   # xagdir_dist="/ora01/Oracle_SW/xag81b/"
   xagdir_dist="/ora01/Oracle_SW/xag91/"

   #######################################################
   # XAG Ops directory
   # This is the operational directory for XAG
   #######################################################
   # xagdir="/oracle/product/xag_71"
   # xagdir="/oracle/product/xag_81b"
   xagdir="/oracle/product/xag_91"


   #######################################################
   # XAG home directory
   #######################################################
   XAG_HOME=/oracle/product/xag_91
   XAG_LOG=/oracle/product/xag_91/log/nodename


   #######################################################
   # This is the name of the xag zip file
   #######################################################
   # xagflnm="xagpack81b.zip"
   xagflnm="xagpack91.zip"

   # Read the GG environment files
   # . ./ggoraenv.env

fi

XAG_SD=/oracle/admin/scripts/ggcommon

CRS_SD=/oracle/admin/scripts/crsdbfs
DBFS_SD=/oracle/admin/scripts/clle_dbfscommon
GG_SD=/oracle/admin/scripts/ggcommon
ASM_SD=/oracle/admin/scripts/asmcommon
DG_SD=/oracle/admin/scripts/dgcommon


############################################################################
# Show the variable status dashboard,  comment this line to not display it
############################################################################
gg_init_dbrd

}

gg_init_dbrd()
########################################################
# This is a display dashboard that shows the values of
# Environmental variables
# used in various functions
########################################################
{

echo
echo "Change variables in gg_common.ksh gg_init...."
echo "Display with gg_init_dbrd function .........."
echo

echo
echo "..gg_common.ksh ver. $ggcomver Date $ggcomdt"
echo "....Oracle Inventory location................: " $orainv
echo "....GoldenGate Version.......................: " $ggver
echo "....GoldenGate Source Version supported......: " $ggsrcver
echo
echo "================= Installation Parameters ======================="
echo "....GoldenGate Filename......................: " $ggflnm
echo "....GoldenGate software distribution dir.....: " $ggdir_dist
echo "....GoldenGate Response File Dir.............: " $ggrspfldir
echo "....GoldenGate Response File ................: " $ggrspfl
echo "....GoldenGate Installer directory...........: " $gginstdir
echo "....GoldenGate Ops  Directory................: " $gg_dir
echo "....GoldenGate Home..GGS_HOME................: " $GGS_HOME
echo "....GoldenGate Home..OGG_HOME................: " $OGG_HOME
echo
echo "....XAG Version..............................: " $xagver
echo "....XAG Filename.............................: " $xagflnm
echo "....XAG Dist directory.......................: " $xagdir_dist
echo "....XAG Ops directory........................: " $xagdir
echo "....XAG Home directory.......................: " $XAG_HOME
echo ".......XAG scripts directory.................: " $XAG_SD
echo "....XAG Log Directory........................: " $XAG_LOG
echo
echo "================= DBFS Parameters =============================="

echo "================= Scripts Directoriess ========================="
echo ".......CRS.................: " $CRS_SD
echo ".......DBFS................: " $DBFS_SD
echo ".......GoldenGate..........: " $GG_SD
echo ".......XAG.................: " $XAG_SD
echo ".......DataGuard...........: " $DG_SD
echo "================================================================"

echo
echo "....LD_LIBRARY_PATH..........................: " $LD_LIBRARY_PATH
echo
echo "....PATH.....................................: " $PATH
echo

echo "Installation directories......................."
echo
ls -lt /oracle/product/


# echo "Show ldd for libraries........................."
# ldd -d extract
# echo "....end transmission..........................."

}


gg_cr_inst_init()
{

echo
echo "Create Install INIT file....."
echo
cat << EOS > gg_inst_init_$gginst.env

export GGS_HOME=/oracle/product/gg122

EOS

}

gg_unzip()
##############################################
# Unzip the GG distribution file
# See gg_init function for the variables:
#     ggdir_dist
#     ggflnm
##############################################
{

ggdir_dist=$1
ggflnm=$2

echo
echo "Unzip function...."
echo

cd $ggdir_dist
unzip $ggflnm

}