Re: Calculating Physical memory for Oracle Sessions

  • From: Tim Gorman <tim@xxxxxxxxx>
  • To: VIVEK_SHARMA@xxxxxxxxxxx
  • Date: Thu, 07 Dec 2006 18:28:44 -0700

Sure!  Sorry for the delay in responding...

If the listserver strips the attachments, then email me off-line...



VIVEK_SHARMA wrote:

Hi Tim

 

Could you possibly Share the HPUX Custom Built script please?

 

Thanks indeed

 

Vivek

 


From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Tim Gorman
Sent: Thursday, November 30, 2006 9:51 AM
To: ORACLE-L
Cc: anuragdba@xxxxxxxxx
Subject: Re: Calculating Physical memory for Oracle Sessions

 

Anurag,

I have this shell script named "oramem.sh" posted online at http://www.EvDBT.com/tools.htm.  It was originally written for Solaris using the excellent "pmap" utility.  It can work with Linux if the SYSSTAT rpms are installed, which include "pmap".  I have an alternate version for HPUX that uses some custom-built "C" programs.  I don't have a version for AIX at all, as I haven't found anything similar to "pmap" on AIX.

Hope this helps...

--
Tim Gorman
consultant - Evergreen Database Technologies, Inc.
 
website = http://www.evdbt.com
email   = tim@xxxxxxxxx
mobile  = +1-303-885-4526
fax     = +1-303-484-3608



Anurag Verma wrote:

Hi All,


My 9.2.0.7 database has an sga size of 1.3 GB and the RAM size is 4096 MB.

We were facing a problem of memory contention yesterday due to the increased number of sessions/connections to the database.

96% of the Physical memory and 94-95% of virtual memory was used, when checked the processes in the IBM AIX server.

So when the number of sessions increased, listener stopped receiving newer connections.

The ever increasing number of sessions were taking up the memory.

Latch free contention was there and found library cache latch stats were showing large number of sleeps.

If we need to increase shared pool, memory was not available.

One option we are planning is to increase the physical memory.


So my question is how do we determine the size of the memory used for Oracle sessions.

Say for adding another 100 sessions, how much memory will it take, so that it will help us in adding more RAM in to the server.


Thanks for your thoughts on this.

Anurag

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

X bitmap

#!/bin/ksh
#
integer _SumMaxShrVM=0
integer _SumSumPrvVM=0
#
for _PID in `ps -eaf|grep -v oracle|grep -v grep|awk '{print $2}'`
do
        pstatvm_size ${_PID} | tail -1 | sed 's/K//g' | \
        while read _P _ShrVM _ShrRAM _PrvVM _PrvRAM _Comments
        do
                if (( $# > 0 ))
                then
                        echo "\tPID=${_P} ShrVM=${_ShrVM}Kb PrvVM${_PrvVM}Kb"
                fi
                integer _SumPrvVM=${_SumPrvVM}+${_PrvVM}
                integer _SumShrVM=${_SumShrVM}+${_ShrVM}
        done
done
echo "SumShrVM=${_SumShrVM}Kb SumPrvVM=${_SumPrvVM}Kb"

#!/bin/ksh
#
integer _SumMaxShrVM=0
integer _SumSumPrvVM=0
#
echo "ORACLE_SID MaxShrVM SumPrvVM" | \
        awk '{printf("%12s\t%12s\t%12s\n",$1,$2,$3)}'
echo "---------- -------- --------" | \
        awk '{printf("%12s\t%12s\t%12s\n",$1,$2,$3)}'
for _OraSid in `ps -eaf | grep pmon | sed 's/ora_apps/oraapps/' | grep -v grep 
| awk -F_ '{print $3}'`
do
        #
        integer _MaxShrVM=0
        integer _SumPrvVM=0
        for _PID in `ps -eaf|grep ${_OraSid}|grep -v grep|awk '{print $2}'`
        do
                pstatvm_size ${_PID} | tail -1 | sed 's/K//g' | \
                while read _P _ShrVM _ShrRAM _PrvVM _PrvRAM _Comments
                do
                        if (( $# > 0 ))
                        then
                                echo "\tPID=${_P} ShrVM=${_ShrVM} 
PrvVM${_PrvVM}"
                        fi
                        integer _SumPrvVM=${_SumPrvVM}+${_PrvVM}
                        if (( ${_MaxShrVM} < ${_ShrVM} ))
                        then
                                integer _MaxShrVM=${_ShrVM}
                        fi
                done
        done
        integer _SumMaxShrVM=${_SumMaxShrVM}+${_MaxShrVM}
        integer _SumSumPrvVM=${_SumSumPrvVM}+${_SumPrvVM}
        echo "${_OraSid} ${_MaxShrVM} ${_SumPrvVM}" | \
                awk '{printf("%12s\t%12d\t%12d\n",$1,$2,$3)}'
done
#
integer _SumVM=${_SumMaxShrVM}+${_SumSumPrvVM}
echo "---------- -------- --------" | \
        awk '{printf("%12s\t%12s\t%12s\n",$1,$2,$3)}'
echo "${_SumMaxShrVM} ${_SumSumPrvVM} ${_SumVM}" | \
        awk '{printf("            \t%12d\t%12d\tTotal=%d\n",$1,$2,$3)}'

X bitmap

Other related posts: