Protected: ORACLE : Shell script to rebuild indexes for index fragmentation
There is no excerpt because this is a protected post.
There is no excerpt because this is a protected post.
Hello Readers, In this article, we will learn Shell Script to get EMAIL alerts for Lagging between GoldenGate Processes Step 1 : Check GoldenGate processes
1 2 3 4 5 6 7 8 9 10 11 |
GGSCI (ktexperts_AWS1) 1> Info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING REPLICAT RUNNING REPLICAT1 00:11:54 00:00:02 REPLICAT RUNNING REPLICAT2 00:00:00 00:01:41 |
Step 2 : Create a script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
[oracle@AWS1 ggscripts]$ vi GG_Lag.sh export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/12.1.0 export PATH=$ORACLE_HOME/bin:$PATH:. export ORACLE_NET=$ORACLE_HOME/network/admin export GGS_HOME=/u01/app/oracle/product/ogg_trg export LD_LIBRARY_PATH=$ORACLE_HOME/lib DBA_EMAIL=ktexperts@gmail.com logpath="/tmp" cd $logpath logfile="$logpath/output_lag.txt" # Output GG information to log file echo 'INFO ALL' | /u01/app/oracle/product/ogg_trg/ggsci > $logfile cat $logfile | egrep 'MANAGER|EXTRACT|REPLICAT'| tr ":" " " | while read LINE do case $LINE in *) PROCESS_TYPE=`echo $LINE | awk -F" " '{print $1}'` PROCESS_STATUS=`echo $LINE | awk -F" " '{print $2}'` PROCESS_NAME=`echo $LINE | awk -F" " '{print $3}'` LAG_HH=`echo $LINE | awk -F" " '{print $4}'` LAG_MM=`echo $LINE | awk -F" " '{print $5}'` LAG_SS=`echo $LINE | awk -F" " '{print $6}'` if [ "$PROCESS_STATUS" != "RUNNING" ] then mailx -s "GoldenGate Process Not RUNNING on for database $ORACLE_SID" $DBA_EMAIL else if [ $LAG_HH -gt 00 -o $LAG_MM -ge 10 ]; then cat $logfile | mailx -s "ALERT ... Goldengate process \"$PROCESS_TYPE($PROCESS_NAME)\" has a lag of "$LAG_HH" hour "$LAG_MM" min on `uname -n`($ORACLE_SID)" $DBA_EMAIL fi fi esac done |
Step 3 : Add entry in Crontab
1 |
5 * * * * /home/oracle/ggscripts/GG_Lag.sh > /dev/null 2>&1 |
Hi Readers, Below article will help you on Shell Script to get EMAIL alerts for STOPPED Processes in Oracle GoldenGate. Script :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
[oracle@AWS1 ~]# cat GG_Stopped.sh export ORACLE_SID=orcl export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_1 export PATH=$ORACLE_HOME/bin:$PATH:. export ORACLE_NET=$ORACLE_HOME/network/admin export GGS_HOME=/u01/app/oracle/product/ogg_src export LD_LIBRARY_PATH=$ORACLE_HOME/lib DBA_EMAIL=ktexperts@gmail.com logpath="/tmp" cd $logpath logfile="$logpath/output.txt" # Output GG information to log file echo 'INFO ALL' | /u01/app/oracle/product/ogg_src/ggsci > $logfile #------------------------# # Check for STOPPED errors # #------------------------# if [ `cat $logfile | grep STOPPED | grep -v grep | wc -l` -eq 0 ] then echo "No STOPPED process." else echo "GoldenGate Process STOPPED on $ORACLE_HOST_NAME for database $ORACLE_SID" cat $logfile | mailx -s "GoldenGate Process STOPPED on $ORACLE_HOST_NAME for database $ORACLE_SID" $DBA_EMAIL #cat $logfile | mailx -s "TEST MAIL on $ORACLE_HOST_NAME for database $ORACLE_SID" $DBA_EMAIL fi |
Keep Script in Crontab :
1 2 |
[root@AWS! ~]# crontab -l 5 * * * * /oracle/home/GG_STOPPED.sh > /dev/null 2>&1 |
The above script will execute for every 5 minutes Now check Output file in /tmp… Read More
Hi Readers, Below article will help you on Shell Script to get EMAIL alerts for ABENDED Processes in Oracle GoldenGate. Script :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
[oracle@AWS1 ~]# cat GG_Abend.sh export ORACLE_SID=orcl export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_1 export PATH=$ORACLE_HOME/bin:$PATH:. export ORACLE_NET=$ORACLE_HOME/network/admin export GGS_HOME=/u01/app/oracle/product/ogg_src export LD_LIBRARY_PATH=$ORACLE_HOME/lib DBA_EMAIL=ktexperts@gmail.com logpath="/tmp" cd $logpath logfile="$logpath/output.txt" # Output GG information to log file echo 'INFO ALL' | /u01/app/oracle/product/ogg_src/ggsci > $logfile #------------------------# # Check for ABEND errors # #------------------------# if [ `cat $logfile | grep ABENDED | grep -v grep | wc -l` -eq 0 ] then echo "No ABENDED process." else echo "GoldenGate Process ABENDED on $ORACLE_HOST_NAME for database $ORACLE_SID" cat $logfile | mailx -s "GoldenGate Process ABENDED on $ORACLE_HOST_NAME for database $ORACLE_SID" $DBA_EMAIL #cat $logfile | mailx -s "TEST MAIL on $ORACLE_HOST_NAME for database $ORACLE_SID" $DBA_EMAIL fi |
Keep Script in Crontab :
1 2 3 |
[root@AWS! ~]# crontab -l 5 * * * * /oracle/home/GG_Abend.sh > /dev/null 2>&1 |
The above script will execute for every 5 minutes Now check Output file in… Read More
There is no excerpt because this is a protected post.
There is no excerpt because this is a protected post.
There is no excerpt because this is a protected post.
There is no excerpt because this is a protected post.
There is no excerpt because this is a protected post.
There is no excerpt because this is a protected post.