————————————————————————
SQLNET.RECV_TIMEOUT
————————————————————————
客户端设置的作用是,其发起的请求,必须在设置值内有返回,否则报错中断
该参数不是限制执行时间,而是限制返回包的时间
如果执行一个SQL抽取数据,由于每秒都有数据返回,所以不会报错
如果执行一个存过,由于请求是发送到数据库端运行的,如果在设置值内无法执行完成并返回,将报错
另外,只是中断运行的语句,不是杀掉进程
如下测试是SQLNET.RECV_TIMEOUT=5时的情况
SQL> exec dbms_lock.sleep(4);
PL/SQL procedure successfully completed.
SQL> exec dbms_lock.sleep(5);
BEGIN dbms_lock.sleep(5); END;
*
ERROR at line 1:
ORA-12609: TNS: Receive timeout occurred
SQL> exec dbms_lock.sleep(4);
PL/SQL procedure successfully completed.
SQL> select count(*) from dba_objects,dba_objects;
select count(*) from dba_objects,dba_objects
*
ERROR at line 1:
ORA-12609: TNS: Receive timeout occurred
Elapsed: 00:00:05.02
SQL> exec P_test(1);
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.01
SQL> exec P_test(2);
PL/SQL procedure successfully completed.
Elapsed: 00:00:04.01
SQL> exec P_test(3);
BEGIN P_test(3); END;
*
ERROR at line 1:
ORA-12609: TNS: Receive timeout occurred
Elapsed: 00:00:05.01
SQL>
SQL> select * from dba_objects;
70288 rows selected.
Elapsed: 00:02:02.20
服务器端设置的作用是,
服务器端收到客户端请求的时间,和上一个请求的时间之间,间隔不能超过3秒
如果超过3秒,就在ALERT中报告ORA-12609
如下测试是在服务器端设置sqlnet.recv_timeout=3
09:47:50 SQL> /
select * from dual
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 5103
Session ID: 140 Serial number: 41
09:47:51 SQL> /
D
-
X
09:47:53 SQL> /
D
-
X
09:47:57 SQL> /
select * from dual
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 5105
Session ID: 140 Serial number: 43
09:47:58 SQL> /
D
-
X
————————————————————————
SQLNET.SEND_TIMEOUT
————————————————————————
如果设置在服务器端,那么作用是
当一个取数的客户端进程异常终止后,在服务器端发现其死亡前,oracle端发送数据的服务器进程将继续发送数据,在其检测到客户端3秒都无法接收后,报错,终止数据传输
如果设置在客户端,就是反过来
这两个参数是处理对端异常终止的情况,没有发现这个参数有何特殊的影响
SQLNET.RECV_TIMEOUT
————————————————————————
客户端设置的作用是,其发起的请求,必须在设置值内有返回,否则报错中断
该参数不是限制执行时间,而是限制返回包的时间
如果执行一个SQL抽取数据,由于每秒都有数据返回,所以不会报错
如果执行一个存过,由于请求是发送到数据库端运行的,如果在设置值内无法执行完成并返回,将报错
另外,只是中断运行的语句,不是杀掉进程
如下测试是SQLNET.RECV_TIMEOUT=5时的情况
SQL> exec dbms_lock.sleep(4);
PL/SQL procedure successfully completed.
SQL> exec dbms_lock.sleep(5);
BEGIN dbms_lock.sleep(5); END;
*
ERROR at line 1:
ORA-12609: TNS: Receive timeout occurred
SQL> exec dbms_lock.sleep(4);
PL/SQL procedure successfully completed.
SQL> select count(*) from dba_objects,dba_objects;
select count(*) from dba_objects,dba_objects
*
ERROR at line 1:
ORA-12609: TNS: Receive timeout occurred
Elapsed: 00:00:05.02
SQL> exec P_test(1);
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.01
SQL> exec P_test(2);
PL/SQL procedure successfully completed.
Elapsed: 00:00:04.01
SQL> exec P_test(3);
BEGIN P_test(3); END;
*
ERROR at line 1:
ORA-12609: TNS: Receive timeout occurred
Elapsed: 00:00:05.01
SQL>
SQL> select * from dba_objects;
70288 rows selected.
Elapsed: 00:02:02.20
服务器端设置的作用是,
服务器端收到客户端请求的时间,和上一个请求的时间之间,间隔不能超过3秒
如果超过3秒,就在ALERT中报告ORA-12609
如下测试是在服务器端设置sqlnet.recv_timeout=3
09:47:50 SQL> /
select * from dual
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 5103
Session ID: 140 Serial number: 41
09:47:51 SQL> /
D
-
X
09:47:53 SQL> /
D
-
X
09:47:57 SQL> /
select * from dual
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 5105
Session ID: 140 Serial number: 43
09:47:58 SQL> /
D
-
X
————————————————————————
SQLNET.SEND_TIMEOUT
————————————————————————
如果设置在服务器端,那么作用是
当一个取数的客户端进程异常终止后,在服务器端发现其死亡前,oracle端发送数据的服务器进程将继续发送数据,在其检测到客户端3秒都无法接收后,报错,终止数据传输
如果设置在客户端,就是反过来
这两个参数是处理对端异常终止的情况,没有发现这个参数有何特殊的影响
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8242091/viewspace-767790/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8242091/viewspace-767790/