SQL*Net break/reset to client等待事件

一般情况下无法从动态视图(v$session/v$session_wait)看到这个等待事件,因为它十分短暂。其本质从字面意思上来解释的话,是一种网络等待(network issue); 举例而言,如果运行的代码中包含某种可能的错误,且在调用中触发了的话,服务器端本地的服务进程有义务对远程客户端告知该信息,这个告知的过程中服务进程就处于SQL*Net break/reset to client等待中,直到客户端收到问题信息为止。与一般意义上的Sever-client模式一样,使用dblink时也可能出现该种等待事件。 下面我们来尝试演示该种等待事件:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
SQL>   create  table  tv (t1  int  unique );
 
Table  created.
 
SQL>  insert  into  tv  values (1);
 
1 row created.
 
SQL>  commit ;
 
Commit  complete.
 
SQL> oradebug setmypid;
Statement processed.
SQL>  oradebug event 10046 trace  name  context forever, level  8;
Statement processed.
SQL>  insert  into  tv  values (1);
insert  into  tv  values (1)
*
ERROR  at  line 1:
ORA-00001:  unique  constraint  (SYS.SYS_C009343) violated
 
SQL>  oradebug event 10046 trace  name  context  off ;
Statement processed.
SQL>  select  event, total_waits  from  v$session_event  where  event  like  '%break%'  and  sid =( select  distinct  sid  from  v$mystat);
 
EVENT                                                            TOTAL_WAITS
---------------------------------------------------------------- -----------
SQL*Net break/reset  to  client                                              2
可以看到出现了2次SQL*Net break/reset to client ,进一步分析trace文件可以发现以下记录:
?
1
2
3
4
5
6
EXEC  #2:c=8000,e=9020,p=0,cr=10,cu=9,mis=0,r=0,dep=0,og=1,plh=0,tim=1279117896316991
ERROR #2:err=1 tim=1279117896317039
STAT #2 id=1 cnt=0 pid=0 pos=1 obj=0 op= 'LOAD TABLE CONVENTIONAL  (cr=0 pr=0 pw=0 time=0 us)'
WAIT #2: nam= 'SQL*Net break/reset to client'  ela= 33 driver id=1413697536 break?=1 p3=0 obj#=-1 tim=1279117896317323
WAIT #2: nam= 'SQL*Net break/reset to client'  ela= 521 driver id=1413697536 break?=0 p3=0 obj#=-1 tim=1279117896317915
WAIT #2: nam= 'SQL*Net message to client'  ela= 5 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1279117896317964

2次SQL*Net break/reset to client分别为33us和521us; 设计不良的应用程序或者程序中存在较多未安置的exception都可能导致SQL*Net break/reset to client等待事件。



本文转自maclean_007 51CTO博客,原文链接:http://blog.51cto.com/maclean/1277491

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值