如何摆脱ORA-28002消息密码将在6天内过期?


18

我有一个用户收到ORA-28002,该密码指示密码将在六天内过期。我执行以下操作:

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; 

但是,当我尝试以用户身份登录时,该消息仍然存在。执行此:

select * from dba_profiles where RESOURCE_NAME LIKE 'PASSWORD_LIFE_TIME';

显示值实际上已更改为UNLIMITED。

Answers:


17

密码已在dba_users中标记为“ EXPIRED”或标记为“ EXPIRY_DATE”。您将不得不更改它。您可以将其设置回相同的密码。简单的方法是通过“值”设置密码。这通常会绕过历史记录检查。

12:28:33 SQL> select * from dba_users where username = 'MYUSER1';

USERNAME                          USER_ID PASSWORD
------------------------------ ---------- ------------------------------
ACCOUNT_STATUS                   LOCK_DATE          EXPIRY_DATE
-------------------------------- ------------------ ------------------
DEFAULT_TABLESPACE             TEMPORARY_TABLESPACE           CREATED
------------------------------ ------------------------------ ------------------
PROFILE                        INITIAL_RSRC_CONSUMER_GROUP
------------------------------ ------------------------------
EXTERNAL_NAME
--------------------------------------------------------------------------------
MYUSER1                               338 66856982BE5CD23F
OPEN
USERS                          TEMP                           17-JAN-11
DEFAULT                        DEFAULT_CONSUMER_GROUP



Elapsed: 00:00:00.03
12:28:43 SQL> alter user myuser1 password expire;

User altered.

Elapsed: 00:00:00.00
12:29:11 SQL> select * from dba_users where username = 'MYUSER1';

USERNAME                          USER_ID PASSWORD
------------------------------ ---------- ------------------------------
ACCOUNT_STATUS                   LOCK_DATE          EXPIRY_DATE
-------------------------------- ------------------ ------------------
DEFAULT_TABLESPACE             TEMPORARY_TABLESPACE           CREATED
------------------------------ ------------------------------ ------------------
PROFILE                        INITIAL_RSRC_CONSUMER_GROUP
------------------------------ ------------------------------
EXTERNAL_NAME
--------------------------------------------------------------------------------
MYUSER1                               338 66856982BE5CD23F
EXPIRED                                             17-JAN-11
USERS                          TEMP                           17-JAN-11
DEFAULT                        DEFAULT_CONSUMER_GROUP



Elapsed: 00:00:00.03
12:29:14 SQL>

其格式为“由值'来自dba_users.password的哈希值'标识的其他用户USER”;

[TEST] C:\>sqlplus system

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Jan 17 12:18:16 2011

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Enter password:

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

new: showmode BOTH
12:18:17 SQL> prompt end of LOGIN.SQL
end of LOGIN.SQL
12:18:17 SQL> create user myuser1 identified by mypassword1;

User created.

Elapsed: 00:00:00.01
12:18:21 SQL> grant connect, resource to myuser1;

Grant succeeded.

Elapsed: 00:00:00.01
12:18:30 SQL> connect myuser1/mypassword1
Connected.
12:18:39 SQL> connect system
Enter password:
Connected.
12:18:51 SQL> alter user myuser1 password expire;

User altered.

Elapsed: 00:00:00.00
12:19:05 SQL> connect myuser1/mypassword1
ERROR:
ORA-28001: the password has expired


Changing password for myuser1
New password:
Retype new password:
Password changed
Connected.
12:19:16 SQL> connect myuser1/mypassword1
ERROR:
ORA-01017: invalid username/password; logon denied


Warning: You are no longer connected to ORACLE.
12:19:21 SQL> connect system
Enter password:
Connected.
12:19:34 SQL> alter user myuser1 identified by mypassword1;

User altered.

Elapsed: 00:00:00.01
12:19:49 SQL> alter user myuser1 identified by mypassword1 password expire;

User altered.

Elapsed: 00:00:00.01
12:20:26 SQL> select username, password from dba_users where username = 'MYUSER1';

USERNAME                       PASSWORD
------------------------------ ------------------------------
MYUSER1                        66856982BE5CD23F

Elapsed: 00:00:00.01
12:20:36 SQL> alter user myuser1 identified by values '66856982BE5CD23F' ;

User altered.

Elapsed: 00:00:00.01
12:21:01 SQL> connect myuser1/mypassword1
Connected.
12:21:13 SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

15

请找到以下4个查询,然后从系统数据库中运行这些查询。

//For seeing Full user details
SELECT profile FROM dba_users WHERE username = 'SYSTEM';

//This query is used to change the password life time to unlimited
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; 

//This query is used to chagne the default password.
alter user SYSTEM identified by "system";

1
相当容易,而且解释清楚。
S. Mayol

5

使用Toad的同事在“用户”下的“模式浏览器”中看到了指示的帐户。

我们通过右键单击解锁用户成功。在“更改用户”对话框中,我们重新输入了旧密码,并且未选中“密码已锁定”复选框。



1

您应该更改用户帐户。首先连接到您的sys帐户,然后可以从该帐户执行以下步骤:

alter user practice identified by password;

这将解决您的问题...


1

我知道这很旧,但是对于那些使用Oracle SQL Developer的用户,请遵循以下步骤:

  • 使用另一个用户登录到您拥有的任何数据库连接,您可以使用默认的“ system”或“ sys”用户名以及在那里输入的任何密码。

  • 打开连接树并找到“其他用户”节点,然后像这样打开:

在此处输入图片说明

  • 在“其他用户”下的子注释中找到您的用户名,然后右键单击以编辑用户,如下所示:

在此处输入图片说明

  • 输入您的新密码,并且取消检查密码已过期,然后应用。再次右键单击“编辑用户”以查看设置是否已更改(如果需要)。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.