首页 > 其他分享 >ora-28001 ora-28002 密码过期

ora-28001 ora-28002 密码过期

时间:2022-10-22 23:41:09浏览次数:55  
标签:LIFE mm dd 28002 28001 TIME PASSWORD ora

问题描述:trace文件中发现存在ora-28001告警,如下所示:
数据库:oracle 11.2.0.4 64位
Mon Oct 17 04:26:02 2022
Errors in file d:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_1228.trc (incident=169673):
ORA-00600: internal error code, arguments: [], [], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [17059], [0x19BFF78CB0], [0x19BFF79548], [0x1ABFF6CB90], [], [], [], [], [], [], [], []
ORA-28001: the password has expired
原因分析:经确认PASSWORD_LIFE_TIME参数已经为UNLIMITED,那为什么还会出现用户密码过期的异常呢?
oracle 11g默认default概要文件中PASSWORD_LIFE_TIME为180天,若将其修改为unlimited,那么还没有被提示ora-28002 or ora-28001告警的用户不会再遇到该问题,但修改之前就遇到ora-28002 or ora-28001告警的用户就需要更改一次密码,此后该用户才能正常登陆且PASSWORD_LIFE_TIME变为unlimited.
1、模拟场景
查用户Profile,此次以scott用户作为测试.
> select username,profile from dba_users;

USERNAME PROFILE
------------------------------ --------------------
SYS DEFAULT
SYSTEM DEFAULT
OUTLN DEFAULT
MGMT_VIEW DEFAULT
FLOWS_FILES DEFAULT
MDSYS DEFAULT
ORDSYS DEFAULT
EXFSYS DEFAULT
DBSNMP MONITORING_PROFILE
WMSYS DEFAULT
APPQOSSYS DEFAULT

USERNAME PROFILE
------------------------------ --------------------
APEX_030200 DEFAULT
OWBSYS_AUDIT DEFAULT
ORDDATA DEFAULT
CTXSYS DEFAULT
ANONYMOUS DEFAULT
SYSMAN DEFAULT
XDB DEFAULT
ORDPLUGINS DEFAULT
OWBSYS DEFAULT
SI_INFORMTN_SCHEMA DEFAULT
OLAPSYS DEFAULT

USERNAME PROFILE
------------------------------ --------------------
SCOTT DEFAULT
ORACLE_OCM DEFAULT
XS$NULL DEFAULT
MDDATA DEFAULT
DIP DEFAULT
APEX_PUBLIC_USER DEFAULT
SPATIAL_CSW_ADMIN_USR DEFAULT
SPATIAL_WFS_ADMIN_USR DEFAULT

30 rows selected.
查密码有效期.
> select * from dba_profiles s where s.profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME'

PROFILE RESOURCE_NAME RESOURCE LIMIT
--------------- -------------------------------- -------- ---------------
DEFAULT PASSWORD_LIFE_TIME PASSWORD 180
> select username,account_status,to_char(lock_date,'yyyy-mm-dd hh24:mi:ss'),to_char(expiry_date,'yyyy-mm-dd hh24:mi:ss'),to_char(created,'yyyy-mm-dd hh24:mi:ss') from dba_users where username=’SCOTT’;

