RAC故障诊断脚本

--查找等待事件
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博客 ” ,链接:http://blog.itpub.net/29337971/viewspace-1816616/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29337971/viewspace-1816616/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值