virtual circuit wait等待事件

virtual circuit wait

查询 V$SHARED_SERVER 
SELECT * FROM v$shared_server WHERE circuit <> '00'

查询 V$CIRCUIT 视图中的状态
SELECT waiter, status FROM V$CIRCUIT WHERE waiter <> '00'

检查等待的Session 正在处理的SQL:
SELECT username, machine, event, status, server
FROM v$session
WHERE username IS NOT NULL
AND paddr IN
(SELECT waiter FROM V$CIRCUIT WHERE waiter <> '00')    

发现等待的 SESSION 正是当前 PLSQL 连接上检查的 SESSION,很是困惑,当前客户端(PLSQL)使用的TNSNAMES.ORA文件中对链接的配置是 DEDICATED。

根据查询的结果和机器实际网络正常、负载很低的分析,一直在怀疑是bug。

后来老大帮忙查找了一下原因,发现和PLSQL客户端有关,一旦使用客户端连接上就出现这个等待事件,杯具。

问题出现前提条件:
1. 使用 oracle 11gR2
2. 是客户端PL/SQL在连接数据库的时候使用shared server
3. plsql在默认连接的时候是创建多个session的:Session  Mode 选择 Multi session或者Dual session 

此时查询 v$session 视图可以看到,session的等待事件就是 virtual circuit wait,注销plsql即可看到等待事件取消

只有条件1,2和条件3同时达到才会产生这个等待事件,如果使用dedicated链接或者plsql配置上选择Single session 都不会产生这个等待事件。


期间参考 metalink 上多篇文档和有人提问的回复:
【参考一】

This is a performance monitoring enhancement to split the 'virtual circuit status' wait event into two new
wait events:

"shared server idle wait" - for when the shared server is
idle waiting for something to do

"virtual circuit wait" - for when the shared server is
blocked waiting on a specific 
circuit / message

The wait "virtual circuit status" no longer exist with this fix.
Before the bug fix  the 'virtual circuit status' event was classified as an 

idle event but was used for both idle and non-idle waits.  Since the idle time 

dominated the total time for the event, it obscured any true issues with the 

other waits under the event.


With this bug fix included in 11.1.0.7 and 11.2 The 'virtual circuit status' wait 
event was removed and replaced by two new wait events: 'shared server idle wait' and 
'virtual circuit wait'.  The wait on the common queue uses 'shared server idle wait' and 
all the otherwaits use 'virtual circuit wait'

原文链接: https://support.oracle.com/CSP/main/article?cmd=show&type=COMMUNITIES&doctype=COMTHREAD&id=85058

【参考二】 Bug 6653834 - Split "virtual circuit status" into idle / non-idle waits [ID 6653834.8]

This note gives a brief overview of bug 6653834. 
The content was last updated on: 11-JAN-2010
Click here for details of each of the sections below.
Affects:
Product (Component) Oracle Server (Rdbms)  Range of versions believed to be affected Versions < 11.2  Versions confirmed as being affected
  • 9.2.0.8
  • 10.1.0.5
  • 10.2.0.3
  • 10.2.0.4
  • 11.1.0.6
Platforms affected Generic (all / most platforms affected) 
The fix for this bug introduces a notable  change in behaviour thus:
Notable change of behaviour introduced in 11.1.0.7
Fixed:   This issue is fixed in
  • 11.1.0.7 (Server Patch Set)
  • 11.2.0.1 (Base Release)


原文链接: https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=PATCH&id=6653834.8

你可能感兴趣的:(virtual circuit wait等待事件)