USERNAME ACCOUNT_STATUS TO_CHAR(LOCK_DATE,' TO_CHAR(EXPIRY_DATE TO_CHAR(CREATED,'YY
------------------------------ -------------------------------- ------------------- ------------------- -------------------
SCOTT OPEN 2023-04-18 10:19:18 2009-08-15 00:50:14
1 rows selected.
修改password_life_time为1分钟过期.
SQL> alter profile default limit password_life_time 1/24/60;

Profile altered.
SQL> select * from dba_profiles s where s.profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME';

PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT PASSWORD_LIFE_TIME PASSWORD .0006
SQL> ! date
Sat Oct 22 20:51:05 CST 2022

SQL> conn scott/tiger
ERROR:
ORA-28002: the password will expire within 7 days

Connected.
SQL> select username,account_status,to_char(lock_date,'yyyy-mm-dd hh24:mi:ss'),to_char(expiry_date,'yyyy-mm-dd hh24:mi:ss'),to_char(created,'yyyy-mm-dd hh24:mi:ss') from dba_users where username=’SCOTT’;

USERNAME ACCOUNT_STATUS TO_CHAR(LOCK_DATE,' TO_CHAR(EXPIRY_DATE TO_CHAR(CREATED,'YY
------------------------------ -------------------------------- ------------------- ------------------- -------------------
SCOTT EXPIRED(GRACE) 2022-10-29 20:56:10 2009-08-15 00:50:14

1 rows selected.
现将密码有效期设置为永久.
SQL> alter profile default limit password_life_time unlimited;

Profile altered.
SQL> conn scott/tiger
ERROR:
ORA-28002: the password will expire within 7 days


Connected.
SQL> select * from dba_profiles s where s.profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME';

PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT PASSWORD_LIFE_TIME PASSWORD UNLIMITED
说明:成功模拟出异常场景,虽然scott用户的PASSWORD_LIFE_TIME为UNLIMITED,但登陆依然报警ora-28002.
2、解决方案
由于此处存在7天的宽限期,所以通过关键字“TRACE”查出用户信息,对于状态为EXPIRED & LOCKED的用户,可以通过相应关键字查询出来.
SQL> select * from dba_profiles where resource_name='PASSWORD_GRACE_TIME';

PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT PASSWORD_GRACE_TIME PASSWORD 7
MONITORING_PROFILE PASSWORD_GRACE_TIME PASSWORD DEFAULT
SQL> select username,account_status,to_char(lock_date,'yyyy-mm-dd hh24:mi:ss'),to_char(expiry_date,'yyyy-mm-dd hh24:mi:ss'),to_char(created,'yyyy-mm-dd hh24:mi:ss') from dba_users where account_status like '%GRACE%';

USERNAME ACCOUNT_STATUS TO_CHAR(LOCK_DATE,' TO_CHAR(EXPIRY_DATE TO_CHAR(CREATED,'YY
------------------------------ -------------------------------- ------------------- ------------------- -------------------
SCOTT EXPIRED(GRACE) 2022-10-29 20:56:10 2009-08-15 00:50:14
重置密码
SQL> alter user scott identified by tiger account unlock;

User altered.

SQL> conn scott/tiger
Connected.
结论:scott用户恢复正常,成功处理ora-28001 ora28002的异常.

参考网址:https://blog.csdn.net/qq_43307934/article/details/84828285

标签:LIFE,mm,dd,28002,28001,TIME,PASSWORD,ora
From: https://blog.51cto.com/u_12991611/5786176

相关文章

  • Oracle-11g_图形化界面安装
    写给自己,也写给大家,每天进步一点点。。。这两天都没运动,全搞这玩意了。记录一下,别忘了。关于数据库版本和操作系统版本之间相互兼容的问题,这个需要重视,以免出现,下面我在安装......
  • [Oracle]复习笔记-SQL部分内容
    Oracle笔记--SQL部分整体框架语句的执行顺序:from→where→groupby→having→select→orderbyselect*from*where*groupby*having*orderby*关于selec......
  • 你真的会使用Typora吗?
    你真的会使用Typora吗?标题一级标题:#空格+内容二级标题:##空格+内容字体加粗:内容两边各加两个*号你真美!斜体:内容两边各加一个*号你真帅!删除线:两边各加两个~号(波浪......
  • Fedora中配置软件存储库:添加、启用、禁用
    Fedora系统从存储库中获取其软件,每个存储库都附带了许多可供安装的免费软件应用程序。​Fedora发行版从存储库获取其软件,每个存储库都附带了许多可安装的免费和专有软件......
  • Fedora安装wine + Wechat
    1.安装winetricks:sudodnfsearchwinetricks,然后安装;2.给winetricks执行权限:sudochmod+xwinetricks3.建立安装目录,并且将微信exe文件下载sudomkdir-p/opt/......
  • Fedora好使
    原来用过一阵freebsd,还装了桌面了,编译挺长时间,之后又得装输入法,换源,一堆事,遇到问题还找不到答案;后来想试试gentoolinux或者arch,安装不友好,还是在折腾系统,太费劲,现在电脑......
  • Python: Decorator Pattern
     DuDecorator.py#装饰模式DecoratorPatternimportsix#https://pypi.org/project/six/[email protected]_metaclass(ABCMeta)classAbstra......
  • 解决oracle18c没有hr用户
    1.查找系统变量ORACLE_HOME的值2.按照路径寻找sql文件ORACLE_HOME变量值+demo\schema\human_resources3.把hr_main.sql脚本文件放在此处4.登入sys用户执行@+路径+文......
  • Fedora15 安装mplayer以及添加解码器播放wmv(原创)
    Mplayer称为世界上万能的播放器,对于Mplayer简单的操作界面,Mplayer对所有流媒体支持都让我对万能的播放器mplayer一见钟情,最近把我的fedora升级到Fedora14,又得重新​......
  • 【Oracle数据库】Oracle SQL*Plus环境下的简单操作
     OracleSQL*Plus环境与查询 (1)登录到Oracle   (2)helpindex查看Oracle有关命令   (3)创建登录表  (4)插入数据  (5)查询所有数据   (6)设置列的显示格式     ......