注意:如果Level过大的话会产生大量的跟踪文件并影响系统的I/O性能,Oracle建议不要采用3级以上的跟踪。
以sysdba 登录
oradebug setmypid
oradebug unlimit
oradebug -g all hanganalyze 3
oradebug -g all dump systemstate 266
--等待2min
oradebug -g all hanganalyze 3
oradebug -g all dump systemstate 266
默认搜集数据的步骤如下:
1 hanhanalyze level 3
2 systemstate level 266
3 wait 60 sec
4 hanhanalyze level 3
5 systemstate level 266
对于单实例 trace file 文件在 本地的user_dump_desttination
对于rac 环境 trace file 文件在每个节点的 backgroup_dump_destination
九 获取v$性能数据
SPOOL v_views.log;
/*set linesize 130
col "Parameter" form. a50
col "Session Value" form. a30
col "Instance Value" form. a30
*/
select a.ksppinm "Parameter",
b.ksppstvl "Session Value",
c.ksppstvl "Instance Value"
from x$ksppi a, x$ksppcv b, x$ksppsv c
where a.indx = b.indx
and a.indx = c.indx
order by 1 ;
SELECT class , value, name FROM v$sysstat;
SELECT sid , id1, id2, type, lmode, request FROM v$lock;
SELECT l.latch#,
n.name,
h.pid,
l.gets,
l.misses,
l.immediate_gets,
l.immediate_misses,
l.sleeps
FROM v$latchname n, v$latchholder h, v$latch l
WHERE l.latch# = n.latch#
AND l.addr = h.laddr(+);
SELECT * FROM v$session_wait ORDER BY sid ;
/* repeat last query 3 times - we want to see who's repeatedly waiting*/
SPOOL OFF;
获取了数据之后 就是分析了!!