使用SQLNET.EXPIRE_TIME清除僵死连接(三)

2014-11-24 15:21:38 · 作者: · 浏览: 2
ch to client from server.
10:06:51 SQL> ho ping 192.168.7.133
PING 192.168.7.133 (192.168.7.133) 56(84) bytes of data.
From 192.168.7.40 icmp_seq=2 Destination Host Unreachable
From 192.168.7.40 icmp_seq=3 Destination Host Unreachable
From 192.168.7.40 icmp_seq=4 Destination Host Unreachable
From 192.168.7.40 icmp_seq=6 Destination Host Unreachable
From 192.168.7.40 icmp_seq=7 Destination Host Unreachable
From 192.168.7.40 icmp_seq=8 Destination Host Unreachable
--此时总进程数为27个
10:15:08 SQL> select count(*) from v$process;
COUNT(*)
----------
27
--从09:58进程启动开始到10:17:59进程依旧没有被释放
10:17:59 SQL> ho ps -ef | grep 29522 | grep -v grep
oracle 29522 1 0 09:58 00:00:00 oracleora11g (LOCAL=NO)
-->At this time the server process was released
10:18:08 SQL> ho ps -ef | grep 29522 | grep -v grep
--进程释放后此时进程总数变为26个
10:19:45 SQL> select count(*) from v$process;
COUNT(*)
----------
26
-->the lock was released
10:19:54 SQL> @lock_obj
no rows selected
--scott用户的session已经从v$session中被移除
10:20:03 SQL> @comm_sess_users;
+----------------------------------------------------+
| User Sessions (All) |
+----------------------------------------------------+
Instance SID Serial ID Status Oracle User O/S User O/S PID Session Program Terminal Machine
--------- ------ --------- --------- -------------- ------------ ------- -------------------------- -------- ----------
ora11g 125 5 INACTIVE SYS oracle 4734 sqlplus@orasrv.com (TNS V1 pts/0 orasrv.com
139 9 ACTIVE SYS oracle 29447 sqlplus@orasrv.com (TNS V1 pts/4 orasrv.com
5、查看SQLNET.EXPIRE_TIME是否启用
[python]
#下面对跟踪日志过滤,可以看到09:58:02:853中提示开启dead connection detection
[oracle@orasrv trace]$ cat -n server_29522.trc |grep dead
78 [25-JUN-2013 09:58:02:853] niotns: Enabling dead connection detection (1 min)
#下面的查询中,在09:58:03 timer被启动,10:18:26后,连接被彻底关闭(包括server process)
[oracle@orasrv trace]$ cat -n server_29522.trc |grep timer
447 [25-JUN-2013 09:58:03:050] nstimstart: starting timer at 25-JUN-2013 09:58:03
451 [25-JUN-2013 09:58:03:051] nsconbrok: timer created for connection
4092 [25-JUN-2013 10:18:26:173] nstimarmed: timer is armed, with value 3833
#下面是starting timer的详细信息
[oracle@orasrv trace]$ head -451 server_29522.trc | tail -5
[25-JUN-2013 09:58:03:050] nstimstart: starting timer at 25-JUN-2013 09:58:03
[25-JUN-2013 09:58:03:051] nstimset: entry
[25-JUN-2013 09:58:03:051] nstimset: normal exit
[25-JUN-2013 09:58:03:051] nstimstart: normal exit
[25-JUN-2013 09:58:03:051] nsconbrok: timer created for connection
#下面是timer被清除后的详细信息nstimclear: normal exit
[oracle@orasrv trace]$ head -4097 server_29522.trc | tail -7
[25-JUN-2013 10:18:26:173] nstimarmed: entry
[25-JUN-2013 10:18:26:173] nstimarmed: timer is armed, with value 3833
[25-JUN-2013 10:18:26:173] nstimarmed: normal exit
[25-JUN-2013 10:18:26:173] nstimclear: entry
[25-JUN-2013 10:18:26:173] nstimclear: normal exit
[25-JUN-2013 10:18:26:173] nttctl: entry
[25-JUN-2013 10:18:26:17