- 最后登录
- 2013-10-15
- 在线时间
- 24 小时
- 威望
- 26
- 金钱
- 238
- 注册时间
- 2012-2-3
- 阅读权限
- 10
- 帖子
- 17
- 精华
- 1
- 积分
- 26
- UID
- 197
|
11#
发表于 2012-2-23 16:03:46
看到定义中有“ksuseser”这一个子串,就用一下sql
select * from v$sqltext_with_newlines where sql_text like '%ksuseser%'
查询了一下,发现有几个sql
ADDRESS HASH_VALUE SQL_ID COMMAND_TYPE PIECE SQL_TEXT
---------------- ---------- --------------------------------------- ------------ ---------- ---------------
000000007A186B20 3659408693 5ax0q1md1w99p 3 0 select s.inst_i
000000007BFC8B08 2564233431 dc56d5kcdf66r 2 12 t = s.ksuseser
000000007BFD0BE8 3879835391 3d0537zmn35rz 2 14 om (select type
然后就了 SQL_ID=5ax0q1md1w99p 的那一个进行一下查询
select sql_id,sql_text from v$sqltext_with_newlines where sql_id='5ax0q1md1w99p' order by piece
其下出现有68个pieces。其中 v$sqltext_with_newlines 的sql_text为VARCHAR2(64),68*64=4352 > 4000
应该与v$fixed_view_definition的值多一些
SQL> select sql_id,sql_text from v$sqltext_with_newlines where sql_id='5ax0q1md1w99p' order by piece;
SQL_ID SQL_TEXT
-------------------- ----------------------------------------------------------------
5ax0q1md1w99p select s.inst_id,s.addr,s.indx,s.ksuseser,s.ksuudses,s.ksusepro,
5ax0q1md1w99p s.ksuudlui,s.ksuudlna,s.ksuudoct,s.ksusesow, decode(s.ksusetrn,h
5ax0q1md1w99p extoraw('00'),null,s.ksusetrn),decode(s.ksqpswat,hextoraw('00'),
5ax0q1md1w99p null,s.ksqpswat),decode(bitand(s.ksuseidl,11),1,'ACTIVE',0,decod
5ax0q1md1w99p e(bitand(s.ksuseflg,4096),0,'INACTIVE','CACHED'),2,'SNIPED',3,'S
5ax0q1md1w99p NIPED', 'KILLED'),decode(s.ksspatyp,1,'DEDICATED',2,'SHARED',3,'
5ax0q1md1w99p PSEUDO',4,'POOLED','NONE'), s.ksuudsid,s.ksuudsna,s.ksuseunm,s.
5ax0q1md1w99p ksusepid, s.ksusemnm,s.ksusemnp,s.ksusetid,s.ksusepnm, decode(bi
5ax0q1md1w99p tand(s.ksuseflg,19),17,'BACKGROUND',1,'USER',2,'RECURSIVE','?'),
5ax0q1md1w99p s.ksusesql, s.ksusesqh, s.ksusesqi, decode(s.ksusesch, 65535, t
5ax0q1md1w99p o_number(null), s.ksusesch), s.ksusesesta, decode(s.ksuseseid,
5ax0q1md1w99p 0, to_number(null), s.ksuseseid), s.ksusepsq, s.ksusepha, s.ks
5ax0q1md1w99p usepsi, decode(s.ksusepch, 65535, to_number(null), s.ksusepch),
5ax0q1md1w99p s.ksusepesta, decode(s.ksusepeid, 0, to_number(null), s.ksuse
5ax0q1md1w99p peid), decode(s.ksusepeo,0,to_number(null),s.ksusepeo), decode
5ax0q1md1w99p (s.ksusepeo,0,to_number(null),s.ksusepes), decode(s.ksusepco,0,
5ax0q1md1w99p to_number(null), decode(bitand(s.ksusstmbv, power(2,11))
5ax0q1md1w99p , power(2,11), s.ksusepco, to_number(null))), de
5ax0q1md1w99p code(s.ksusepcs,0,to_number(null), decode(bitand(s.ksuss
5ax0q1md1w99p tmbv, power(2,11)), power(2,11), s.ksusepcs, to_n
5ax0q1md1w99p umber(null))), s.ksuseapp, s.ksuseaph, s.ksuseact, s.ksuseach,
5ax0q1md1w99p s.ksusecli, s.ksusefix, s.ksuseobj, s.ksusefil, s.ksuseblk, s.ks
5ax0q1md1w99p useslt, s.ksuseorafn, s.ksuseltm, s.ksusectm,decode(bitand(s.ks
5ax0q1md1w99p usepxopt, 12),0,'NO','YES'),decode(s.ksuseft, 2,'SESSION', 4,'SE
5ax0q1md1w99p LECT',8,'TRANSACTIONAL','NONE'),decode(s.ksusefm,1,'BASIC',2,'PR
5ax0q1md1w99p ECONNECT',4,'PREPARSE','NONE'),decode(s.ksusefs, 1, 'YES', 'NO')
5ax0q1md1w99p ,s.ksusegrp,decode(bitand(s.ksusepxopt,4),4,'ENABLED',decode(bit
5ax0q1md1w99p and(s.ksusepxopt,8),8,'FORCED','DISABLED')),decode(bitand(s.ksus
5ax0q1md1w99p epxopt,2),2,'FORCED',decode(bitand(s.ksusepxopt,1),1,'DISABLED',
5ax0q1md1w99p 'ENABLED')),decode(bitand(s.ksusepxopt,32),32,'FORCED',decode(bi
5ax0q1md1w99p tand(s.ksusepxopt,16),16,'DISABLED','ENABLED')), s.ksusecqd, s.
5ax0q1md1w99p ksuseclid, decode(s.ksuseblocker,4294967295,'UNKNOWN', 4294967
5ax0q1md1w99p 294, 'UNKNOWN',4294967293,'UNKNOWN',4294967292,'NO HOLDER', 429
5ax0q1md1w99p 4967291,'NOT IN WAIT','VALID'),decode(s.ksuseblocker, 4294967295
5ax0q1md1w99p ,to_number(null),4294967294,to_number(null), 4294967293,to_numbe
5ax0q1md1w99p r(null), 4294967292,to_number(null),4294967291, to_number(null)
5ax0q1md1w99p ,bitand(s.ksuseblocker, 2147418112)/65536),decode(s.ksuseblocker
5ax0q1md1w99p , 4294967295,to_number(null),4294967294,to_number(null), 4294967
5ax0q1md1w99p 293,to_number(null), 4294967292,to_number(null),4294967291, to_
5ax0q1md1w99p number(null),bitand(s.ksuseblocker, 65535)), decode(s.ksusefblo
5ax0q1md1w99p cker,4294967295,'UNKNOWN', 4294967294, 'UNKNOWN',4294967293,'UN
5ax0q1md1w99p KNOWN',4294967292,'NO HOLDER', 4294967291,'NOT IN WAIT','VALID'
5ax0q1md1w99p ),decode(s.ksusefblocker,4294967295,to_number(null),4294967294,t
5ax0q1md1w99p o_number(null), 4294967293,to_number(null), 4294967292,to_number
5ax0q1md1w99p (null),4294967291, to_number(null),bitand(s.ksusefblocker, 2147
5ax0q1md1w99p 418112)/65536),decode(s.ksusefblocker,4294967295,to_number(null)
5ax0q1md1w99p ,4294967294,to_number(null), 4294967293,to_number(null), 4294967
5ax0q1md1w99p 292,to_number(null),4294967291, to_number(null),bitand(s.ksusef
5ax0q1md1w99p blocker, 65535)), w.kslwtseq,w.kslwtevt,e.kslednam,e.ksledp1,w.
5ax0q1md1w99p kslwtp1,w.kslwtp1r, e.ksledp2,w.kslwtp2,w.kslwtp2r,e.ksledp3,w.k
5ax0q1md1w99p slwtp3,w.kslwtp3r, e.ksledclassid,e.ksledclass#,e.ksledclass, de
5ax0q1md1w99p code(w.kslwtinwait, 0,decode(bitand(w.kslwtflags,256),
5ax0q1md1w99p 0,-2, decode(round(w.kslwtstime/10
5ax0q1md1w99p 000), 0,-1, round(
5ax0q1md1w99p w.kslwtstime/10000))), 0), decode(w.kslwtinwait,0,round((
5ax0q1md1w99p w.kslwtstime+w.kslwtltime)/1000000), round(w.kslwtstime/1000000
5ax0q1md1w99p )), decode(w.kslwtinwait,1,'WAITING', decode(bitand(w.kslwtflag
5ax0q1md1w99p s,256),0,'WAITED UNKNOWN TIME', decode(round(w.kslwtstime/1000
5ax0q1md1w99p 0),0,'WAITED SHORT TIME', 'WAITED KNOWN TIME'))),w.kslwtstime
5ax0q1md1w99p , decode(w.kslwtinwait,0,to_number(null), decode(bitand(w.kslwt
5ax0q1md1w99p flags,64),64,0,w.kslwttrem)), w.kslwtltime,s.ksusesvc, decode(bi
5ax0q1md1w99p tand(s.ksuseflg2,32),32,'ENABLED','DISABLED'),decode(bitand(s.ks
5ax0q1md1w99p useflg2,64),64,'TRUE','FALSE'),decode(bitand(s.ksuseflg2,128),12
5ax0q1md1w99p 8,'TRUE','FALSE'),decode(bitand(s.ksuseflg2,65536) + bitand(s.ks
5ax0q1md1w99p useflg2,131072),65536,'ALL EXEC',131072,'NEVER',0,'FIRST EXEC'),
5ax0q1md1w99p s.ksuudsae,s.ksusecre,s.ksusecsn,s.ksuseecid from x$ksuse s, x$k
5ax0q1md1w99p sled e, x$kslwt w where bitand(s.ksspaflg,1)!=0 and bitand(s.ksu
5ax0q1md1w99p seflg,1)!=0 and s.indx=w.kslwtsid and w.kslwtevt=e.indx
68 rows selected. |
|