服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > 数据库技术 > Oracle技术 > Oracle开发 > 查看文档

如何在window nt系统中监测oracle进程

与windows nt系统相比,在unix环境下对每个oracle进程监视其cpu使用率是很容易的。在nt系统中,只有一个oracle进程(即,oracle.exe)。在windows环境下,为了得到oracle进程的每个线程的状态,可以使用quick slice,一个基于“图形用户界面”的独立程序。它可以从microsoft网站上免费下载。该软件适用于所有windows环境下的oracle 8i和9i。下面是使用它的方法:

◆1.首先,你需要找出运行oracle所对应的所有线程的id号。

sql> 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;

下面是输出结果:

thread id     backg user name   os user     status    session id serial no.
os program
------------ ----- ---------- ---------- -------- ---------- ----------

20229         pmon              oracle      active             1           1
oracle@db02.s0.gc.media.com (pmon)
20231         dbw0              oracle      active             2           1
oracle@db02.s0.gc.media.com (dbw0)
20233         lgwr              oracle      active             3           1
oracle@db02.s0.gc.media.com (lgwr)
20235         ckpt              oracle      active             4           1
oracle@db02.s0.gc.media.com (ckpt)
20237         smon              oracle      active             5           1
oracle@db02.s0.gc.media.com (smon)
20239         reco              oracle      active             6           1
oracle@db02.s0.gc.media.com (reco)
20241         arc0              oracle      active             7           1
oracle@db02.s0.gc.media.com (arc0)
20243         arc1              oracle      active             8           1
oracle@db02.s0.gc.media.com (arc1)
20245         dmon              oracle      active             9           1
oracle@db02.s0.gc.media.com (dmon)
18460               sys         oracle      active            17       22737
sqlplus@db02.s0.gc.media.com (tns v1-v3)
15700                          oracle      active            12           7
oracle@db02.s0.gc.sj.ipixmedia.com (lns0)

在本例中,线程号为20229的线程是pmon,线程号为20231的线程是dbw0,等等。

◆2.接下来,在"c:program filesresource kit."目录中双击文件qslice.exe

◆3.为了显示进程的每个线程,找到进程-oracle.exe并双击之。

另外一个图形窗口将弹出并显示所有的线程及其cpu使用情况。

◆4.为了识别这些线程,请将线程号(tid)列和前面的sql语句的线程号列想比较。为了匹配线程号(tid)和oracle进程id,你需要使用科学计算器将线程号(tid)由十六进制转化为十进制。

红色条代表该线程占用的内核时间;蓝色条代表该线程占用的用户时间。

扫描关注微信公众号