• 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


376 views

Recent Posts

See All

Reclaim Unused Space in Oracle

Over a period of time, updates and deletes on objects within a tablespace can create pockets of empty space that individually are not large enough to be reused for new data. This type of empty space i

Install Oracle 12c Golden Gate on Oracle Linux

In this article we will look at the steps to install oracle 12c Golden Gate on Oracle Enterprise Linux 6.5. The steps involved are: Virtual Machine Setup Install Oracle 12c Database Install Oracle 12c

Single Table Replication – Same Schema

In this article, we will be looking at single table replication using Oracle Golden Gate where the schema name is the same on both source and target database. Create Sample Table Test Replication Stop