字典

锁,enqueue

select * from dba_lock;
select * from dba_lock_internal;

---------------------------------------

统计

select * from v$sysstat;
--会话断开,所有的统计在sysstat中更新
select * from v$sysstat order by class;
select * from v$sysstat where class="64" order by name;
select * from v$sysstat where statistic# between 633 and 635;

select * from v$session where type='USER' order by sid;
select * from v$session where username='KYC_ACC';
--找出一个会话id,sid

select * from v$sesstat;
--再在一个sid对应679个统计名
select sid from v$sesstat group by sid;
select * from v$sesstat where sid=16;
select * from v$statname;

--加字段,以便信息更全
SELECT
a1.*,
a2.name,
a3.schemaname
FROM
v$sesstat a1
LEFT JOIN v$statname a2 ON a1.statistic# = a2.statistic#
left join v$session a3 on a1.sid=a3.sid
WHERE
a1.sid = 16;

 

-------------------------------------------

上一篇:kobject: '(null)' (00000000bbe09fa2): is not initialized, yet kobject_put() is being calle


下一篇:linux环境下排查cpu占比高的MySQL数据库sql语句