Home » RDBMS Server » Server Administration » discover Oracle 8i bg process sid on Windows NT
discover Oracle 8i bg process sid on Windows NT [message #59893] Thu, 01 January 2004 22:35 Go to next message
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 Go to previous messageGo to next message
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 #59901 is a reply to message #59899] Fri, 02 January 2004 04:58 Go to previous messageGo to next message
Marco Schepers
Messages: 3
Registered: January 2004
Junior Member
thanks for you reaction, but i need to know some more.
in performance monitor, i will add object : thread, item : % processor time.
which column from your query corresponds with the column instance of your performance monitor?
Re: discover Oracle 8i bg process sid on Windows NT [message #59904 is a reply to message #59901] Fri, 02 January 2004 05:45 Go to previous messageGo to next message
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 Go to previous message
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
Previous Topic: FUZZY value always a YES
Next Topic: oracle9iodbc error
Goto Forum:
  


Current Time: Fri Sep 20 10:22:34 CDT 2024