discover Oracle 8i bg process sid on Windows NT [message #59893] |
Thu, 01 January 2004 22:35 |
Marco Schepers
Messages: 3 Registered: January 2004
|
Junior Member |
|
|
Every now and then, the process oracle.exe consumes a 100% CPU on our Windows NT system.
I would like to discover which thread in this process takes the CPU.
Is there any possibility to compare the thread id's in performance monitor with the sid's in oracle?
|
|
|
Re: discover Oracle 8i bg process sid on Windows NT [message #59899 is a reply to message #59893] |
Fri, 02 January 2004 03:40 |
Thiru
Messages: 1089 Registered: May 2002
|
Senior Member |
|
|
Hi
Get the thread IDs using the following query
select vb.name NAME, vp.program PROCESSNAME, vp.spid THREADID, vs.sid SID
from v$session vs, v$process vp, v$bgprocess vb
where vb.paddr <> '00' and
vb.paddr = vp.addr and
vp.addr = vs.paddr;
or
select p.spid "Thread ID",
b.name "Background Process",
s.username "User Name",
s.osuser "OS User",
s.status "STATUS",
s.sid "Session ID",
s.serial# "Serial No.",
s.program "OS Program"
from v$process p, v$bgprocess b, v$session s
where s.paddr = p.addr and b.paddr(+) = p.addr;
and then use Qslice or Perfmon to find out which thread is consuming how much CPU.
|
|
|
|
Re: discover Oracle 8i bg process sid on Windows NT [message #59904 is a reply to message #59901] |
Fri, 02 January 2004 05:45 |
Thiru
Messages: 1089 Registered: May 2002
|
Senior Member |
|
|
The instance column actually doesnt matchup with any of the columns of the query. They are just a sequence of integers Windows assigns as the threads within the process increases. You will need to get the THREADID of the program you are interested in troubleshooting,by issuing those queries.
Then,you will need to first add Thread object and Thread ID counter and choose each of of the Oracle/nn instances to get the THREADID in the LAst,Min,Avg fields on the perfmon graph,one by one. Once you have the right instance,that matches the threadID of interest, you can proceed to monitor the Processor time for that thread.
PS: I find this method not efficient too and maybe there are better methods that I am not aware of. Afterall I am a 99% Unix guy!
-Thiru
|
|
|
Re: discover Oracle 8i bg process sid on Windows NT [message #59906 is a reply to message #59904] |
Fri, 02 January 2004 08:01 |
Thiru
Messages: 1089 Registered: May 2002
|
Senior Member |
|
|
Followup :
Since you are reporting 100% CPU usage intermittantly,it could very well be a blocking lock which can be tracked down using $ORACLE_HOME/rdbms/admin/utllockt.sql script.
Irrespective of the platform,you can always check V$SQL for sql that consumes the most CPU_TIME,Buffer_gets,Disk_Reads,PARSE_CALLS etc.
For eg)
thiru@9.2.0:SQL>select s.sid,s.serial#,s.username,s.program,s.machine,t.sql_text
2 from v$session s,v$sql t where s.sql_address=t.address and s.sql_hash_value=t.hash_value
3 and s.type='USER'
4 order by
5 t.cpu_time desc;
-Thiru
|
|
|