ORACLE 帐户 状态说明

简介: DBA_USERS中的ACCOUNT_STATUS的值有OPENEXPIREDEXPIRED(GRACE)LOCKED(TIMED)LOCKEDEXPIRED & LOCKED(TIMED)EXPIRED(GRACE) & LOCKED(TIMED)EXPIRED & LOCKEDEXPIRED(GRACE) & LOCKED 大概的给解释一下open.
DBA_USERS中的ACCOUNT_STATUS的值有
OPEN
EXPIRED
EXPIRED( GRACE)
LOCKED(TIMED)
LOCKED
EXPIRED & LOCKED(TIMED)
EXPIRED(GRACE) & LOCKED(TIMED)
EXPIRED & LOCKED
EXPIRED(GRACE) & LOCKED
大概的给解释一下open.locked,expired,EXPIRED(GRACE) ,LOCKED(TIMED) ,
其余几个概念就是这几个状态的组合:-)

1. open 当前 用户是开放的可以使用的.
[color=gray]SQL> select username,account_status from dba_users where username = 'TONGJW';

USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
TONGJW                         OPEN

SQL> conn tongjw
Enter password: *******
Connected.
[/color]
2. expired 表示用户已经过期, 登录的时候, 如果密码输入正确,系统会提示重新输入密码的.
[color=gray]
SQL> conn jfdata/jf
Connected.
SQL> alter user tongjw account unlock;

User altered.

SQL> alter user tongjw password expire;

User altered.

SQL> conn tongjw
Enter password: *******
ERROR:
ORA-28001: the password has expired


Changing password for tongjw
New password: *******
Retype new password: *******
Password changed
Connected.
[/color]

3. locked 表明当前帐户被锁了, 不可以登录的.
[color=gray]
SQL> conn jfdata/jf
Connected.
SQL> alter user tongjw account lock;

User altered.

SQL> conn tongjw
Enter password: *******
ERROR:
ORA-28000: the account is locked


Warning: You are no longer connected to ORACLE.
[/color]
expired (grace)  与 locked (timed) 是有 系统的profile来进行控制的.

4. expired (grace) 指定一个期限, 到达这个期限的时候,系统会给出一个警告并且允许登录(grace), 如果过了这段期限, 对应的密码就会自动过期, 相当于我们的密码过期提醒.
PASSWORD_GRACE_TIME
PASSWORD_LIFE_TIME
Specify the number of days after the grace period begins during which a warning is issued and login is allowed. If the password is not changed during the grace period, the password expires.
[color=gray]
SQL> select username,account_status,profile from dba_users where username = 'TONGJW';

USERNAME                       ACCOUNT_STATUS                   PROFILE
------------------------------ -------------------------------- ------------------------------
TONGJW                         OPEN                             DEFAULT

SQL> create profile test limit
  2    password_life_time 5 password_grace_time 5;

Profile created.

SQL> alter user tongjw profile test;

User altered.

SQL> select username,account_status,profile from dba_users where username = 'TONGJW';

USERNAME                       ACCOUNT_STATUS                   PROFILE
------------------------------ -------------------------------- ------------------------------
TONGJW                         OPEN                             TEST

SQL> conn tongjw/playboy
Connected.
SQL> /
[/color]
[color=red]这是我们修改系统时间, 将日期往后修改几天[/color]
[color=gray]
[oracle@TzDbTzcenter2 ]$ su
Password:
[root@TzDbTzcenter2 ]# date
Tue Mar 22 18:42:26 CST 2005
[root@TzDbTzcenter2 ]# date '03281842'
Mon Mar 28 18:42:00 CST 2005
[root@TzDbTzcenter2 ]# exit
[oracle@TzDbTzcenter2 ]$ sqlplus tongjw/tongjw

SQL*Plus: Release 9.2.0.4.0 - Production on Mon Mar 28 18:42:01 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

ERROR:
[b]ORA-28002: the password will expire within 5 days[/b]



Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

SQL> conn jfdata/jf
Connected.
SQL> select username,account_status,profile from dba_users where username = 'TONGJW';

USERNAME                       ACCOUNT_STATUS                   PROFILE
------------------------------ -------------------------------- ------------------------------
TONGJW                         EXPIRED(GRACE)                   TEST

SQL>
[/color]
[color=red]再将日期向后修改几天, 我们可以看到此时用户的状态已经改为Expired[/color]
[color=gray]
[oracle@TzDbTzcenter2 ]$ sqlplus tongjw/tongjw

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Apr 5 18:44:02 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

ERROR:
ORA-28001: the password has expired


Changing password for tongjw
New password:
Retype new password:
ERROR:
ORA-00988: missing or invalid password(s)


Password unchanged
Enter user-name: jfdata/jf

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

SQL> select username,account_status,profile from dba_users where username = 'TONGJW';

