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