database “ORA-28001: 密码已过期”无法修复

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9479781/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 08:29:01  来源:igfitidea点击:

"ORA-28001: the password has expired" not fixable

databaseoraclepasswords

提问by nimrod

I am facing a problem with my production database. The password expired and although I changed the password, it still says it is expired. Even stranger, I have a production web application and a development web application. Both of them access the same database. The production web application works perfectly, and with the development web application I always get:

我的生产数据库出现问题。密码已过期,虽然我更改了密码,但它仍然说它已过期。更奇怪的是,我有一个生产 Web 应用程序和一个开发 Web 应用程序。他们都访问同一个数据库。生产 Web 应用程序运行良好,使用开发 Web 应用程序我总是得到:

10:25:42,919 WARN  [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: ORA-28001: the password has expired
)
    at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:225)
    at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)
    at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:633)
    at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:267)
    at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:622)
    at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404)
    at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:381)
    at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
    at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
    at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
    at org.jboss.security.auth.spi.DatabaseServerLoginModule.getUsersPassword(DatabaseServerLoginModule.java:173)
    at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:245)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:784)
    at javax.security.auth.login.LoginContext.access
bash
cd /opt/oracle/admin/<SID>
. ./setenv.ora
sqlplus / as sysdba

>sql: ALTER USER <user> IDENTIFIED BY <new password>;
0(LoginContext.java:203) at javax.security.auth.login.LoginContext.run(LoginContext.java:698) at javax.security.auth.login.LoginContext.run(LoginContext.java:696) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:695) at javax.security.auth.login.LoginContext.login(LoginContext.java:594) at org.jboss.security.plugins.auth.JaasSecurityManagerBase.defaultLogin(JaasSecurityManagerBase.java:552) at org.jboss.security.plugins.auth.JaasSecurityManagerBase.authenticate(JaasSecurityManagerBase.java:486) at org.jboss.security.plugins.auth.JaasSecurityManagerBase.isValid(JaasSecurityManagerBase.java:365) at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:160) at org.jboss.web.tomcat.security.JBossWebRealm.authenticate(JBossWebRealm.java:384) at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:258) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:417) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:722) Caused by: java.sql.SQLException: ORA-28001: the password has expired at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:388) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:381) at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:564) at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:431) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186) at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:366) at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:752) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:359) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503) at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:207) ... 41 more

I already logged into the server and did this:

我已经登录到服务器并执行以下操作:

SQL> select * from dba_users where username = 'user';

USERNAME USER_ID PASSWORD ACCOUNT_STATUS LOCK_DATE EXPIRY_DATE
------------------------------ ---------- ------------------------------ -------------------------------- ------------------- -------------------
DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED PROFILE INITIAL_RSRC_CONSUMER_GROUP
------------------------------ ------------------------------ ---------------------- ------------------------------ ------------------------------
EXTERNAL_NAME
------------------------------------------------------------------------------------------------------------------------------------------------------
PASSWORD E AUTHENTI
-------- - --------
<user> 50 OPEN
<userDAT> TEMP 29.07.2010 17:38:32 DEFAULT DEFAULT_CONSUMER_GROUP

10G 11G N PASSWORD


SQL> select p.* from dba_users u, dba_profiles p where u.profile = p.profile and u.userName = 'user'; 

PROFILE RESOURCE_NAME RESOURCE LIMIT 
------------------------------ -------------------------------- -------- ---------------------------------------- 
DEFAULT COMPOSITE_LIMIT KERNEL UNLIMITED 
DEFAULT SESSIONS_PER_USER KERNEL UNLIMITED 
DEFAULT CPU_PER_SESSION KERNEL UNLIMITED 
DEFAULT CPU_PER_CALL KERNEL UNLIMITED 
DEFAULT LOGICAL_READS_PER_SESSION KERNEL UNLIMITED 
DEFAULT LOGICAL_READS_PER_CALL KERNEL UNLIMITED 
DEFAULT IDLE_TIME KERNEL UNLIMITED 
DEFAULT CONNECT_TIME KERNEL UNLIMITED 
DEFAULT PRIVATE_SGA KERNEL UNLIMITED 
DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD UNLIMITED 
DEFAULT PASSWORD_LIFE_TIME PASSWORD UNLIMITED 
DEFAULT PASSWORD_REUSE_TIME PASSWORD UNLIMITED 
DEFAULT PASSWORD_REUSE_MAX PASSWORD UNLIMITED 
DEFAULT PASSWORD_VERIFY_FUNCTION PASSWORD NULL 
DEFAULT PASSWORD_LOCK_TIME PASSWORD 1 
DEFAULT PASSWORD_GRACE_TIME PASSWORD 7 

16 rows selected. 

Here's the information requested by Jim:

以下是Jim 要求的信息:

sqlplus /nolog

SQL> connect / as SYSDBA
Connected.

SQL> SELECT username, account_status FROM dba_users WHERE ACCOUNT_STATUS LIKE '%EXPIRED%';
# ... your locked account should be listed ...

SQL> ALTER USER sample IDENTIFIED BY sample;         
User altered.

SQL> ALTER USER sample ACCOUNT UNLOCK;
User altered.

SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
Profile altered.

SQL> exit

采纳答案by nimrod

I am 100% sure that my config is correct. I was overwriting all local data with the files from the productive app server. Still no success.

我 100% 确定我的配置是正确的。我用来自生产应用服务器的文件覆盖了所有本地数据。还是没有成功。

The problem is also this password expiry problem came suddenly while developing, so I am sure that I did not change anything.

