- 论坛徽章:
- 0
|
Oracle诊断案例-如何诊断和解决CPU高度消耗(100%)的数据库问题
4.连接数据库,找到问题sql及进程
通过Top中我们观察到的PID,进而应用我的getsql脚本,我们得到以下结果输出.
- $ sqlplus "/ as sysdba"
- SQL*Plus: Release 9.2.0.3.0 - Production on Mon Dec 29 10:52:14 2003
- Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
- Connected to:
- Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
- With the Partitioning, OLAP and Oracle Data Mining options
- JServer Release 9.2.0.3.0 - Production
- SQL>; @getsql
- Enter value for spid: 20521
- old 10: where c.spid = '&pid'
- new 10: where c.spid = '20521'
- SQL_TEXT
- ----------------------------------------------------------------
- select * from (select VC2URL,VC2PVDID,VC2MOBILE,VC2ENCRYPTFLAG,S
- ERVICEID,VC2SUB_TYPE,CISORDER,NUMGUID,VC2KEY1, VC2NEEDDISORDER,V
- C2PACKFLAG,datopertime from hsv_2cpsync where datopertime<=sysda
- te and numguid>;70000000000308 order by NUMGUid) where rownum<=20
复制代码 |
|