最近在看 AWR 报告的时候,发现一个奇怪的等待事件:virtual circuit wait
之前从来没有遇到过,很是奇特
数据库版本: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
操作系统版本:Red Hat Enterprise Linux Server release 5.4 (Tikanga)
数据库连接:MTS
客户端TNSNAMES.ORA 配置:DEDICATED
问题描述:数据库完全空闲,但是 DB TIME 显示数据库处于繁忙阶段,TOP 5 的等待事件为 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'
原文链接:
【参考二】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 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
Platforms affected Generic (all / most platforms affected)
The fix for this bug introduces a notable thus:
Notable change of behaviour introduced in 11.1.0.7
Fixed: This issue is fixed in
原文链接:
阅读(3700) | 评论(0) | 转发(0) |