一聚教程网:一个值得你收藏的教程网站

热门教程

oracle监听服务和访问连接原理详解

时间:2022-06-29 09:50:31 编辑:袖梨 来源:一聚教程网


--查看最耗磁盘读写率的磁盘语句
 
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))

热门栏目