0
sess_temp_undo
emcs
46次下载
314次浏览
2019-07-24
4.5

脚本内容

--temp
COLUMN tablespace FORMAT A20 
COLUMN temp_size FORMAT A20 
COLUMN sid_serial FORMAT A20
COLUMN username FORMAT A20
COLUMN program FORMAT A40
SET LINESIZE 200
SELECT b.tablespace,
     ROUND(((b.blocks*p.value)/1024/1024),2)||'M' AS temp_size,
     a.sid||','||a.serial# AS sid_serial,
     NVL(a.username, '(oracle)') AS  username,
     a.program 
FROM   v$session a,
       v$sort_usage b,
       v$parameter p WHERE  p.name  = 'db_block_size'
 AND    a.saddr = b.session_addr 
ORDER BY b.tablespace, b.blocks;  

--undo
COLUMN sid_serial FORMAT A20
COLUMN username FORMAT A20
COLUMN program FORMAT A30
COLUMN undoseg FORMAT A25
COLUMN undo FORMAT A20
SET LINESIZE 120
SELECT TO_CHAR(s.sid)||','||TO_CHAR(s.serial#) AS sid_serial, 
       NVL(s.username, '(oracle)') AS username, 
       s.program, 
       r.name undoseg, 
       t.used_ublk * TO_NUMBER(x.value)/1024||'K' AS undo 
FROM   v$rollname    r, 
       v$session     s,
       v$transaction t,
       v$parameter   x 
WHERE  s.taddr = t.addr 
AND    r.usn   = t.xidusn(+) 
AND    x.name  = 'db_block_size';

评论

热门资源
热门脚本
近期活动
全部
暂无活动,敬请期待...
相关课程
全部
暂无课程,敬请期待...