ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 看不明白这个会话是在忙,还是空闲?

看不明白这个会话是在忙,还是空闲?

原创 Linux操作系统 作者:ZALBB 时间:2019-05-23 13:24:04 0 删除 编辑

Aix5l,9205.

有个会话,v$session 视图里查看到的状态是ACTIVE, 而 v$session_wait 里看到的 event 却是 SQL*Net message from client ,很令人犯晕,ACTIVE 说明当前会话在执行SQL,而SQL*Net message from client 却又是个空闲事件,那当前会话是在忙,还是空闲着?在PUB上发表了帖子,却没人能讲得清楚,在METALINK上发TAR,ORACLE的技术人员也答得晕乎乎的。


SQL> select sid,terminal,username,last_call_et,taddr,machine
2 from v$session where status = 'ACTIVE' and username is not null order by last_call_et;

SID TERMINAL USERNAME LAST_CALL_ET TADDR MACHINE
---------- -------------------- ---------- ------------ ---------------- ---------------

320 unknown NCTELLING 82 s29
78 unknown NCTELLING 500 s29
305 unknown NCTELLING 876 NC-NODE-4
84 unknown NCTELLING 965 0700000171DEE480 proxy4

17 rows selected.

SQL> select * from v$session_wait where sid=&sid;
Enter value for sid: 305
old 1: select * from v$session_wait where sid=&sid
new 1: select * from v$session_wait where sid=305

SID SEQ# EVENT P1TEXT P1 P1RAW P2TEXT P2 P2RAW P3TEXT P3 P3RAW WAIT_TIME SECONDS_IN_WAIT STATE
---------- ---------- ---------------------------------------------------------------- ---------------------------------------------------------------- ---------- ---------------- ---------------------------------------------------------------- ---------- ---------------- ---------------------------------------------------------------- ---------- ---------------- ---------- --------------- -------------------
305 34488 SQL*Net message from client driver id 1952673792 0000000074637000 #bytes 1 0000000000000001 0 00 10 895 WAITED KNOWN TIME

SQL> select sql_text from v$sqltext where address= (select sql_address from v$session
2 where sid=&sid) order by piece;
Enter value for sid: 305
old 2: where sid=&sid) order by piece
new 2: where sid=305) order by piece

SQL_TEXT
----------------------------------------------------------------
SELECT DISTINCT so_sale.pk_corp , so_sale.vreceiptcode , s
o_sale.creceipttype , so_sale.cbiztype , so_sale.finvoiceclass
, so_sale.finvoicetype , so_sale.vaccountyear , so_sale.bini
tflag , so_sale.dbilldate , so_sale.ccustomerid , so_sale.cde
ptid , so_sale.cemployeeid , so_sale.coperatorid , so_sale.ct
ermprotocolid , so_sale.csalecorpid , so_sale.creceiptcustomer
id , so_sale.vreceiveaddress , so_sale.creceiptcorpid , so_sa
le.ctransmodeid , so_sale.ndiscountrate , so_sale.cwarehouseid
, so_sale.veditreason , so_sale.bfreecustflag , so_sale.cfre
ecustid , so_sale.ibalanceflag , so_sale.nsubscription , so_s
ale.ccreditnum , so_sale.nevaluatecarriage , so_sale.dmakedate

SQL_TEXT
----------------------------------------------------------------
, so_sale.capproveid , so_sale.dapprovedate , so_sale.fstatu
s , so_sale.vnote , so_sale.vdef1 , so_sale.vdef2 , so_sale.
vdef3 , so_sale.vdef4 , so_sale.vdef5 , so_sale.vdef6 , so_s
ale.vdef7 , so_sale.vdef8 , so_sale.vdef9 , so_sale.vdef10 ,
so_sale.ccalbodyid , so_sale.csaleid , so_sale.bretinvflag ,
so_sale.boutendflag , so_sale.binvoicendflag , so_sale.brecei
ptendflag , so_sale.ts , so_sale.npreceiverate , so_sale.npre
ceivemny , so_sale.bpayendflag , so_saleorder_b.ccurrencytypei
d , so_sale.btransendflag , so_sale.naccountperiod , so_sale.
boverdate , so_sale.bdeliver FROM so_sale , so_saleorder_b ,
so_saleexecute where so_sale.csaleid = so_saleorder_b.csal

SQL_TEXT
----------------------------------------------------------------
eid and so_sale.csaleid = so_saleexecute.csaleid and so_sa
leorder_b.corder_bid = so_saleexecute.csale_bid and ( ( (
so_sale.dbilldate = '2006-05-30' ) ) and ( so_sale.pk_co
rp = '1027' AND ( fstatus = 2 or fstatus = 6 ) AND
( cbiztype = '1027AA100000000005EP' OR cbiztype IS NULL
) AND ( nvl ( so_saleexecute.ntotalinventorynumber , 0.0
) - nvl ( so_saleexecute.ntotalreturnnumber , 0.0 ) ) >
0 AND so_sale.creceipttype = '30' ) and cbiztype = '1
027AA100000000005EP' ) order by so_sale.csaleid

31 rows selected.

SQL>

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/1112/viewspace-103716/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2018-08-15

  • 博文量
    37
  • 访问量
    27045