问题描述
我正在通过web服务通过pl/sql跟踪17000订单到目标服务器。我正在批量运行多个作业 (每个作业500个订单) 以调用webservice以获取订单状态。因此,大约有34个作业同时运行 (17000/500),以获取每个500订单的状态。现在,我的工作很少能正常完成,但很少能长期运行,并且没有完成并卡住 (甚至没有给出任何错误或异常),因为未通过utl_http.begin_request与目标服务器建立连接。
我已经添加了UTL_HTTP.set_transfer_timeout,但是我相信这可以获取响应,但是这里的连接本身没有建立。
请给我一个解决方案,以便在这种情况下,如果我无法建立连接,那么作业应该结束给出一些错误。
我已经添加了UTL_HTTP.set_transfer_timeout,但是我相信这可以获取响应,但是这里的连接本身没有建立。
请给我一个解决方案,以便在这种情况下,如果我无法建立连接,那么作业应该结束给出一些错误。
专家解答
MOS note 760664.1涵盖此问题。
简短的答案是超时doesn't适用于making初始连接。只有建立连接后才能拨打电话。
幸运的是有一个解决方法:
In Oracle there is a workaround to this limitation, you can configure the TCP connection timeout by setting any of the below SQL*Net parameter:
* SQLNET.OUTBOUND_CONNECT_TIMEOUT
* TCP.CONNECT_TIMEOUT
The outbound connect timeout is a super set of the TCP connect timeout which specifies a limit on the time taken to establish a TCP connection. For more information about these parameters, you can refer to chapter "Parameters for the sqlnet.ora File" in "Oracle Database Net Services Reference" guide.
Example:
Inside the SQLNET.ORA file on the database server, add any of the following parameters which will time out all the TCP connection attempts that take longer than the specified number of seconds to connect.
TCP.CONNECT_TIMEOUT = 30
or
SQLNET.OUTBOUND_CONNECT_TIMEOUT = 30
Limitation:
Setting these parameters will not only impose a 30 second timeout for UTL_HTTP package, but it will affect all outbound TCP connections from the database. So, only consider using this workaround if you would like to limit the connection timeout for ALL TCP connections from your database.
简短的答案是超时doesn't适用于making初始连接。只有建立连接后才能拨打电话。
幸运的是有一个解决方法:
In Oracle there is a workaround to this limitation, you can configure the TCP connection timeout by setting any of the below SQL*Net parameter:
* SQLNET.OUTBOUND_CONNECT_TIMEOUT
* TCP.CONNECT_TIMEOUT
The outbound connect timeout is a super set of the TCP connect timeout which specifies a limit on the time taken to establish a TCP connection. For more information about these parameters, you can refer to chapter "Parameters for the sqlnet.ora File" in "Oracle Database Net Services Reference" guide.
Example:
Inside the SQLNET.ORA file on the database server, add any of the following parameters which will time out all the TCP connection attempts that take longer than the specified number of seconds to connect.
TCP.CONNECT_TIMEOUT = 30
or
SQLNET.OUTBOUND_CONNECT_TIMEOUT = 30
Limitation:
Setting these parameters will not only impose a 30 second timeout for UTL_HTTP package, but it will affect all outbound TCP connections from the database. So, only consider using this workaround if you would like to limit the connection timeout for ALL TCP connections from your database.
文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
Oracle DataGuard高可用性解决方案详解
孙莹
589次阅读
2025-03-26 23:27:33
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
542次阅读
2025-04-15 17:24:06
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
455次阅读
2025-04-18 14:18:38
Oracle SQL 执行计划分析与优化指南
Digital Observer
442次阅读
2025-04-01 11:08:44
XTTS跨版本迁移升级方案(11g to 19c RAC for Linux)
zwtian
439次阅读
2025-04-08 09:12:48
墨天轮个人数说知识点合集
JiekeXu
436次阅读
2025-04-01 15:56:03
【ORACLE】记录一些ORACLE的merge into语句的BUG
DarkAthena
435次阅读
2025-04-22 00:20:37
【ORACLE】你以为的真的是你以为的么?--ORA-38104: Columns referenced in the ON Clause cannot be updated
DarkAthena
411次阅读
2025-04-22 00:13:51
Oracle数据库一键巡检并生成HTML结果,免费脚本速来下载!
陈举超
402次阅读
2025-04-20 10:07:02
Oracle 19c RAC更换IP实战,运维必看!
szrsu
390次阅读
2025-04-08 23:57:08