SUSE Manager/Oracle keepalive
Oracle Instant Client "keep alive" for use in SUSE Manager
Oracle Client will use the TCP Keepalive Feature of the Operating System.
- modify /etc/tnsnames.ora by closely following the example in the "ENABLE" Section of the Oracle Docs:
- edit /etc/rhn/rhn.conf. Change "db_name = //your_db_server_name/your_db " into "db_name = net_service_name" (use the same net_service_name you used in your /etc/tnsnames.ora)
- check the kernel's current keepalive values:
$> sysctl -a | grep keepalive net.ipv4.tcp_keepalive_time = 7200 # send the first keepalive after 3600 seconds (2h) net.ipv4.tcp_keepalive_intvl = 75 # after the first keepalive, send keepalives every 75 seconds net.ipv4.tcp_keepalive_probes = 9 # kill connection after 9 failed keepalives
- Adjust the kernels Keepalive values to your needs:
$> sysctl –w net.ipv4.tcp_keepalive_time=1800 $> echo “net.ipv4.tcp_keepalive_time = 1800” >> /etc/sysctl.conf
- restart Spacewalk
$> /usr/sbin/spacewalk-service stop && /usr/sbin/spacewalk-service start
- check if keepalive is now enabled for your database connections (use "netstat -tpno" and check the last two columns for the word "keepalive" and the corresponding timer values)
$> netstat -tnpo tcp 0 0 192.168.1.1:54729 192.168.2.2:1521 ESTABLISHED 26988/java keepalive (1530.03/0/0) tcp 0 0 192.168.1.1:54718 192.168.2.2:1521 ESTABLISHED 26944/httpd keepalive (1522.62/0/0)
Please note, these settings are only for IPv4 networking. While Oracle Database usually requires IPv4 enabled, still for IPv6 usually "keep alive" feature is not needed. The IPv6 networks are not performing network address translation, and the firewall has timeout more than 48 hours. If the connection breaks for IPv6, it is a clear sign of bad firewall configuration and changes has to be done there instead.