Oracle 密码失灵
java.sql.SQLException: ORA-28001: 密碼已經屆滿
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)
at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:791)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:362)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
"ORA-28001:口令已经失灵":
oracle11g创建用户时缺省密码过期限制是180天(即6个月), 如果超过180天用户密码未做修改则该用户无法登录。 oracle公司是为了数据库的安全性默认在11g中引入了这个默认功能,但是这个默认的功能很容易被dba或者是开发人员给疏忽,一旦密码180天未修改过,就会出现这样的问题。
解决方法可通过如下sql语句
select * from dba_profiles where profile='default' and resource_name='password_life_time'
查询密码的有效期设置,limit字段是密码有效天数。
在密码将要过期或已经过期时可通过如下语句进行修改密码,密码修改后该用户可正常连接数据库。
alter user 用户名 identified by 密码 ;
如果想去除180天的
密码生存周期的限制可通过如下sql语句将其关闭
alter profile default limit password_life_time unlimited
如上sql语句将口令有效期默认值180天修改成了“无限制”。但是出于数据库安全性考虑,不建议将password_life_time值设置成unlimited