ITPub博客

首页 > 数据库 > Oracle > RAC故障诊断脚本

RAC故障诊断脚本

原创 Oracle 作者:jelephant 时间:2015-10-27 15:38:43 0 删除 编辑
--查找等待事件
select inst_id,event,count(*) 
from gv$session
where username is not null
group by inst_id,event
having count(*)>1
order by 2,1;

--分析执行计划
explain plan for
 select * from tab;
select * from table(dbms_xplan.display);

--查询索引
select index_name,column_name,column_position
from dba_ind_columns
where table_name='';

--查询表统计信息
select column_name,num_distinct,density
from dba_tab_columns
where table_name=''
and column_name='';

--查询锁住的会话
select inst_id,sid
from gv$lock
wehre id1 =
(select object_id
from dba_objects
where owner=''
and object_name=''
and object_type='');

--删除会话
select 'kill -9'||spid
from v$process
where add in
(select paddr
from v$session a,v$lock b
where a.sid=b.sid
and id1=
(select object_id
from dba_objects
where owner=''
and object_name=''
and object_type=''
));

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29337971/viewspace-1816616/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 整理表碎片
下一篇: 监控数据库脚本
请登录后发表评论 登录
全部评论

注册时间:2013-12-07

  • 博文量
    143
  • 访问量
    681873