ORACLE等待事件:SQL*Net message from client & SQL*Net message to client
在ORACLE当中有两个很常见的等待事件“SQL*Net message from client”与“SQL*Net message to client”,两者有点区别,下面整理这方面的资料如下:
SQL*Net message from client 表示服务端等待着Cilent发来请求让它处理,这时就会产生SQL*Net message from client等待事件。
而我们把这种Wait叫做空闲事件(ildel event),并不代表真正的Loading.
SQL*Net message to client 这个等待事件发生在服务段向客户端发送消息或数据的时候,一般意味着网络瓶颈或不正确的TCP连接配置。
当然它不能做为对网络延迟的准确评估或量化
SQL*Net message from client
"Generally SQL*Net message from client means Oracle is just waiting on some work to do. The SQL*Net message from client means that you have a session connected and Oracle is waiting for a command so it can do something.
If you're thinking that SQL*Net message from client is the cause of a performance issue, there's likely another underlying issue such as the application connecting but not running any statements (which is not an Oracle issue but would appear to the end user as a performance problem), or you're looking in the wrong place for the source of the performance problem."
关于SQL*Net message from client 这种等待事件,很好模拟,如下所示,会话68执行了一个SQL后,一直没有向服务器端发送任何SQL语句,那么在服务器端,会话68一直处于SQL*Net message from client等待事件
会话68连接到数据库后,执行完一个SQL后,不再做任何操作。如下所示:
SQL> show user;
USER 为 "TEST"
SQL> select * from v$mystat where rownum=1;
SID STATISTIC# VALUE
---------- ---------- ----------
68 0 0
会话72中查看会话68的状态,就会发现会话68处于SQL*Net message from client等待
SQL> show user;
USER is "SYS"
SQL> select * from v$mystat where rownum=1;
SID STATISTIC# VALUE
---------- ---------- ----------
72 0 0
SQL> select sid, seq#, event, wait_class,seconds_in_wait
2 from v$session_wait where sid=68;
SID SEQ# EVENT WAIT_CLASS SECONDS_IN_WAIT
---------- ---------- -------------------------------- ---------- ---------------
68 42 SQL*Net message from client Idle 314
但是如果此时在会话68里面执行一个SQL语句,你会看到SECONDS_IN_WAIT就会清零重新开始计时。
另外还有一种特殊情况,例如当客户端遭遇网络异常或应用程序奔溃、操作系统蓝屏等等,那么此时对应的会话也会可能遇到SQL*Net message from client空闲等待事件,当然绝大部分情况下,这个等待事件是可以忽略的。
SQL*Net message to client
The SQL*Net message to client may indicate a network-related issue that causes clients too long to get data from the database server. Thus, it can be a TCP issue, but it is not limited to that.
Common causes of a high SQL*Net message to client might include TCP/IP bottlenecks or TNS parameter issues:
High network latency: Check with netstat to ensure that your TCP/IP does not have bottlenecks.
Incorrect TNS parameters: Setting such as tcp.nodelay can impact the time for SQL message to client waits. See these tips on Oracle TNS network tuning .
The SQL*Net message to client Oracle metric indicates the server (foreground process) is sending a message to the client. Network bottlenecks are very common in distributed systems and those with high network traffic
“So, if you’re sending loads of data over a slow link or mis-configured TCP connection, the “SQL*Net message to client” wait time can be used as a low-confidence indicator of your SQL*Net throughput (in conjunction with “bytes sent via SQL*Net to client”), but never a measure of network latency!”
SQL * Net message to client等待事件发生在当一个服务器进程已经发送数据或消息到客户端并正等待回复的时候.这个等待时间是等待从TCP(Transparent Network Substrate)等待响应的时间.这个等待事件通常被认为是一个Network等待事件。SQL * Net message to client等待事件一般意味着网络瓶颈或不正确的TCP连接配置。但是它不能做为对网络延迟的准确评估或量化。当服务端在发送大量数据时, 您可以看到 "SQL * Net message to client" 等待事件所花的时间更长。这个发生在TCP发送缓冲区(TCP send buffer )已满时, 因此TCP堆栈无法接受更多的数据包。数据传送将被阻塞, 直到远程站点发送返回的 ACK 数据包表示它在 TCP 传输流( TCP transmission stream)中的哪些数据已经接收到了。
对于SQL * Net more data to client等待事件,ORACLE使用SDU(session data unit)会话数据单元将SDU缓存写入到TCP套接字缓存中.如果数据比会话数据单元的初始大小大那么数据需要被多次的发送.如果有大量的数据被发送然后在每批数据发送后这个会话将会等待'SQL * Net more data to client'等待事件.
ORACLE NET允许通过参数SDU(会话数据单元)和TDU(传输数据单元)来控制数据包的大小.它们分别控制会话层和传输层的缓存大小.TDU在数在ORACLE NET v8.0中已经被废弃.
参考资料:
http://www.dba-oracle.com/m_sql_net_message_to_client.htm
http://blog.tanelpoder.com/2008/02/07/sqlnet-message-to-client-wait-gotcha/
http://www.dba-oracle.com/t_sql_net_message_network_throughput.htm
ORACLE等待事件:SQL*Net message from client & SQL*Net message to client的更多相关文章
- 全面解析Oracle等待事件的分类、发现及优化
一.等待事件由来 大家可能有些奇怪,为什么说等待事件,先谈到了指标体系.其实,正是因为指标体系的发展,才导致等待事件的引入.总结一下,Oracle的指标体系,大致经历了下面三个阶段: · 以命中率为主 ...
- Oracle等待事件之等待事件详解
一. 等待事件的相关知识:1.1 等待事件主要可以分为两类:即空闲(IDLE)等待事件和非空闲(NON-IDLE)等待事件.1). 空闲等待事件指ORACLE正等待某种工作,在诊断和优化数据库的时候, ...
- Oracle等待事件db file parallel read
SQL> select event#,name,parameter1,parameter2,parameter3 from v$event_name where name = 'db file ...
- ORACLE等待事件:enq: TX - row lock contention
enq: TX - row lock contention等待事件,这个是数据库里面一个比较常见的等待事件.enq是enqueue的缩写,它是一种保护共享资源的锁定机制,一个排队机制,先进先出(FIF ...
- ORACLE等待事件: log file parallel write
log file parallel write概念介绍 log file parallel write 事件是LGWR进程专属的等待事件,发生在LGWR将日志缓冲区(log_buffer)中的重做日志 ...
- oracle等待事件以及解决方案
我们可以通过视图v$session_wait来查看系统当前的等待事件,以及与等待事件相对应的资源的相关信息,从而可确定出产生瓶颈的类型及其对象. v$session_wait的p1.p2.p3告诉我们 ...
- oracle等待事件-direct path read/write
转://http://blog.chinaunix.net/uid-23177306-id-2531235.html 一.direct path read1.与直接读取相关联的等待事件.当ORACLE ...
- Oracle 等待事件 db file sequential read
db file sequential read-数据文件顺序读取 等待事件: "db file sequential read" Reference Note (文档 ID 345 ...
- ORACLE等待事件:read by other session
read by other session简介 官方关于read by other session的介绍如下: When information is requested from the datab ...
随机推荐
- Spring系列之DI的原理及手动实现
目录 Spring系列之IOC的原理及手动实现 Spring系列之DI的原理及手动实现 前言 在上一章中,我们介绍和简单实现了容器的部分功能,但是这里还留下了很多的问题.比如我们在构造bean实例的时 ...
- 【转载】app测试的过程和重点关注内容
针对 app测试的过程和重点关注内容,做以下梳理和总结: 1 . 首先是测试资源确认及准备 ( 1 ) 产品需求文档.产品原型图.接口说明文档以及设计说明文档等应齐全: ( 2 ) 测试设备及工具 ...
- web认证
前言: HTTP是无状态协议,之前已认证成功的用户状态无法通过协议层面保存下来.即无法实现状态管理,我们使用Cookie来管理Session(会话),以弥补HTTP协议中不存在的状态管理功能. 步骤: ...
- leetcode — combinations
import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Source : https://o ...
- Win3内存管理之私有内存跟共享内存的申请与释放
Win3内存管理之私有内存跟共享内存的申请与释放 一丶内存简介私有内存申请 通过上一篇文章.我们理解了虚拟内存与物理内存的区别. 那么我们有API事专门申请虚拟内存与物理内存的. 有私有内存跟共享内存 ...
- jsp、jQuery、servlet交互实现登录功能
做一个web项目,往往需要有一个登录模块,验证用户名和密码之后跳转页面.为了实现更好的交互,往往需要用到 jQuery 等实现一些友好提示.比如用户名或者密码输入为空的时候提示不能为空:点击提交的时候 ...
- Python获得百度统计API的数据并发送邮件
Python获得百度统计API的数据并发送邮件 小工具 本来这么晚是不准备写博客的,当是想到了那个狗子绝对会在开学的时候跟我逼逼这个事情,所以,还是老老实实地写一下吧. Baidu统计API的使 ...
- Redis主从复制、多实例、高可用(三)--技术流ken
Redis主从复制 在开始实现redis的高可用之前,首先来学习一下如何实现redis的主从复制,毕竟高可用也会依赖主从复制的技术. Redis的主从复制,可以实现一个主节点master可以有多个从节 ...
- iframe实用操作
iframe高度设置为子页面高度 //需要使用Jquery $(document).ready(function () { parent.document.getEleme ...
- Josephu(约瑟夫)问题解析
Josephu问题为: 设置编号为1,2,3,......n的n个人围坐一圈,约定编号为k(1<=k<=n)的人从1看是报数,数到m的那个人出列,它的下一位又从1开始报数,数到m的那个人出 ...