• Arun Kumar

Golden Gate process memory

Each and every Golden Gate process takes approx 25 – 50 MB of memory or sometimes more depending upon the transactions.


Here is one script which will help you find the total memory usage on source and target server. This script is written for Linux:


Script

#!/bin/bash
###############################
# determine the OS type
###############################
OSNAME=`uname`
case "$OSNAME" in
  "SunOS")
    echo "OSNAME = $OSNAME"
    ;;
  "Linux")
    echo "OSNAME = $OSNAME"
    ;;
  "*")
    echo "This script has not been verified on $OSNAME"
    exit 1
    ;;
esac
###############################
# set the temp file
###############################
TMPFILE=/tmp/pmem.tmp
if [ -f $TMPFILE ]
then
  rm -f $TMPFILE
fi
################################
# loop over the gg process types
################################
PROCESSES="extract replicat"
for PROCESS in $PROCESSES
do
  FLAG=""
  FLAG=`ps -ef | grep $PROCESS`
  if [ -z "FLAG" ]
  then
    echo "No $PROCESS processes found"
  else
    echo
    echo "#####################################"
    echo "# Individual $PROCESS Process Usage #"
    echo "#####################################"
    case "$OSNAME" in
      "Linux")
        ps -C $PROCESS -O rss > $TMPFILE
        cat $TMPFILE | grep $PROCESS | awk '{print $2/1024, "MB", $12}' | sort -k 2
        ;;
      "SunOS")
        ps -efo vsz,uid,pid,ppid,pcpu,args | grep -v grep | grep $PROCESS > $TMPFILE
        cat $TMPFILE | grep $PROCESS | awk '{print $1/1024, "MB", $8}' | sort -k 2
        ;;
      "*")
        echo "This script has not been verified on $OSNAME"
        exit 1
        ;;
    esac
    rm -f $TMPFILE
    echo
    echo "#####################################"
    echo "#   Total $PROCESS Process Usage    #"
    echo "#####################################"
    case "$OSNAME" in
      "Linux")
        ps -C $PROCESS -O rss > $TMPFILE
        cat $TMPFILE | grep $PROCESS | awk '{count ++; sum=sum+$2; } END \
          { print "Number of processes      =",count; \
          print "AVG Memory usage/process =",sum/1024/count, "MB"; \
          print "Total memory usage       =", sum/1024,  " MB"}'
        ;;
      "SunOS")
        ps -efo vsz,uid,pid,ppid,pcpu,comm | grep -v grep | grep $PROCESS > $TMPFILE
        cat $TMPFILE | awk '{count ++; sum=sum+$1; } END \
          { print "Number of processes      =",count; \
          print "AVG Memory usage/process =",sum/1024/count, "MB"; \
          print "Total memory usage       =", sum/1024,  " MB"}'
        ;;
      "*")
        echo "This script has not been verified on $OSNAME"
        exit 1
        ;;
    esac
    rm -f $TMPFILE
  fi
done
exit 


Source server output

[oracle@ggprod gg]$ ./gg_memory_usage.sh
OSNAME = Linux
#####################################
# Individual extract Process Usage #
#####################################
34.5703 MB DP1
49.1172 MB EXT1
#####################################
#   Total extract Process Usage    #
#####################################
Number of processes      = 2
AVG Memory usage/process = 41.8438 MB
Total memory usage       = 83.6875  MB
#####################################
# Individual replicat Process Usage #
#####################################
#####################################
#   Total replicat Process Usage    #
#####################################
Number of processes      =
awk: cmd. line:2: fatal: division by zero attempted

Ignore the error at the end as there are not replicate details available on source server.


Target server output


The same script can be run on target server and it will give you the details of replicat

[oracle@ggdev gg]$ ./gg_memory_usage.sh
OSNAME = Linux
#####################################
# Individual extract Process Usage #
#####################################
#####################################
#   Total extract Process Usage    #
#####################################
Number of processes      =
awk: cmd. line:2: fatal: division by zero attempted
#####################################
# Individual replicat Process Usage #
#####################################
34.3008 MB REP1
#####################################
#   Total replicat Process Usage    #
#####################################
Number of processes      = 1
AVG Memory usage/process = 34.3008 MB
Total memory usage       = 34.3008  MB


38 views

Recent Posts

See All

Temp Tablespace utilization

It is very common that as a DBA you will encounter ‘ORA-1652: unable to extend temp segment’. Handling temporary tablespace is different than permanent tablespaces inside Oracle. On a high level, temp

Estimate flashback destination size

Sometimes application team will ask DBA to enable flashback for x number of days. In such case, a DBA needs to estimate the flashback space required for x number of days in order to store the flashbac

Datafile utilization check

When you want to shrink a datafile, you must always check the single datafile utilization. In case if you shrink datafile more than the used size, it will fail. Below query gives the datafile utilizat

  • Facebook
  • Twitter
  • YouTube
  • Instagram

© 2020 by DBA Genesis

Feedback