关于 SQLNET break/reset to client等待事件

本文介绍了解决Oracle数据库中出现的'SQL*Net break/resettoclient'等待事件的方法。通过启用10046跟踪或调整sqlnet.ora参数可以减少应用程序竞争并提高整体性能。

APPLIES TO:

Oracle Net Services - Version 9.2.0.1 to 12.1.0.2 [Release 9.2 to 12.1]
Oracle Database - Enterprise Edition - Version 11.2.0.4 to 11.2.0.4 [Release 11.2]
Information in this document applies to any platform.

SYMPTOMS

Getting significant application contention on an Update statement which is getting the "SQL*Net break/reset to client" wait.

This causes significant impact when 100 of these sessions are getting this wait. Also, it seems that very few records are actually updated and in some cases none.

This is impacting the overall performance on a production DB server.

CAUSE

SQL*Net break/reset to client represent some error in the SQL statement submitted by the application ,

SQL*Net break/reset happens when an error/unhandled exception is raised during a call (which means that the call executed didn’t complete normally, thus the call state must be reset).

10046 Trace from the Statement/session that is getting the "SQL*Net break/reset to client" wait , shows the following :

EXEC #4577284448:c=0,e=904,p=0,cr=8,cu=10,mis=0,r=0,dep=0,og=1,plh=0,tim=49240680822112
ERROR #3:err=1 tim=49240680822126
WAIT #4577284448: nam='SQL*Net break/reset to client' ela= 4 driver id=1952673792 break?=1 p3=0 obj#=-1 tim=49240680822228
WAIT #4577284448: nam='SQL*Net break/reset to client' ela= 24544 driver id=1952673792 break?=0 p3=0 obj#=-1 tim=49240680846790
WAIT #4577284448: nam='SQL*Net message to client' ela= 1 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=49240680846831
WAIT #4577284448: nam='SQL*Net message from client' ela= 24571 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=49240680871431




which is ORA-00001: unique constraint violated in this case

SOLUTION

1- Enable 10046 Trace to the Statement/session that is getting the "SQL*Net break/reset to client" ,

Please review the following note, for different ways of enabling the 10046 trace event after the session is created :

Note 376442.1 - Recommended Method for Obtaining 10046 trace for Tuning

Then search for keyword 'err=' 

The Number will represent the Oracle error number occurred , ORA-n

You should also be able to Identify the Statement caused this Error and bind variables used , to check and Fix these errors :

=====================
PARSING IN CURSOR #4577284448 len=158 dep=0 uid=236 oct=6 lid=236 tim=49240680785729 hv=2510433232 ad='7000000181663b8' sqlid='1bukxaqau4ayh'
UPDATE IPS_MAC_TO_IP
SET fqdn = null, interface = :p1, last_upd = SYSDATE
WHERE mac = :p2 AND ip = INET_ATON(:p3) AND router_found_loopback = 170543874
END OF STMT
BINDS #4577575528:
 Bind#0
  oacdty=01 mxl=128(72) mxlc=00 mal=00 scl=00 pre=00
  oacflg=05 fl2=1000000 frm=01 csi=873 siz=384 off=0
  kxsbbbfp=110d7c058  bln=128  avl=07  flg=05
  value="Vlan101"
 Bind#1
  oacdty=01 mxl=128(48) mxlc=00 mal=00 scl=00 pre=00
  oacflg=05 fl2=1000000 frm=01 csi=873 siz=0 off=128
  kxsbbbfp=110d7c0d8  bln=128  avl=12  flg=01
  value="005056913a4a"
 Bind#2
  oacdty=01 mxl=128(48) mxlc=00 mal=00 scl=00 pre=00
  oacflg=05 fl2=1000000 frm=01 csi=873 siz=0 off=256
  kxsbbbfp=110d7c158  bln=128  avl=14  flg=01
  value="169.173.200.74"
....
EXEC #4577284448 :c=0,e=904,p=0,cr=8,cu=10,mis=0,r=0,dep=0,og=1,plh=0,tim=49240680822112
ERROR #3:err=1 tim=49240680822126
WAIT #4577284448: nam='SQL*Net break/reset to client' ela= 4 driver id=1952673792 break?=1 p3=0 obj#=-1 tim=49240680822228


