Using a environment file can help setup GoldenGate properly
Here I'm using an environment file to setup various variables
I include this as a function to the overall library gg_common.ksh

gg_cr_env()
###############################################################################
# Create the ggoraenv.env file
###############################################################################
{

echo "...Creating ggoraenv.env...."

# Creating the file
# echo > ggoraenv.env
cat << EOS >> ggoraenv.env
# export ORACLE_HOME=/oracle/product/11.2.0.4/db_11
# export ORACLE_SID=MRCXXD011
# export LD_LIBRARY_PATH=/oracle/product/11.2.0.4/db_11u/lib
# export GG_HOME=/oracle/product/gg12.1
export GGS_HOME=/u01/app/oracle/product/12.2/gg_2
export GGS_HOME=$gg_dir
export GG_SITE=01
export GG_LOC=TX

# if there is only one DB related to this GG home,
# set NEW_ORACLE_SID to avoid constant switch between a DB env and its GG env
# export NEW_ORACLE_SID=PIPERD011; . ~/.std_profile

# otherwise, set NEW_ORACLE_SID to dummy if there are multiple replicated databases related to same GG home
#export NEW_ORACLE_SID=dummy; . ~/.std_profile

# uncomment next three lines if  ORACLE_SID is dummy
#export ORACLE_HOME=/oracle/product/11.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib/$JAVA_HOME/lib/amd64/server:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH

export PATH=$GGS_HOME:$PATH
export LD_LIBRARY_PATH=$GGS_HOME:$LD_LIBRARY_PATH

# for OEM12c GG monitoring
# export JAVA_HOME=/oracle/product/12.1.0/oem_1/agent/core/12.1.0.2.0/jdk/jre
# export PATH=$JAVA_HOME/bin:$PATH
# export LD_LIBRARY_PATH=$JAVA_HOME/lib/amd64/server:$LD_LIBRARY_PATH

# Set and export the timezone
TZ=UTC
export TZ

#############################################
## For GI Agent (XAG)
##############################################
# export XAG_HOME=/oracle/product/xag71
# export PATH=$XAG_HOME/bin:$PATH

# Change the prompt
PS1="\\
\${PWD} \\
\${SNAME} [\${ORACLE_SID}] [GG_site$GG_SITE"_"$GG_LOC]-> "
export PS1

# alias ggsora12='. $HOME/.ggsora12_env;cd $GGS_HOME'
alias ggsora12='. /ora_rman/ora013/mrc/gg/ggoraenv.env;cd $GGS_HOME'
# alias xag='. $HOME/.ggsora12_env;cd $XAG_HOME'
# alias ggstatus='$XAG_HOME/bin/agctl status goldengate piperd01_oggapp'

# Show the home afterward
echo "GGS_HOME is : " $GGS_HOME

EOS
}

Ready for Action?

LET'S GO!
Copyright 2024 IT Remote dot com
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram