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

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

问题描述

jdbc 连接到 oracle 数据库服务器时遇到一个奇怪的问题.

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

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

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

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

我们跟踪了网络通信,发现如果连接失败,ORA-01017 NO CREDENTIALS 发送到哪里.

当然没有人在晚上接触系统.

一种解决方法的尝试是我们每天早上6点重启tomcat服务器,清理每个连接缓存或池.它没有帮助.

怎么了?有什么想法吗?

连续 5 天出现完全阻塞(每天重复)对我来说很奇怪.

配置:

数据库 Oracle 10.2,JDBC Driver 11.2 Thin,tomcat 6.0.24,JDK 6,操作系统是 windows,一些应用程序是 Avaya Voice Portal 5.0 的对话框.

我们自己的(非 VP)应用程序使用简单的连接(无池化).

<小时>

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

系统现在迁移到数据库服务器附近的linux(CentOS)服务器并且运行良好.不再有 ORA-01017.

解决方案

Odd.一些想法:

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

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

  3. 这可能是资源泄漏的问题(如果应用程序从不返回连接,就会发生这种情况),但我预计会出现不同的错误消息.

  4. 某些数据库(DB2、H2)允许创建视图,使来自其他数据库的远程表像本地表一样可见.不确定 Oracle 是否支持此功能,但如果支持,则此远程表的用户名/密码可能有误.

还要考虑这篇博文中的要点:Oracle ORA-01017 提示>

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

或者 DBA 在每日备份期间禁用所有用户.

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

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

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.

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

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.

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?

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

Config :

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.

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


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

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

解决方案

Odd. Some ideas:

  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.

  2. 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.

  3. 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.

  4. 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.

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

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).

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

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

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