oracle SQLPlus 连接超时选项
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7228410/
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
SQLPlus connection timeout options
提问by user57421
We saw an issue other day, where the database server was responding to tnsping and not responding when trying to establish a connection..
前几天我们看到了一个问题,数据库服务器正在响应 tnsping 而在尝试建立连接时没有响应。
When we tried to connect to the DB.. It was just stuck there and never to login prompt.
当我们尝试连接到数据库时..它只是卡在那里并且永远不会登录提示。
So, what I'm trying to do here is to monitor the DB every 5 mins. In case of the above scinero. I may hang again in the same place..
所以,我在这里要做的是每 5 分钟监控一次数据库。在上述场景的情况下。我可能会再次挂在同一个地方..
Is there any connection timeout parameter while calling sqlplus.
调用sqlplus时是否有任何连接超时参数。
I'm using the below call
我正在使用下面的电话
sqlplus -s $constring @justexit.sql
sqlplus -s $constring @justexit.sql
Is there any connection timeout option, which will comeout after waiting for sometime.
是否有任何连接超时选项,等待一段时间后会出现。
Regards, Senny
问候, 森尼
回答by Ben
I don't understand how running this sqlplus script will work (disclaimer: unless it's part of a batch etc). Even if you're inserting the data into a table if you can't select from it again, due to timeout issues, then it's not going to help you. We have a similar system in place to monitor server load, which then goes into a table but to monitor whether the database is timing out, it makes more sense to use something like python to attempt to do something every 5 minutes and e-mail if it times out.
我不明白如何运行这个 sqlplus 脚本(免责声明:除非它是批处理的一部分等)。即使您将数据插入到表中,如果由于超时问题而无法再次从中选择,那么它也无济于事。我们有一个类似的系统来监控服务器负载,然后将其放入一个表中,但是为了监控数据库是否超时,使用 python 之类的东西每 5 分钟尝试做一些事情,如果它超时了。
The timeout interval is described here: http://download.oracle.com/docs/cd/B10501_01/server.920/a90842/ch3.htm
这里描述了超时间隔:http: //download.oracle.com/docs/cd/B10501_01/server.920/a90842/ch3.htm