问题: ORA-28002: the password will expire within 7 days

问题: ORA-28002: the password will expire within 7 days

问题描述

sqlplus登录Oracle的时候碰到如下问题:

$ 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数据库安全策略需要用户周期性更新密码;此信息表明用户账号周期快要到了,需要重置密码。

解决办法1:根据策略要求及时修改密码

  $ 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:修改安全策略,使得口令永不过期

2.1 查询用户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 查询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 重新登录帐号,修改密码

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 验证账号状态

$ 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>  

你可能感兴趣的:(问题: ORA-28002: the password will expire within 7 days)