我有一个用户获得ORA-28002,表明密码将在六天内到期.我运行了以下内容:
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
select * from dba_profiles where RESOURCE_NAME LIKE 'PASSWORD_LIFE_TIME';
表明这些值确实已更改为UNLIMITED.
密码已标记为“已过期”或在dba_users中标有“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,Data Mining and Real Application Testing options