1836512 Members
2141 Online
110101 Solutions
New Discussion

Re: Check the process

 
hanyyu1
Advisor

Check the process

If I want to check the process ( eg. the process name is "oraapp" ) in the system that have already submitted over 15 minutes , includes the process status is sleep or running , what can I do ? thx
18 REPLIES 18
RAC_1
Honored Contributor

Re: Check the process

ps -Coraapp -o pid,ruser,state,args
There is no substitute to HARDWORK
guna_1
Advisor

Re: Check the process

Just Try

ps -lf | grep oraapp ,

The second column will give the status of the server.

Regards,
Guna
hanyyu1
Advisor

Re: Check the process

Hi Quna ,

I am not want to check the status , if I want to check the pid , what can I do ? thx.
RAC_1
Honored Contributor

Re: Check the process

UNIX95= ps -Coraapp -o pid,ruser,state,args

This will give what you want.
There is no substitute to HARDWORK
hanyyu1
Advisor

Re: Check the process

thx RAC,

if I want ps -C , it seems no such option .

ps -C
ps: illegal option -- C
usage: ps [-edaflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup]
Sivakumar TS
Honored Contributor

Re: Check the process


Hi,

execute

#ps -ef | grep

This will give the following details about the process.

UID PID PPID C STIME TTY TIME COMMAND

Example:

root 0 0 0 Dec 9 ? 0:04 swapper


With Regards,

Siva.


Nothing is Impossible !
RAC_1
Honored Contributor

Re: Check the process

That would require to do following first
UNIX95=1

ps -Coraapp -o pid,state,ruser,args
There is no substitute to HARDWORK
Arunvijai_4
Honored Contributor

Re: Check the process

# ps -elf|grep -i "ora" will give you.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Frank de Vries
Respected Contributor

Re: Check the process

Indeed keep it simple
you can just do

ps -ef | grep oraap

However, I wondered if it concerned an
Oracle process you can check if
the connection was set up in Oracle

select p.spid
s.username,
p.spid, s.sid, s.serial# , s.program
from v$session s, v$process p
where s.paddr = p.addr
and s.type = 'USER'

and then find your spid (=)
and use this in your unix grep:

ps -ef | grep


Look before you leap
hanyyu1
Advisor

Re: Check the process

thx all ,

it is not oracle process .

if use ps -elf|grep -i "ora" or ps -ef , it only show the CPU process time of the process , if I want to know the process that have submitted ( from the submit time to current time )is over 15 minutes , even it only run within 1 second in term of CPU , what can I do ? thx.
Frank de Vries
Respected Contributor

Re: Check the process

Hi
Are you using hpux versions 10.20 or 11.i ?
Because on my systems a ps-ef
orapic 1619 1 0 09:16:42 ? 0:25 oracleP01 (LOCAL=NO)
where the 2nd column is the pid and 0:25
is the cpu time clocked up.

The most extended ps I can run is
[root@orasrv1:]/root<>>> ps -eld| grep R
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME COMD
1003 R 0 36 0 0 152 20 43fcb800 0 - ? 6:38 vxfsd

The capital R means it is running,
if it is S it is sleeping.

Do you have top ?
You can output to a file top -f
Although that maybe not so handy,
as it displays the big procs first.

Let me know if it is this that you want ?
want. We can dig deeper.
rgds,






Look before you leap
Frank de Vries
Respected Contributor

Re: Check the process

Hi
Are you using hpux versions 10.20 or 11.i ?
Because on my systems a ps-ef

orapic 1619 1 0 09:16:42 ? 0:25 oracleP01 (LOCAL=NO)
where the 2nd column is the pid and 0:25
is the cpu time clocked up.

You can easily script that when
a command started with the date
command , how long this is going on for.

The most extended ps I can run is
[root@orasrv1:]/root<>>> ps -eld| grep R
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME COMD
1003 R 0 36 0 0 152 20 43fcb800 0 - ? 6:38 vxfsd

The capital R means it is running,
if it is S it is sleeping.

Do you have top ?
You can output to a file top -f
Although that maybe not so handy,
as it displays the big procs first.

Let me know if it is this that you want ?
want. We can dig deeper.
Because I am not entirely sure this is what
you want.
rgds,




Look before you leap
Frank de Vries
Respected Contributor

Re: Check the process

Hi

Sorry to be so strict, but as you
are a relative new member it is better
to be told in the beginning.

Noticed that you have never ever
allocated any points to any of the 36 responses to your questions.

Even if ou get ananswer that is not helpfull,
it is etiquette to allocate points :
I paste the rules for your info:
As you assign points, please keep in mind the scale that applies:

N/A: The answer was simply a point of clarification to my original question

1-3: The answer didn't really help answer my question but thanks for your assistance!

4-7: The answer helped with a portion of my question, but I still need some additional help.

8-10: The answer has solved my problem completely! Now I'm a happy camper!


Thanks for taking your time
to read this


Look before you leap
hanyyu1
Advisor

Re: Check the process

thx all replies ,

I will explain my question clearly , what I want is to find the process(es) which are submitted over 15 minutes , is it possible ? thx .
Muthukumar_5
Honored Contributor

Re: Check the process

Yes.

UNIX95= ps -ef -o time,pid,comm | grep -v 'TIME' | sort -rnk 1 | awk -F: '{ if ($1>15) { print; }}'

Is it giving what do you want?

-Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: Check the process

To get state of process then,

UNIX95= ps -ef -o time,pid,comm,state | grep -v 'TIME' | sort -rnk 1 | awk -F: '{ if ($1>15) { print; }}'

-Muthu
Easy to suggest when don't know about the problem!
RAC_1
Honored Contributor

Re: Check the process

Looks like you are confused between elapsed time (time since process was started) and cpu time taken by process.

Folloing are the details that you can get
etime - elapsed time
stime - start time of process
time - commulative time.

In first case (elapsed time), you need to do as follows.

UNIX95= ps -C"exact_process_name" -o pid,etime,ruser,args

There is no substitute to HARDWORK
hanyyu1
Advisor

Re: Check the process

thx Muthukumar ,

your script is excellent , but it seems not find the process which over 15 minutes ? isn't it ? thx