--查找等待事件
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/