Home >Database >Mysql Tutorial >在AIX系统根据Oracle进程pid查询sql语句

在AIX系统根据Oracle进程pid查询sql语句

WBOY
WBOYOriginal
2016-06-07 17:04:011542browse

1、 在AIX系统中用TOPAS命令查看发现user中的cpu过高,其中Oracle的进程CPU比较高。比如Oracle其中最高的进程pid为1138782 占CP

1、 在AIX系统中用TOPAS命令查看

发现user中的cpu过高,,其中Oracle的进程CPU比较高。

比如Oracle其中最高的进程pid为1138782  占CPU 27%

2、 根据pid查出sid,serial#

selects.sid,s.serial#fromv$session s,v$process p
      wheres.paddr=p.addrandp.spid='1138782'

比如sid,serial#为482,56767

3、 根据sid查出SQL语句

SELECT  sql_text
   FROMv$sqltext a
  WHEREa.hash_value = (SELECTsql_hash_value
                          FROMv$session b
                         WHEREb.SID ='&sid')
ORDERBYpieceASC

输入sid为482 查出sql语句

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn