Oracle 数据库连接超时设置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12029271/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 04:24:44  来源:igfitidea点击:

Settings of connection timeout for Oracle database

oracleoracle10gdatabase-administration

提问by user12384512

For some period time of inactivity, connection to oracle database are dropped and this leads to error - > end-of-file on communication channel.

在不活动的一段时间内,与 oracle 数据库的连接被断开,这会导致错误 -> end-of-file on communication channel

1) Is there any oracle settings on client machine (sqlnet.ora or some kind of environment variables) which could specify connection timeout and differs from client to client ? Or it could be client settings of some "heartbeat" feature (client sends packets in some interval), which prevent connection to be dropped by firewall ?

1)客户端机器(sqlnet.ora或某种环境变量)上是否有任何可以指定连接超时并且从客户端到客户端不同的oracle设置?或者它可能是某些“心跳”功能的客户端设置(客户端在某个时间间隔发送数据包),从而防止连接被防火墙丢弃?

2) Where I can find setting on server machine for connection timeout due inactivity ? Is it possible to see this setting from Sql developer without acquiring physical access to oracle host ?

2) 在哪里可以找到服务器计算机上因不活动而导致连接超时的设置?是否可以在不获得对 oracle 主机的物理访问权限的情况下从 Sql developer 看到此设置?

3) Is it normal behavior for Oracle Sql Developer to be disconnected from Oracle server due inactivity ?

3) Oracle Sql Developer 由于不活动而与 Oracle 服务器断开连接是正常行为吗?

回答by Justin Cave

There is no client setting that would cause a connection to be dropped leading to an ORA-03113 error after some time. And there is no setting on the database server that would cause a connection to be timed out leading to an ORA-03113 error.

没有客户端设置会导致连接断开,一段时间后会导致 ORA-03113 错误。并且数据库服务器上没有设置会导致连接超时导致 ORA-03113 错误。

The server can enable dead connection detection (DCD) by setting the sqlnet.expire_time settingin the server's sqlnet.ora. That will cause the server to periodically send a probe packet to verify that the client is still up.

服务器可以通过在服务器的 sqlnet.ora 中设置sqlnet.expire_time 设置来启用死连接检测 (DCD) 。这将导致服务器定期发送探测数据包以验证客户端是否仍在运行。

Oracle will never drop a connection due to inactivity with an ORA-03113 error. It is possible to configure Oracle to drop idle connections but that would generate a different error. If you are getting an ORA-03113 error, either the firewall is causing the connection to be dropped or there is some other hiccup in the network between the client machine and the server.

Oracle 永远不会因为 ORA-03113 错误而因不活动而断开连接。可以将 Oracle 配置为丢弃空闲连接,但这会产生不同的错误。如果您收到 ORA-03113 错误,要么是防火墙导致连接中断,要么是客户端计算机和服务器之间的网络出现其他问题。