您好,登录后才能下订单哦!
--查看最耗磁盘读写率的磁盘语句
select *
from (select v.sql_id,
v.child_number,
v.sql_text,
v.elapsed_time,
v.cpu_time,
v.disk_reads,
rank() over(order by v.disk_reads desc) elapsed_rank
from v$sql v) a
where elapsed_rank <= 10;
--查看产生表锁的语句,可以的到SID号
select * from v$lock where type='TX';
--查看会话,根据SID和serial#字段可以断开该会话
select * from v$session where sid=147;
select * from v$session where sid=138;
--查看产生死锁的机器
select username,sid,serial#,lockwait,status,machine,program from v$session where sid in
(select session_id from v$locked_object)
--断开该会话
alter system kill session '138,45';
--查看产生死锁的SQL语句
select sql_text from v$sql where hash_value in
(select sql_hash_value from v$session where sid in
(select session_id from v$locked_object))
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。