oracle 如何防止蟾蜍在一段时间后断开其会话?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21829987/
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-19 02:14:17  来源:igfitidea点击:

How to prevent toad disconnecting its session after some time?

oracletoad

提问by VINOTH ENERGETIC

I am using toad for oracle client.

我正在为 oracle 客户端使用蟾蜍。

In which the session disconnects after some time. How to make it enabled at all time.

其中会话在一段时间后断开连接。如何使其始终启用。

回答by Patrick Hofman

See the Dell website:

请参阅戴尔网站

Keeping database connections alive is generally not recommended

...

If you would still like to force connectivity at all times, you can do so by doing one of the following two suggestions.

A)

Turn ON the DBMS Output (Polling) in Toad, which is similar to Toad pinging the database. Go to the Editor Window | DBMS Output Tab (lower half of the Editor window) | click on the "Turn Output On" red icon | then the icon will turn green.

NOTE: Starting Toad version 12.1, it's little different. Also ensure the “Interval Polling” button or icon is 'depressed' as that is the one that sends the polling at every i.e. 5 seconds. You can set this to 60 seconds, which is the max.

B)

Start Database | Monitor | Session Browser, which has an auto refresh feature, which should cause some activities to occur on the database.

NOTE: The Session Browser feature requires DBA privileges.

通常不建议保持数据库连接处于活动状态

...

如果您仍然希望始终强制连接,您可以通过执行以下两个建议之一来实现。

一种)

在 Toad 中打开 DBMS 输出(轮询),这类似于 Toad ping 数据库。转到编辑器窗口 | DBMS 输出选项卡(编辑器窗口的下半部分)| 单击“打开输出”红色图标 | 然后图标会变成绿色。

注意:从 Toad 12.1 版开始,几乎没有什么不同。还要确保“间隔轮询”按钮或图标被“按下”,因为它是每 5 秒发送一次轮询的按钮或图标。您可以将其设置为 60 秒,这是最大值。

乙)

启动数据库 | 监控 | 会话浏览器,具有自动刷新功能,应该会导致在数据库上发生一些活动。

注意:会话浏览器功能需要 DBA 权限。

回答by Jeewantha Samaraweera

There is no straightforward way. One way to achieve this is to use the "Test connection(Reconnect)" option with a shortcut command.

没有直接的方法。实现此目的的一种方法是使用带有快捷命令的“测试连接(重新连接)”选项。

  1. Go to Session ---> Test Connections(Reconnect) and press enter.

  2. You can map the above-mentioned command to an easy key combination so that it will be available for you whenever you get the disconnected error.

  3. To map the shortcuts, Go to

  1. 转到会话 ---> 测试连接(重新连接)并按 Enter。

  2. 您可以将上述命令映射到一个简单的组合键,以便在出现断开连接错误时可以使用它。

  3. 要映射快捷方式,请转到

View ---> Toad Options ---> Select "Shortcuts" in the available options. Find the TestConnections(Reconnect) command and assign new shortcuts keys you wanted.

查看 ---> Toad 选项 ---> 在可用选项中选择“快捷方式”。找到 TestConnections(Reconnect) 命令并分配您想要的新快捷键。

回答by Annick Van Bergen

I also encounterd this problem and found a solution. At Startup of Toad the Session Browser also has to be open all the time to keep the connection Alive. You can do this automatically by setting the Auto Open checkbox on. You do this in menu View/Toad Options/Windows and then to scroll down and find the Session browser and turn the Auto open checkbox on. ?

我也遇到了这个问题,找到了解决办法。在 Toad 启动时,会话浏览器也必须始终打开以保持连接活动。您可以通过设置自动打开复选框来自动执行此操作。您可以在菜单查看/Toad 选项/Windows 中执行此操作,然后向下滚动并找到会话浏览器并打开自动打开复选框。?

回答by DBAseaa

Review information on "Dead connection Detection" (DCD) EXCERPT: "A less common usage scenario for DCD is to keep database connections alive when an external firewall timeout is configured to terminate idle connections."

查看有关“死连接检测”(DCD) 摘录的信息:“DCD 的一个不太常见的使用场景是在配置外部防火墙超时以终止空闲连接时保持数据库连接处于活动状态。”

This is especially noticeable with JDBC connections in environments with strict firewalls.

这对于防火墙严格的环境中的 JDBC 连接尤其明显。

Using JDBC with Firewallsand the next section: Frequent Abrupt Disconnection from Server EXCERPT: "If the network is not reliable, then it is difficult for a client to detect the frequent disconnections when the server is abruptly disconnected."

将 JDBC 与防火墙一起使用以及下一部分:与服务器的频繁突然断开连接 摘录:“如果网络不可靠,那么当服务器突然断开连接时,客户端很难检测到频繁断开连接。”

Example: Automic Applications Manager

示例:自动应用程序管理器

1a. Add the following to the sqlnet.ora

1a. 将以下内容添加到 sqlnet.ora

SQLNET.EXPIRE_TIME=10 # some number less than the firewall

1b. Reload the listener.

1b. 重新加载监听器。

lsnrctl reload listener
  1. Add the following to the client tnsnames.ora connection string

    (ENABLE=BROKEN) # immediately after: (DESCRIPTION=

  1. 将以下内容添加到客户端 tnsnames.ora 连接字符串中

    (ENABLE=BROKEN) # 紧接着:(DESCRIPTION=