Also Please engage the application team/vendor to write the proper exception handling appropriately (ex: OTHERS exception) in the application code .


or

2- If no errors is reported in the 10046 Trace , Please put the following parameters in sqlnet.ora file for both client and server side as a workaround :

BREAK_POLL_SKIP=10000
DISABLE_OOB=on

And then retry the scenario .


This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.

APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.2.0.1 to 12.1.0.1 [Release 11.2 to 12.1]
Information in this document applies to any platform.

SYMPTOMS

 A high number of "SQL*Net break/reset to client" wait events are observed in a production environment.

After performing some tracing using Client Identifiers, the waits are almost all related Advanced Queue (AQ) dequeue calls

In particular these relate to ORA-25228 errors. The ORA-25228 just indicates that there are no more messages in the queue.

CAUSE

The behaviour observed is working as designed.
 
There is an Message Driven Bean (MDB) timeout setting using within the Application Server which is consuming messages from the queues with this database which has a timeout of 30 seconds.

Every 30 seconds the application server will try and consume messages regardless of messages being in the queue or not. 

This is what you observe in the 10046 trace that there is a 30 second gap between each a session waiting for a message and a SQL*Net break/reset to client wait event being reported as per the following example

*** [ Unix process pid: 15242 ]
*** 2014-01-20 13:09:32.610

*** [ Unix process pid: 15242 ]
*** 2014-01-20 13:09:42.613
WAIT #18446744071527990480: nam='Streams AQ: waiting for messages in the queue' ela= 10000123 queue id=264667 process#=30036252528 wait time=30 obj#=-1 tim=16595326291167

** [ Unix process pid: 15242 ]
*** 2014-01-20 13:10:02.615
WAIT #18446744071527990480: nam='Streams AQ: waiting for messages in the queue' ela= 10000137 queue id=264667 process#=30036252528 wait time=30 obj#=-1 tim=16595346291805
EXEC #18446744071527955576:c=0,e=93,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=1,plh=1987110454,tim=16595346292190
FETCH #18446744071527955576:c=0,e=19,p=0,cr=1,cu=0,mis=0,r=0,dep=1,og=1,plh=1987110454,tim=16595346292265
EXEC #18446744071527990480:c=10000,e=30002692,p=0,cr=3,cu=0,mis=0,r=0,dep=0,og=1,plh=0,tim=16595346292568
ERROR #4:err=25228 tim=16595346292615
WAIT #18446744071527990480: nam='SQL*Net break/reset to client' ela= 3 driver id=1952673792 break?=1 p3=0 obj#=-1 tim=16595346292744
WAIT #18446744071527990480: nam='SQL*Net break/reset to client' ela= 628 driver id=1952673792 break?=0 p3=0 obj#=-1 tim=16595346293417
WAIT #18446744071527990480: nam='SQL*Net message to client' ela= 1 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=16595346293486
WAIT #18446744071527990480: nam='SQL*Net message from client' ela= 1000 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=16595346294567
CLOSE #18446744071527990480:c=0,e=34,dep=0,type=3,tim=16595346294691
WAIT #18446744071527955576: nam='SQL*Net message to client' ela= 1 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=16595346294944
WAIT #18446744071527955576: nam='SQL*Net message from client' ela= 786 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=16595346295781
XCTEND rlbk=0, rd_only=1, tim=16595346295871
WAIT #0: nam='SQL*Net message to client' ela= 1 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=16595346295970
 

SOLUTION

The only way to reduce the 'SQL*Net break/reset to client' wait events would be to set the MDB timeouts to a higher value than 30 seconds.