USERNAME                       ACCOUNT_STATUS                   PROFILE
------------------------------ -------------------------------- ------------------------------
TONGJW                         EXPIRED                          TEST
[/color]


5. locked(timed)
PASSWORD_LOCK_TIME
Specify the number of days an account will be locked after the specified number of consecutive failed login attempts.
(在PROFILE中设置最大错误密码输入次数,而被LOCK掉了)
FAILED_LOGIN_ATTEMPTS
Specify the number of failed attempts to log in to the user account before the account is locked.

设定相关的profile属性^_^.
[color=gray]
SQL> alter user tongjw profile default;

User altered.

SQL> drop profile test;

Profile dropped.

SQL> create profile test limit
  2    password_lock_time 5 failed_login_attempts 3;

Profile created.

SQL> alter user tongjw profile test;

User altered.
[/color]
修改系统的时间信息.
[color=gray]
[root@TzDbTzcenter2 ]# date
Tue Mar 22 18:55:42 CST 2005
[root@TzDbTzcenter2 ]# date '03281855'
Mon Mar 28 18:55:00 CST 2005
[root@TzDbTzcenter2 ]# exit
[oracle@TzDbTzcenter2 ]$ sqlplus jfdata/jf

SQL*Plus: Release 9.2.0.4.0 - Production on Mon Mar 28 18:55:02 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

SQL> conn tongjw/tongjw
Connected.
SQL> conn tongjw/tongj1
ERROR:
ORA-01017: invalid username/password; logon denied


Warning: You are no longer connected to ORACLE.
SQL> conn tongjw/tongj2
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> conn tongjw/tongj3
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> conn tongjw/tongj4
ERROR:
ORA-28000: the account is locked


SQL> conn tongjw/tongjw
ERROR:
ORA-28000: the account is locked




SQL> conn jfdata/jf
Connected.
SQL> select username,account_status,profile from dba_users where username = 'TONGJW';

USERNAME                       ACCOUNT_STATUS                   PROFILE
------------------------------ -------------------------------- ------------------------------
TONGJW                         LOCKED(TIMED)                    TEST
相关文章
|
8天前
|
SQL Oracle 关系型数据库
【Oracle】玩转Oracle数据库(一):装上去,飞起来!
【Oracle】玩转Oracle数据库(一):装上去,飞起来!
48 7
|
1月前
|
Oracle 关系型数据库 数据库
|
2月前
|
开发框架 Oracle 关系型数据库
ASP.NET实验室LIS系统源码 Oracle数据库
LIS是HIS的一个组成部分,通过与HIS的无缝连接可以共享HIS中的信息资源,使检验科能与门诊部、住院部、财务科和临床科室等全院各部门之间协同工作。 
35 4
|
2月前
|
SQL Oracle 关系型数据库
【Oracle】玩转Oracle数据库:装上去,飞起来!
本文是一篇关于Oracle数据库安装和使用的博文摘要。作者以轻松幽默的笔调介绍了自己在实验中掌握的Oracle数据库基本操作,包括使用组件查看命令、配置数据库监听器等。作者也分享了在实验中遇到的一些有趣问题,如SQL语句缺少分号导致的意外错误。此外,作者还强调了登录sys用户和启动实例加载数据库的注意事项,并鼓励读者面对挑战时保持乐观,不断提升自己的能力。整体风格风趣严谨,引人入胜。
339 0
|
1月前
|
关系型数据库 分布式数据库 数据库
PolarDB PostgreSQL版:Oracle兼容的高性能数据库
PolarDB PostgreSQL版是一款高性能的数据库,具有与Oracle兼容的特性。它采用了分布式架构,可以轻松处理大量的数据,同时还支持多种数据类型和函数,具有高可用性和可扩展性。它还提供了丰富的管理工具和性能优化功能,为企业提供了可靠的数据存储和处理解决方案。PolarDB PostgreSQL版在数据库领域具有很高的竞争力,可以满足各种企业的需求。
|
26天前
|
Oracle 关系型数据库 数据库
Oracle数据库基本概念理解(3)
Oracle数据库基本概念理解(3)
18 2
|
1月前
|
Oracle 关系型数据库 数据库
如何利用 Docker 安装 Oracle 数据库
【2月更文挑战第14天】
90 0
|
8天前
|
SQL Oracle 关系型数据库
【Oracle】玩转Oracle数据库(七):RMAN恢复管理器
【Oracle】玩转Oracle数据库(七):RMAN恢复管理器
36 5
|
26天前
|
Oracle 关系型数据库 数据库
Oracle数据库基本概念理解(2)
Oracle数据库基本概念理解(2)
13 1
|
8天前
|
存储 SQL Oracle
【Oracle】玩转Oracle数据库(二):体系结构、存储结构与各类参数
【Oracle】玩转Oracle数据库(二):体系结构、存储结构与各类参数
32 7