有一段这样的脚本,该怎么办?
set feedback on
column Username format A15
column Sid format 9990 heading 'SID'
column Type format A4
column LKmode format 990 heading 'HELD'
column LReques format 990 heading 'REQ'
column Id1 format 9999990
column Id2 format 9999990
break on Id1 skip 1 dup
select SN.Username,
M.Sid,
M.Type,
DECODE(M.Lmode, 0, 'None',
1, 'Null',
2, 'Row Share',
3, 'Row Excl.',
4, 'Share',
5, 'S/Row Excl.',
6, 'Exclusive',
M.Lmode, LTRIM(TO_CHAR(M.Lmode, '990'))) LKmode,
DECODE(M.Request, 0, 'None',
1, 'Null',
2, 'Row Share',
3, 'Row Excl.',
4, 'Share',
5, 'S/Row Excl.',
6, 'Exclusive',
M.Request, LTRIM(TO_CHAR(M.Request, '990'))) LRequest,
M.Id1, M.Id2
from V$SESSION SN, GV$LOCK M
where (SN.Sid=M.Sid
and M.Request!=0)
or(SN.Sid=M.Sid
and M.Request=0 and M.Lmode!=4
and (M.Id1, M.Id2) in
(select S.Id1, S.Id2
from GV$LOCK S
where S.Request!=0
and S.Id1=M.Id1
and S.Id2=M.Id2))
order by M.Id1, M.Id2, LRequest;
clear breaks
clear columns
set feedback on
column Username format A15
column Sid format 9990 heading 'SID'
column Type format A4
column LKmode format 990 heading 'HELD'
column LReques format 990 heading 'REQ'
column Id1 format 9999990
column Id2 format 9999990
break on Id1 skip 1 dup
select SN.Username,
M.Sid,
M.Type,
DECODE(M.Lmode, 0, 'None',
1, 'Null',
2, 'Row Share',
3, 'Row Excl.',
4, 'Share',
5, 'S/Row Excl.',
6, 'Exclusive',
M.Lmode, LTRIM(TO_CHAR(M.Lmode, '990'))) LKmode,
DECODE(M.Request, 0, 'None',
1, 'Null',
2, 'Row Share',
3, 'Row Excl.',
4, 'Share',
5, 'S/Row Excl.',
6, 'Exclusive',
M.Request, LTRIM(TO_CHAR(M.Request, '990'))) LRequest,
M.Id1, M.Id2
from V$SESSION SN, GV$LOCK M
where (SN.Sid=M.Sid
and M.Request!=0)
or(SN.Sid=M.Sid
and M.Request=0 and M.Lmode!=4
and (M.Id1, M.Id2) in
(select S.Id1, S.Id2
from GV$LOCK S
where S.Request!=0
and S.Id1=M.Id1
and S.Id2=M.Id2))
order by M.Id1, M.Id2, LRequest;
clear breaks
clear columns
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货