1634516549(1).jpg
从当前用户切换用户到 oracle用户
[root@mysqlw1 /]# su – oracle
[oracle@mysqlw1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 15 10:29:16 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select username, account_status from dba_users;
select username, account_status from dba_users;
image.png
SELECT * FROM dba_profiles WHERE profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';
SQL> select * from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME';
PROFILE
------------------------------------------------------------
RESOURCE_NAME
----------------------------------------------------------------
RESOURCE_TYPE
----------------
LIMIT
--------------------------------------------------------------------------------
DEFAULT
PASSWORD_LIFE_TIME
PASSWORD
180
SQL> alter profile default limit password_life_time unlimited;
Profile altered.
该账户被锁定执行如下sql
alter user 用户名 account unlock;
eg:SQL> alter user TEST account unlock;
该账户过期执行如下sql
alter user 用户名 identified by 密码;(修改密码通把密码进行重置成密码,改变账号状态有EXPIRED改为OPEN)
eg:
image.png
下面可以查询系统中的用户和创建的用户,通过created字段可以看到创建的时间,默认从此刻起,6个月后就密码过期了。就会报ORA-28001: the password has expired 的错误:
select * from dba_users t where t.username = 'EPLATFORMTEST'