课程设计报告 专业班级 课 程 FPGA/CPLD原理及应用 题 目 四路电子抢答器设计 学 号 姓 名 同 组 人 成 绩 2013年5月 设计目的 1.进一步掌握QUARTUS 软件的使用方法; 2.会使用VHDL语言设计小型数字电路系统; 3.掌握应用QUARTUS 软件设计电路的流程; 4.掌握电子抢答器的设计方法。 二、设计要求 1.系统总体设计 (1)设计一个可以容纳四组参赛队进行比赛的电子抢答器。 (2)具有第一抢答信号的鉴别和锁存功能。在主持人发出抢答指令后,若有参赛者按 抢答器按钮,则该组指示灯亮,显示器显示出抢答者的组别。同时,电路处于自锁存状 态,使其他组的抢答器按钮不起作用。 (3)具有计时功能。在初始状态时,主持人可以设置答题时间的初始值。在主持人对 抢答组别进行确认,并给出倒计时记数开始信号以后,抢答者开始回答问题。此时,显 示器从初始值开始倒计时,计到0时停止计数,同时扬声器发出超时警报信号。若参赛者 在规定的时间内回答完问题,主持人可以给出计时停止信号,以免扬声器鸣叫。 (4)具有计分功能。在初始状态时,主持人可以给每组设置初始分值。每组抢答完毕 后,由主持人打分,答对一次加1分,答错一次减1分。 (5)设置一个系统清除开关,该开关由主持人控制。 (6)具有犯规设置电路。超时抢答者,给予鸣喇叭警示,并显示规范组别。 2.设计方案 系统的输入信号有:各组的抢答按钮A、B、C、D,系统允许抢答信号STA,系统清零 信号RST,计分时钟信号CLK,加分按钮端ADD、en,减分端SUB、sta,计时使能端en时钟 信号clk,复位rst;系统的输出信号有:四个组抢答成功与否的指示灯控制信号输出口可 用a1、b1、c1、d1表示,四个组抢答时的计时数码显示控制信号,抢答成功组别显示的 控制信号,各组计分显示的控制信号。整个系统至少有三个主要模块:抢答鉴别模块; 抢答计时模块;抢答计分模块,其他功能模块(输出显示模块)。 3.如图为流程图: 开始 抢答 抢答鉴别 回答 加减分数 显示 倒计时 倒计时 犯规抢答或抢答后答题时间超时鸣喇叭警告。 4. 抢答器的顶层原理图设计: 三、详细设计 (一)抢答鉴别及锁存模块 抢答队伍共分为四组A,B,C,D。当主持人按下STA键后,对应的start指示灯亮, 四组队伍才可以按抢答键抢答,即抢答信号A,B,C,D输入电路中后,通过判断是哪个 信号最先为'1'得出抢答成功的组别1,2,3或4组,将组别号输出到相应端A1,B1,C1 ,D1,并将组别序号换算为四位二进制信号输出到STATES[3..0]端锁存,等待输出到计 分和显示单元。同时RING端在有成功抢答的情况下发出警报。其模块如下: 抢答鉴别模块 1抢答鉴别及锁存源程序 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity qdjb is port(STA,RST:in std_logic; A,B,C,D:in std_logic; A1,B1,C1,D1,START:out std_logic; STATES:out std_logic_vector(3 downto 0)); end qdjb; architecture one of qdjb is signal sinor,ringf,tmp,two:std_logic; begin sinor<=(A XOR B) XOR (C XOR D); two<=A and B; process(A,B,C,D,RST,tmp) begin if RST='1' then tmp<='1'; A1<='0'; B1<='0'; C1<='0'; D1<='0';START<='0';STATES<="0000"; elsif tmp='1' then if STA='1' then START<='1'; if (A='1'AND B='0'AND C='0'AND D='0' ) then A1<='1'; B1<='0'; C1<='0'; D1<='0'; STATES<="0001"; tmp<='0'; ELSIF (A='0'AND B='1'AND C='0'AND D='0') THEN A1<='0'; B1<='1'; C1<='0'; D1<='0';STATES<="0010";tmp<='0'; ELSIF (A='0'AND B='0'AND C='1'AND D='0') THEN A1<='0'; B1<='0'; C1<='1'; D1<='0'; STATES<="0011"; tmp<='0'; ELSIF (A=
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值