- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- getting number of processes and memory consumption
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2004 08:40 PM
тАО11-30-2004 08:40 PM
I've the requirement to create a job (script) which hourly get infos about the number of oracle-prozesses and the memory consumption of this processes.
Has anyone an idea how to do this?
Machine Setup: rp4440, HP/UX 11.11 64-Bit and iAS 10g (9.0.4).
kind regards
Christian
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2004 08:55 PM
тАО11-30-2004 08:55 PM
Re: getting number of processes and memory consumption
number of oracle processes:
ps -ef | grep -c oracle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2004 09:02 PM
тАО11-30-2004 09:02 PM
Re: getting number of processes and memory consumption
thanks for the answer. I know the ps -ef command. That is the easy part of the job. The difficult part is to get the memory consumption of these processes at a determined point of time and write the number and the memory consumption to a file. So I can create a history about the number of processes and how much memory these processses allocate.
regards
Christian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2004 09:06 PM
тАО11-30-2004 09:06 PM
SolutionIf you use ps, you will go into problems with shared memory segments appearing for each process as his memory. You will have to sum...
If you simply connect to Oracle and do two selects, you'll have all :
sqlplus "/ as sysdba" << EOF
select count(*) as "sessions" from v$session;
-- get sga size
select value as "sga"
from v$parameter
where name='sga_max_size';
-- get actual pga size
select value as "pga"
from v$pgastat
where name='total PGA allocated';
exit
EOF
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2004 09:12 PM
тАО11-30-2004 09:12 PM
Re: getting number of processes and memory consumption
I wrote a script ot totalize a user's total memory consumption:
Give the users name for argument ($1)
#!/usr/bin/ksh
USER=$1
let USERMEM=0;
let NEWUSERMEM=0;
UNIX95= ps -eo "pid ruser vsz=Kbytes" |grep $1| while read PID LINE USERMEM
do
echo $LINE" PID "$PID " Kbytes = "$USERMEM
let NEWUSERMEM=$USERMEM+$NEWUSERMEM
done
echo "Total $USER memory usage = " $NEWUSERMEM " Kbytes"
#
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2004 09:15 PM
тАО11-30-2004 09:15 PM
Re: getting number of processes and memory consumption
that's a good idea. My problem: The DB is on another machine. If I run the following statement in the DB:
select * from v$session where machine like 'iukweb%' and program like 'f90run%'
... where iukweb% are the two webservers und f90run% are the forms processes (would count forms-processes). Can I use this and count the memory values in v$process to get the summary of memory allocation of this processes in the webserver-machine?
regards
Christian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2004 09:30 PM
тАО11-30-2004 09:30 PM
Re: getting number of processes and memory consumption
This script won't work, as long as it doesn't deal with shared memory. In Christian's case, you should substract shared memory part from each vsz and then add it once.
Christian,
Adding the two clauses will effectively restrict to the sessions you want.
Still the point of memory consumption : Script I gave shows you total memory comsumption for Oracle instance. As long as SGA and PGA are pools common to all the processes, you cannot isolate some process to determine how much memory it uses...
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2004 01:21 AM
тАО12-01-2004 01:21 AM
Re: getting number of processes and memory consumption
I think that I can't isolate SGA and PGA memory for every process too.
If I look in my unix system (by TOP) I find some processes like the following:
ias904 7676 11339 0 10:59:45 ? 0:47 /oracle/product/web/9.0.4/bin/f90webm server webfile=HTTP-0,0,0
I will count the number and the memory consumption of this processes. I can't use Victor's script because there are other processes started by user "ias904".
There's no database installed on the webserver-machine. Maybe there's a unix tool to show the memory consumption like GLANCE?!?!?
regards
Christian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2004 01:46 AM
тАО12-01-2004 01:46 AM
Re: getting number of processes and memory consumption
To find specific process names, always use the -C option as this is an exact match by name (no grep). To enable -C, temporarily define the UNIX95 variable as in:
UNIX95= ps -f -C sh
Finally, shared memory is very complex to assign ownership. The -o vsz option will show Kbytes of local RAM but shared memory is, well, shared. So you'll have to use ipcs -bmop to show the memory used by processes that use shared memory.
NOTE: Using all the RAM (ie, glance shows 100%) is not a bad thing at all. Only when the page-out rate is more than single digits over several minutes is memory usage high and affecting processing speed.
Look at the kernel parameter dbc_max_pct and make sure it is not 50 (1/2 of RAM). Glance will also show you the buffer cache size. Limit the buffer cache to about 400-600 megs, whatever % that is for your RAM size.
To get a picture of the biggest processes (RAM usage), use this basic list:
UNIX95= ps -o vsz,ruser,pid,args | sort -rn
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2004 05:58 PM
тАО12-01-2004 05:58 PM
Re: getting number of processes and memory consumption
kind regards
Christian