1:使用vmstat和top查看系统cpu,io,内存使用情况
2:查看当前状态下存在的等待事件
select sid,event,p1,p2,seconds_in_wait from v$session_wait where event not like '%SQL%' and event not like 'rdbms%' and event not like '%message%' and event not like '%Streams AQ%' AND EVENT NOT LIKE '%slave%' order by event;
3:检查出现问题的语句
SQL> @sql_sid
Enter value for sid:
old 1:
select sql_text from v$sqltext where hash_value in(select decode(sql_hash_value,0,prev_hash_value,sql_hash_value) from v$session where sid='&sid') order by piece;
new 1: select sql_text from v$sqltext where hash_value in(select decode(sql_hash_value,0,prev_hash_value,sql_hash_value) from v$session where sid=’ ′) order by piece;
4: 检查问题语句的执行计划,查看执行计划是否正确
set autotrace traceonly
set autotrace on
5:如果执行计划不对:
(1):
分析表
exec dbms_stats.gather_table_stats(ownname => 'scott',tabname => 'work_list',estimate_percent => 10,method_opt=> 'for all indexed columns') ;
(2):分析想相关索引
。。。后续接着
阅读(2528) | 评论(0) | 转发(0) |