ORA-12571: TNS: ASP.NET 数据包写入器失败

发布于 2024-11-30 23:45:57 字数 1732 浏览 7 评论 0原文

我的开发团队在针对 Oracle 11g 使用 ASP.NET 3.5 和 4.0 时遇到了许多 ORA-12571: TNS:packet writer failure 错误。这些错误的发生时间不一致,并且是由许多应用程序生成的。调用随机存储过程、数据包和内联 SQL 语句时会发生此异常。 Oracle 11 客户端安装在 Web 服务器上。有些应用程序使用 Microsoft System.Data.OracleClient 连接到 Oracle,有些应用程序使用 oracle 提供的 .NET 组件 (ODP.NET)。两个数据访问对象都会出现相同的错误。

还有其他非 .NET 应用程序在不同的 Web 服务器上运行,但使用相同的数据库服务器。这些应用程序不存在任何此类问题。我最初的想法是,Oracle 客户端的 Web 服务器上的某些配置不正确。

还有其他人收到此错误吗?你做了什么来修复它?

ORA-12571: TNS:packet writer failure

堆栈跟踪:

at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc)
   at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals)
   at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, ArrayList& resultParameterOrdinals)
   at System.Data.OracleClient.OracleCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.OracleClient.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)

My development team is experiencing numerous ORA-12571: TNS:packet writer failure errors using ASP.NET 3.5 and 4.0 against Oracle 11g. These errors are inconsistent as to when they occur, and are generated by numerous applications. This exception happens while calling random stored procedures, packets, and inline SQL statements. The Oracle 11 client is installed on the web server. Some applications use Microsoft System.Data.OracleClient to connect to Oracle, and some use the .NET components provided by oracle (ODP.NET). Both data access objects come up with the same error.

There are other non .NET applications that run on a different web server, but use the same database server. The apps do not have any such issues. My initial thinking is that there is something configured incorrectly on the web server with the Oracle client.

Has anyone else received this error? What did you do to fix it?

ORA-12571: TNS:packet writer failure

Stack Trace:

at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc)
   at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals)
   at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, ArrayList& resultParameterOrdinals)
   at System.Data.OracleClient.OracleCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.OracleClient.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

烂柯人 2024-12-07 23:45:57

另一种可能的解决方案是,您和 Oracle 数据库之间的防火墙认为您的连接已失效,并将其关闭。只有当您尝试执行查询并收到 ORA-12571 错误时您才会发现。

这是由于连接长时间打开且没有任何活动造成的。

解决方案是将 SQLNET.EXPIRE_TIME 添加到服务器上的 sqlnet.ora 文件中,并将其设置为某个间隔 (10)。这将导致每 10 分钟对连接进行一次 ping 操作,以确保它们仍然处于活动状态。

这样做的结果是您的防火墙将看到网络活动并且不会关闭连接。

SQLNET.EXPIRE_TIME=10

ORA-12571:TNS:数据包写入器失败 - 我必须解决的最难的问题之一

Another possible solution is that the firewall between you and the Oracle database thinks your connection is dead and closes it underneath you. You will only find out when you try to execute a query and get the ORA-12571 error.

This is caused by having connections open for a long time with no activity.

The solution is to add the SQLNET.EXPIRE_TIME to the sqlnet.ora file on the server and set it to some interval (10). This will cause the connections to be pinged every 10 minutes to ensure they are still alive.

The result of this is that your firewall will see network activity and not close the connection.

SQLNET.EXPIRE_TIME=10

ORA-12571: TNS:packet writer failure - One of the hardest problems I've had to resolve

野却迷人 2024-12-07 23:45:57

我认为这是 Oracle 中的一个错误。我遇到了 DBDataAdapter.Fill 方法的许多问题,其中 Oracle 客户端会因内存错误而阻塞。我通过使用应用了补丁 6 的 11.2.0.2 客户端解决了这个问题。

如果您搜索 Oracle 的支持站点,您会看到很多类似的问题。

另请检查 11g1 / 11g2 客户端的“读受保护内存”问题。

I think this is a bug in Oracle. I came across many issues with the DBDataAdapter.Fill method where the Oracle Client would choke on a memory error. This was resolved for me by using the 11.2.0.2 client with patch 6 applied.

If you search Oracle's Support site you will see many issues like this.

Check also on "Read Protected Memory" issues with the 11g1 / 11g2 clients.

纵性 2024-12-07 23:45:57

安装 elmah 模块并可以分析异常后,我尝试:

  1. 更改连接配置。
  2. 删除和/或更新服务器防火墙规则。
  3. 更新服务器计算机上的 Oracle 客户端。

上述任何选项都解决了问题,但我忘记了我们正在使用的过时的提供程序(System.Data.OracleClient)。在我将其替换为最新版本的 ODP.NET(Oracle.DataAccess)后,一切都开始完美运行。

Obs:根据您的异常描述,您当前正在使用过时的提供程序。

After I installed the elmah module and could analyze the exceptions, I tried to:

  1. Change the connection configuration.
  2. Remove and/or update the server firewall rules.
  3. Update the Oracle client on the server machine.

Any of the options above resolved the problem, but I was forgetting the obsolete provider (System.Data.OracleClient) the we were using. After I replaced it with the last version of the ODP.NET (Oracle.DataAccess), everthing started to work flawlessly.

Obs: Based on your exception description you are currently using the obsolete provider.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文