我们正在Azure Windows VM上运行Oracle 19c数据库。我们的配置如下:
当从VM运行时,没有“空闲SQL会话”被断开,但是当从公共IP地址访问时,“空闲SQL连接”在30分钟被断开。
ORA-03135: connection lost contact
我们希望我们的“空闲SQL连接”是持久的,这是我们迄今为止尝试过的:
SQLNET.EXPIRE_TIME = 1000000
SQLNET.INBOUND_CONNECT_TIMEOUT = 1000000
(ENABLE=BROKEN)
目前,我正在尝试实现Oracle的生存包,但我还没有成功。
对此有什么指示或想法吗?谢谢
更新我找到了一个解决方案,这就是我为修复它所做的工作:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"KeepAliveTime"=dword:00007530
"KeepAliveInterval"=dword:000003e8
"TcpMaxDataRetransmissions"=dword:00000010
发布于 2020-09-14 16:06:46
您需要在客户端机器上更改一个或两个内核可调性。使TCP保持活动(ENABLE=BROKEN)有用。默认情况下,Linux内核在2小时后发送第一个TCP保持活动探测:
Linux内核:
# cat /proc/sys/net/ipv4/tcp_keepalive_time
7200
Delay before the 1st probe is sent - after 2 hours !!!
# cat /proc/sys/net/ipv4/tcp_keepalive_intvl
75
Interval between probes.
# cat /proc/sys/net/ipv4/tcp_keepalive_probes
9
The number of "lost" probes indicating that the connection is dead.
当设置保持活时间和保持活动间隔为5秒时(仅供测试)。30秒应该足够推动),那么您应该可以在TCP转储中看到这样的内容:
[~]# tcpdump -pni ens224 -v "tcp port 1521 and ( tcp[tcpflags] & tcp-ack != 0 and ( (ip[2:2] - ((ip[0]&0xf)<<2) ) - ((tcp[12]&0xf0)>>2) ) == 0 )"
tcpdump: listening on ens224, link-type EN10MB (Ethernet), capture size 262144 bytes
14:56:49.994675 IP (tos 0x0, ttl 64, id 12096, offset 0, flags [DF], proto TCP (6), length 52)
192.168.8.200.37196 > 192.168.8.212.ncube-lm: Flags [.], cksum 0x9313 (incorrect -> 0x4b94), ack 2263270845, win 359, options [nop,nop,TS val 78140944 ecr 7133273], length 0
14:56:49.994829 IP (tos 0x0, ttl 64, id 55327, offset 0, flags [DF], proto TCP (6), length 52)
192.168.8.212.ncube-lm > 192.168.8.200.37196: Flags [.], cksum 0xadcf (correct), ack 1, win 207, options [nop,nop,TS val 7138281 ecr 78110940], length 0
14:56:55.002668 IP (tos 0x0, ttl 64, id 12097, offset 0, flags [DF], proto TCP (6), length 52)
192.168.8.200.37196 > 192.168.8.212.ncube-lm: Flags [.], cksum 0x9313 (incorrect -> 0x2474), ack 1, win 359, options [nop,nop,TS val 78145952 ecr 7138281], length 0
14:56:55.002809 IP (tos 0x0, ttl 64, id 55328, offset 0, flags [DF], proto TCP (6), length 52)
192.168.8.212.ncube-lm > 192.168.8.200.37196: Flags [.], cksum 0x9a3f (correct), ack 1, win 207, options [nop,nop,TS val 7143289 ecr 78110940], length 0
14:57:00.010680 IP (tos 0x0, ttl 64, id 12098, offset 0, flags [DF], proto TCP (6), length 52)
192.168.8.200.37196 > 192.168.8.212.ncube-lm: Flags [.], cksum 0x9313 (incorrect -> 0xfd53), ack 1, win 359, options [nop,nop,TS val 78150960 ecr 7143289], length 0
14:57:00.011296 IP (tos 0x0, ttl 64, id 55329, offset 0, flags [DF], proto TCP (6), length 52)
192.168.8.212.ncube-lm > 192.168.8.200.37196: Flags [.], cksum 0x86af (correct), ack 1, win 207, options [nop,nop,TS val 7148297 ecr 78110940], length 0
6 packets captured
6 packets received by filter
0 packets dropped by kernel
https://serverfault.com/questions/1033844
复制相似问题