问题也是这个密码过期问题是在开发时突然出现的,所以我确定我没有改变任何东西。

However, I logged into the test system and reset the password there. My test system contains like 100 rows, my productive app like 1 million, so I can definitely tell you that I am on the right database.

但是,我登录了测试系统并在那里重置了密码。我的测试系统包含 100 行,我的生产应用程序包含 100 万行,所以我可以肯定地告诉你我在正确的数据库中。

After resetting the password of the test system, I can log-in again! So this whole story is very strange. Thanks for the support.

重置测试系统密码后,我可以重新登录了!所以这整个故事很奇怪。感谢您的支持。

回答by kares

Assuming the Oracle DB (should work for Oracle-XE's SAMPLE as well) is on Unix, ssh-in and :

假设 Oracle DB(也应该适用于 Oracle-XE 的 SAMPLE)在 Unix 上,ssh-in 和:

select * 
  from dba_users 
 where username = '<yourUserName>'

select p.* 
  from dba_users u
     , dba_profiles p 
 where u.profile = p.profile 
   and u.userName = '<yourUserName>'

回答by Jim

Can you post the results of the following? Also, what version of Oracle are you using? I'm assuming 11G?

您可以发布以下结果吗?另外,你用的是什么版本的Oracle?我假设是11G?

ALTER USER user_name IDENTIFIED BY new_user_name ;
ALTER USER user_name IDENTIFIED BY user_name ;

I'd be curious to see what profile you're using, and what your settings are.

我很想知道您使用的是什么配置文件,以及您的设置是什么。

回答by Sandeep

Even I was facing same problem. Issue got resolved after following these below mentioned steps,

甚至我也面临着同样的问题。遵循以下提到的步骤后,问题得到解决,

  1. Check to see if any of the accounts are expired
  1. 检查是否有任何帐户已过期

select username, profile, account_status, expiry_date from dba_users;

从 dba_users 中选择用户名、配置文件、帐户状态、到期日期;

  1. If no accounts are expired, you can skip to step 7
  2. Dynamically create SQL that will unexpired the expired accounts. You can unexpired the account by resetting the password. NOTE: You will need to substitute {password} for the password you are using for your user.
  1. 如果没有帐户过期,您可以跳到第 7 步
  2. 动态创建 SQL,使过期帐户未过期。您可以通过重置密码来使帐户未过期。注意:您需要用 {password} 代替您为用户使用的密码。

select 'ALTER USER ' || username || ' identified by {password};' from dba_users where account_status like 'EXPIRED%' and username != 'XS$NULL';

选择“更改用户”|| 用户名 || '由{密码}标识;' 来自 dba_users,其中 account_status 像 'EXPIRED%' 和 username != 'XS$NULL';

  1. Execute the SQL generated in Step 3
  2. Dynamically create SQL that will unlock the locked accounts.
  1. 执行步骤3中生成的SQL
  2. 动态创建将解锁锁定帐户的 SQL。

select 'ALTER USER ' || username || ' account unlock;' from dba_users where account_status like 'LOCKED%' and username != 'XS$NULL';

选择“更改用户”|| 用户名 || '账户解锁;' 来自 dba_users,其中 account_status 像 'LOCKED%' 和 username != 'XS$NULL';

  1. Execute the SQL generated in Step 5
  2. Modify the profile assigned to the accounts that you don't want to expire so the PASSWORD_LIFE_TIME is set to UNLIMITED. This will keep them from expiring again. In my case, I needed to update the DEFAULT profile.
  1. 执行步骤5中生成的SQL
  2. 修改分配给您不想过期的帐户的配置文件,以便将 PASSWORD_LIFE_TIME 设置为 UNLIMITED。这将防止它们再次过期。就我而言,我需要更新 DEFAULT 配置文件。

alter profile DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED ;

更改配置文件 DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED ;

Reference: http://jaredsoablogaz.blogspot.in/2013/04/weblogic-server-not-starting-due-to.html

参考:http: //jaredsoablogaz.blogspot.in/2013/04/weblogic-server-not-starting-due-to.html

-Sandeep

-桑迪普

回答by Omotayo Peter

enter image description here1.go to your command line interface. 2. then type sqlplus.

在此处输入图片说明1.转到您的命令行界面。2.然后输入sqlplus。

回答by atamanroman

Just connect with SQLPlus and the affected user to your DB. SQLPlus will prompt you to change your password.

只需将 SQLPlus 和受影响的用户连接到您的数据库。SQLPlus 将提示您更改密码。

回答by Karim Oukara

just execute this query:

只需执行此查询:

C:\>sqlplus /nolog
SQL> connect / as SYSDBA
SQL> select * from dba_profiles;
SQL> alter profile default limit password_life_time unlimited;
SQL> alter user hse identified by oracle;
SQL> commit;
SQL> exit;

commit;

犯罪;

回答by Taravat

The easy way, just do it :)

简单的方法,就去做吧:)

##代码##

回答by DMG

I did faced similar issue with Oracle of password expiry, to resolve this issue when I tried launching PLSQL, it's prompted me with user name /password and I entered the correct one but system throws me with password expiry error along with password reset input . After I reset my password I was able to connect to oracle database.

我确实遇到过与 Oracle 密码过期的类似问题,为了在我尝试启动 PLSQL 时解决此问题,它提示我输入用户名 /password 并且我输入了正确的用户名,但系统向我抛出了密码过期错误以及密码重置输入。重置密码后,我能够连接到oracle 数据库。