Oracle JDBC:用户名/密码无效(ora-01017) [英] Oracle JDBC : invalid username/password (ora-01017)

查看:2599
本文介绍了Oracle JDBC:用户名/密码无效(ora-01017)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与oracle数据库服务器的jdbc连接有一个奇怪的问题。

I have a strange problem with jdbc connection to an oracle database server.

我们在tomcat服务器上运行应用程序。这些应用程序使用oracle数据库。所有应用程序都使用相同的凭据

We've applications on a tomcat server running. These application use an oracle database. All applications use the same credentials.

全天运行良好的应用程序。晚上没有活动。当应用程序尝试将自己重新连接到数据库时,我们会在早上收到一些(2或3)ORA-01017(无效的用户名/密码)错误。

Applications running fine the whole day. At night there is no activity. In the morning we get a few (2 or 3) ORA-01017 (invalid username/password) errors when the applications trying to reconnect themselves to the database.

然后重新连接工作和应用程序将正常运行。

Then reconnection works and the applications will operate normal.

这可以工作几天(大约5天),然后一个或多个应用程序块!所有重新连接尝试都失败。

This works for some days (around 5 days) and then one or more of the application block! All reconnection attempts fail.

我们跟踪网络通信,发现如果连接失败并且 ORA-01017 NO CREDENTIALS 发送的地方。

We've traced network communication and found that if the connection fails with ORA-01017 NO CREDENTIALS where sent.

当然晚上没有人接触过这个系统。

Of course no one touches the system at night.

尝试解决方法的一个尝试就是重启tomcat服务器每天早上6点清理每个连接缓存或池。这没有帮助。

One attempt for a workaround is that we restart the tomcat server every morning at 6 o'clock to clean up every connection cache or pool. It does not help.

什么是错的?任何想法?

Whats wrong? Any ideas?

在完全堵塞的情况下持续5天的间隔时间(每天重复)对我来说看起来很奇怪。

The continued 5 day interval in the appearance of a total blockage (while restating every day) looks very strange to me.

配置

数据库Oracle 10.2,JDBC驱动程序11.2瘦,tomcat 6.0.24,JDK 6,操作系统是Windows,一些应用程序是Avaya Voice Portal 5.0的对话框。

Database Oracle 10.2, JDBC Driver 11.2 thin, tomcat 6.0.24, JDK 6, OS is windows, some of the applications are Dialogs for the Avaya Voice Portal 5.0.

我们自己的(非VP)应用程序使用简单的连接(没有汇集)。

Our own (non VP) applications use simple Connections (no pooling).

系统最初设置在Windows 2003服务器上,在apserver和tomcat服务器之间有一个WAN。

The system was originally setup on a Windows 2003 server with a WAN between apserver and tomcat server.

系统现在迁移到数据库服务器附近的linux(CentOS)服务器并且运行正常。没有ORA-01017了。

The system is now migrated to a linux (CentOS) server near the database server and works fine. No ORA-01017 anymore.

推荐答案

奇怪。一些想法:


  1. 记录用户名和密码几天,以确保它们是正确的。代码中的某些错误可能会覆盖您不期望的值。

  1. Log the user name and password for a few days just to make sure they are correct. Some bug in the code might overwrite a value that you don't expect.

考虑将JNDI与Tomcat提供的连接池一起使用。 DBCP有一些非常高级的选项来检查连接是否仍然存在以及如何重新连接它。之后,您不再在日志中看到任何与连接相关的问题。这也可以提高安全性,因为没有任何应用程序需要知道数据库密码。

Consider to use JNDI with a connection pool provided by Tomcat. DBCP has some really advanced options to check whether a connection is still alive and how to reconnect it. After that, you shouldn't see any connection related issues in your logs anymore. This would also improve security because none of the apps need to know the DB password anymore.

这可能是资源泄漏的问题(如果应用程序永远不会发生返回连接)但是我希望有一个不同的错误消息。

It might be a problem with resource leaks (happens if an app never returns the connection) but I'd expect a different error message, then.

某些数据库(DB2,H2)允许创建从远程表创建远程表的视图其他数据库可见,如本地表。不确定Oracle是否支持此功能,但如果支持,则可能是此远程表的用户名/密码错误。

Some databases (DB2, H2) allow to create views that make remote tables from other databases visible like local tables. Not sure whether Oracle supports this but if it does, then maybe the user name/password for this remote table is wrong.

另请考虑此博客文章中的要点: Oracle ORA-01017提示

Also consider the points in this blog post: Oracle ORA-01017 tips

乍一看,帖子中没有任何内容可能会导致您的问题,但也许某些脚本正在操纵 tnsnames.ora (例如分发新副本。)

At first glance, nothing in the post could cause your problems but maybe some script is manipulating the tnsnames.ora (for example distributing a new copy).

或者DBA在每日备份时禁用所有用户。

Or the DBA disabled all users for the time of the daily backup.

这篇关于Oracle JDBC:用户名/密码无效(ora-01017)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