問(wèn)題: ORA-28002: the password will expire within 7 days
問(wèn)題描述
sqlplus登錄Oracle的時(shí)候碰到如下問(wèn)題:
$ sqlplus scott/tiger@orcl
SQL*Plus: Release 11.2.0.1.0 Production on Sun Oct 22 23:23:05 2017
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-28002: the password will expire within 7 days
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
原因
Oracle數(shù)據(jù)庫(kù)安全策略需要用戶(hù)周期性更新密碼涤垫;此信息表明用戶(hù)賬號(hào)周期快要到了汛骂,需要重置密碼席镀。
解決辦法1:根據(jù)策略要求及時(shí)修改密碼
$ sqlplus scott/tiger@orcl
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jun 20 14:08:01 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-28002: the password will expire within 7 days
Connected to:
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
SQL> PASSWORD
Changing password for SCOTT
Old password:
New password:
Retype new password:
Password changed
SQL>
解決辦法2:修改安全策略,使得口令永不過(guò)期
2.1 查詢(xún)用戶(hù)Profile
$ export ORACLE_SID=orcl
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sun Oct 22 23:36:35 2017
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select profile from dba_users where username = 'SCOTT';
PROFILE
------------------------------
DEFAULT
SQL>
2.2 查詢(xún)Profile的口令策略
SQL> select limit from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME';
LIMIT
----------------------------------------
180
SQL>
2.3 重置Profile的口令策略
SQL> alter profile default limit password_life_time unlimited;
Profile altered.
SQL>
2.4 重新登錄帳號(hào)杈女,修改密碼
SQL> connect scott/tiger
ERROR:
ORA-28002: the password will expire within 7 days
Connected.
SQL> password
Changing password for SCOTT
Old password:
New password:
Retype new password:
Password changed
SQL> quit
2.5 驗(yàn)證賬號(hào)狀態(tài)
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sun Oct 22 23:56:28 2017
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select account_status from dba_users where username='SCOTT';
ACCOUNT_STATUS
--------------------------------
OPEN
SQL>