【遞迴SQL】v$session--X$KSUSE s,X$KSLED e對應情況

xysoul_雲龍發表於2021-03-08

欄位對應表:

v$session x$ksuse











        s.inst_id
SADDR         s.addr
 SID         s.indx
 SERIAL#         s.ksuseser
 AUDSID         s.ksuudses
 PADDR         s.ksusepro
 USER#         s.ksuudlui
 USERNAME         s.ksuudlna
 COMMAND         s.ksuudoct
 OWNERID         s.ksusesow
 TADDR         decode(s.ksusetrn,hextoraw('00'),null,s.ksusetrn)
 LOCKWAIT         decode(s.ksqpswat,hextoraw('00'),null,s.ksqpswat)
 STATUS         decode(bitand(s.ksuseidl,11),1,'ACTIVE',0,decode(bitand(s.ksuseflg,4096),0,'INACTIVE','CACHED'),2,'SNIPED',3,'SNIPED', 'KILLED')
 SERVER         decode(s.ksspatyp,1,'DEDICATED',2,'SHARED',3,'PSEUDO','NONE')
 SCHEMA#         s.ksuudsid
 SCHEMANAME         s.ksuudsna
 OSUSER         s.ksuseunm
 PROCESS         s.ksusepid
 MACHINE         s.ksusemnm
 TERMINAL         s.ksusetid

 PROGRAM         s.ksusepnm
 TYPE         decode(bitand(s.ksuseflg,19),17,'BACKGROUND',1,'USER',2,'RECURSIVE','?')
 SQL_ADDRESS         s.ksusesql
 SQL_HASH_VALUE         s.ksusesqh
 SQL_ID         s.ksusesqi
 SQL_CHILD_NUMBER         decode(s.ksusesch, 65535, to_number(null), s.ksusesch)
 PREV_SQL_ADDR         s.ksusepsq
 PREV_HASH_VALUE         s.ksusepha
 PREV_SQL_ID         s.ksusepsi
 PREV_CHILD_NUMBER         decode(s.ksusepch, 65535, to_number(null), s.ksusepch)
 PLSQL_ENTRY_OBJECT_ID         decode(s.ksusepeo,0,to_number(null),s.ksusepeo)
 PLSQL_ENTRY_SUBPROGRAM_ID         decode(s.ksusepeo,0,to_number(null),s.ksusepes)
 PLSQL_OBJECT_ID         decode(s.ksusepco,0,to_number(null),s.ksusepco)
 PLSQL_SUBPROGRAM_ID         decode(s.ksusepco,0,to_number(null),s.ksusepcs)
 MODULE         s.ksuseapp
 MODULE_HASH         s.ksuseaph
 ACTION         s.ksuseact
 ACTION_HASH         s.ksuseach
 CLIENT_INFO         s.ksusecli
 FIXED_TABLE_SEQUENCE         s.ksusefix
 ROW_WAIT_OBJ#         s.ksuseobj
 ROW_WAIT_FILE#         s.ksusefil
 ROW_WAIT_BLOCK#         s.ksuseblk
 ROW_WAIT_ROW#         s.ksuseslt
 LOGON_TIME         s.ksuseltm
 LAST_CALL_ET         s.ksusectm
 PDML_ENABLED         decode(bitand(s.ksusepxopt, 12),0,'NO','YES')
 FAILOVER_TYPE         decode(s.ksuseft, 2,'SESSION', 4,'SELECT',8,'TRANSACTIONAL','NONE')
 FAILOVER_METHOD         decode(s.ksusefm,1,'BASIC',2,'PRECONNECT',4,'PREPARSE','NONE')
 FAILED_OVER         decode(s.ksusefs, 1, 'YES', 'NO')
RESOURCE_CONSUMER_GROUP         s.ksusegrp
 PDML_STATUS         decode(bitand(s.ksusepxopt,4),4,'ENABLED', decode(bitand(s.ksusepxopt,8),8,'FORCED','DISABLED'))
 PDDL_STATUS         decode(bitand(s.ksusepxopt,2),2,'FORCED',decode(bitand(s.ksusepxopt,1),1,'DISABLED','ENABLED'))
 PQ_STATUS         decode(bitand(s.ksusepxopt,32),32,'FORCED',decode(bitand(s.ksusepxopt,16),16,'DISABLED','ENABLED'))
 CURRENT_QUEUE_DURATION         s.ksusecqd
 CLIENT_IDENTIFIER         s.ksuseclid
 BLOCKING_SESSION_STATUS         decode(s.ksuseblocker,4294967295,'UNKNOWN',  4294967294 , 'UNKNOWN',4294967293,'UNKNOWN',4294967292,'NO HOLDER',  4294967291,'NOT IN WAIT','VALID')
 BLOCKING_INSTANCE         decode(s.ksuseblocker, 4294967295,to_number(null),4294967294,to_number(null), 4294967293,to_number(null), 4294967292,to_number(null),4294967291,  to_number(null),bitand(s.ksuseblocker, 2147418112)/65536)
 BLOCKING_SESSION         decode(s.ksuseblocker, 4294967295,to_number(null),4294967294,to_number(null), 4294967293,to_number(null), 4294967292,to_number(null),4294967291,  to_number(null),bitand(s.ksuseblocker,65535))
 SEQ#         s.ksuseseq
 EVENT#         s.ksuseopc
 EVENT         e.kslednam
 P1TEXT         e.ksledp1
 P1         s.ksusep1
 P1RAW         s.ksusep1r
 P2TEXT         e.ksledp2
 P2         s.ksusep2
 P2RAW         s.ksusep2r
 P3TEXT         e.ksledp3
 P3         s.ksusep3
 P3RAW         s.ksusep3r
 WAIT_CLASS_ID         e.ksledclassid
 WAIT_CLASS#         e.ksledclass#
 WAIT_CLASS         e.ksledclass
 WAIT_TIME         decode(s.ksusetim,0,0,-1,-1,-2,-2, decode(round(s.ksusetim/10000),0,-1,round(s.ksusetim/10000)))
 SECONDS_IN_WAIT         s.ksusewtm
 STATE         decode(s.ksusetim, 0, 'WAITING', -2, 'WAITED UNKNOWN TIME',  -1, 'WAITED SHORT TIME',   decode(round(s.ksusetim/10000),0,'WAITED SHORT TIME','WAITED KNOWN TIME')
 SERVICE_NAME         s.ksusesvc
 SQL_TRACE         decode(bitand(s.ksuseflg2,32),32,'ENABLED','DISABLED')
 SQL_TRACE_WAITS         decode(bitand(s.ksuseflg2,64),64,'TRUE','FALSE')
 SQL_TRACE_BINDS         decode(bitand(s.ksuseflg2,128),128,'TRUE','FALSE')








轉載:http://blog.itpub.net/16976507/viewspace-754440/

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29487349/viewspace-2761741/,如需轉載,請註明出處,否則將追究法律責任。

相關文章