遇到的问题:
[realestate][ERROR] [2022-05-17 14:27:11] com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(2469) | create connection SQLException, url: jdbc:p6spy:oracle:thin:@172.18.13.83:1521/orclxj, errorCode 28000, state 99999
java.sql.SQLException: ORA-28000: the account is lockedat oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:389)at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:382)at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:600)at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:445)at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:380)at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:760)at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:401)at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)at com.p6spy.engine.spy.P6SpyDriver.connect(P6SpyDriver.java:102)at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:149)at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:218)at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:143)at com.alibaba.druid.filter.FilterAdapter.connection_connect(FilterAdapter.java:786)at com.alibaba.druid.filter.FilterEventAdapter.connection_connect(FilterEventAdapter.java:38)at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:143)at com.alibaba.druid.filter.FilterAdapter.connection_connect(FilterAdapter.java:786)at com.alibaba.druid.filter.FilterEventAdapter.connection_connect(FilterEventAdapter.java:38)at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:143)at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:218)at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:143)at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1515)at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1578)at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466)
通过报错发现,是ORA-28000,意思是账户密码输出错误次数超过十次,用户被锁定
解决办法:
第一步用别的账户登录上去用SQL查询目前有哪些账户被锁定了:
SELECT USERNAME,ACCOUNT_STATUS,LOCK_DATE FROM DBA_USERS;
查询结果:
发现有两个有两个用户被锁定,BDCK和SMWB_FRAMEWORK,LOCK_DATE为锁定时间,能看到锁定时间是最近,然后用语句给这两个用户解锁:
ALTER USER BDCK ACCOUNT UNLOCK;
ALTER USER SMWB_FRAMEWORK ACCOUNT UNLOCK;
这样被锁定的用户就解锁成功了。
重置某用户密码语句:
alter user system identified by “密码”