[ back to toc ]

Unix process

Date: 2002/03/26 09:16

Q:
Hi,

I have some problems in identifying the Unix process with ps -ef command

Some of the Oracle client connections are really confusing.

I am unable to track which user is connected to the database, their
machine name/ip adress, process they are running, Whether the connection
is still active or not ?

eg : ps -ef command displays as below

oracle 20983 1 0 04:30:09 ? 0:01 oracleCDF ( LOCAL=NO)

daemon 29908 29903 0 Feb 27 ? 559:18 oracleCDF (DESCRIPTION=(LOCAL=YES)
(ADDRESS=(PROTOCOL=beq))

My questions

1. How do I know this process are not hung

2. What question mark means (?)

3. How do I know which client is related to each Process ID ( eg: 20983,
29904 )

4. Is it possible to know the memory occupied by each process

5. Is it possible to check which process are they executing

Hope you can clear the above at the earliest.

Regards

*NAME-DELETED*
A:
Dear *NAME-DELETED*,

unfortunately I can not answer your question due to two reasons:

1. Lack of my knowledge. I volunteered to answer Perl/CGI, and C
programming questions, and this is none of those. I have some knowledge of
the issues, however and therefore I dare tell you some things (see later).

2. Your question is not precise enough.

Therefore all I can do are:

1. Give you advice how to ask a UNIX expert in a more precise manner, thus
he/she can answer you without or with less ask-back.

2. Tell you some thoughts that came up in my mind reading your questions
that may help you understand some underlying things and thus ease finding
the answer to your problem.

Here it goes:

First of all, 'ps' command varies on different platform and as such it is
extremely important to specify the UNIX platform you use. Is it Linux,
Solaris, Tru64, AIX, HPUX or some other UNIX flavour? A UNIX expert will
certainly need this information to answer your question.

Your 'ps -ef' output seems to be weird to me. 'ps -ef' output usually
looks like

verhas@verhaslinux:~$ ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Feb19 ? 00:00:05 init [2]
root 2 1 0 Feb19 ? 00:00:00 [kflushd]
root 3 1 0 Feb19 ? 00:00:12 [kupdate]
root 4 1 0 Feb19 ? 00:00:00 [kswapd]
root 5 1 0 Feb19 ? 00:00:00 [keventd]
daemon 77 1 0 Feb19 ? 00:00:00 /sbin/portmap
root 131 1 0 Feb19 ? 00:00:01 /sbin/syslogd
root 133 1 0 Feb19 ? 00:00:00 /sbin/klogd
root 139 1 0 Feb19 ? 00:00:00 /sbin/rpc.statd
root 148 1 0 Feb19 ? 00:00:00 /usr/sbin/inetd
root 162 1 0 Feb19 ? 00:00:00 sh /usr/bin/safe_mysqld
mysql 175 162 0 Feb19 ? 00:00:00
/usr/sbin/mysqld --pid-file=/var/run/mysqld/mysqld.pid
mysql 177 175 0 Feb19 ? 00:00:00
/usr/sbin/mysqld --pid-file=/var/run/mysqld/mysqld.pid
mysql 178 177 0 Feb19 ? 00:00:00
/usr/sbin/mysqld --pid-file=/var/run/mysqld/mysqld.pid
postgres 189 1 0 Feb19 ? 00:00:00
/usr/lib/postgresql/bin/postmaster -b /usr/lib/postgresql/bin/postgres -B
128 -D /va
root 193 1 0 Feb19 ? 00:03:40 /usr/sbin/nmbd -D
root 195 1 0 Feb19 ? 00:00:00 /usr/sbin/smbd -D
root 202 1 0 Feb19 ? 00:00:27 /usr/sbin/sshd
root 205 1 0 Feb19 ? 00:00:00 /usr/bin/X11/xfs
nobody 211 1 0 Feb19 ? 00:00:00 proftpd (accepting
connections)
daemon 214 1 0 Feb19 ? 00:00:00 /usr/sbin/atd
root 217 1 0 Feb19 ? 00:00:00 /usr/sbin/cron
root 222 1 0 Feb19 ? 00:00:00 /usr/sbin/apache
root 227 1 0 Feb19 ? 00:00:00 /usr/bin/X11/xdm
root 228 1 0 Feb19 tty1 00:00:00 /sbin/getty 38400 tty1
root 229 1 0 Feb19 tty2 00:00:00 /sbin/getty 38400 tty2
root 230 1 0 Feb19 tty3 00:00:00 /sbin/getty 38400 tty3
root 231 1 0 Feb19 tty4 00:00:00 /sbin/getty 38400 tty4
root 232 1 0 Feb19 tty5 00:00:00 /sbin/getty 38400 tty5
root 233 1 0 Feb19 tty6 00:00:00 /sbin/getty 38400 tty6
root 4245 1 0 Feb21 ? 00:00:06 /usr/sbin/lpd
root 1058 227 0 Mar22 ? 00:00:00 /usr/bin/X11/X
vt7 -deferglyphs 16 -auth /var/lib/xdm/authdir/authfiles/A:0-fmuUFd
root 1059 227 0 Mar22 ? 00:00:00 -:0
www-data 4693 222 0 Mar24 ? 00:00:00 /usr/sbin/apache
www-data 4694 222 0 Mar24 ? 00:00:00 /usr/sbin/apache
www-data 4695 222 0 Mar24 ? 00:00:00 /usr/sbin/apache
www-data 4696 222 0 Mar24 ? 00:00:00 /usr/sbin/apache
www-data 4697 222 0 Mar24 ? 00:00:00 /usr/sbin/apache
root 21403 1 0 Mar25 ? 00:00:00 /usr/bin/sbhttpd -start
root 21404 21403 0 Mar25 ? 00:00:00 /usr/bin/sbhttpd -start
root 21405 21404 0 Mar25 ? 00:00:00 /usr/bin/sbhttpd -start
root 21406 21404 0 Mar25 ? 00:00:00 /usr/bin/sbhttpd -start
root 21407 21404 0 Mar25 ? 00:00:00 /usr/bin/sbhttpd -start
root 21408 21404 0 Mar25 ? 00:00:00 /usr/bin/sbhttpd -start
root 21409 21404 0 Mar25 ? 00:00:00 /usr/bin/sbhttpd -start
root 21748 202 0 08:52 ? 00:00:00 /usr/sbin/sshd
verhas 21749 21748 0 08:52 pts/1 00:00:00 -bash
verhas 21753 21749 0 09:15 pts/1 00:00:00 ps -ef
verhas@verhaslinux:~$

as I copied it from your my screen. When you ask a question copy/paste the
screen output.

To know what client is connecting to what port is nothing to do with 'ps'.
You certainly have to use some different program. I do not know which one.

To know the memory consumed by processes you can use some other ps option.
On Linux for example you should use the command 'top'.

Regards,
Peter

[ back to toc ]