RAC故障診斷指令碼

jelephant發表於2015-10-27
--查詢等待事件
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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章