2024年5月29日发(作者:)

Oracle口令和资源管理

1、Profiles: 概要文件,包含一些对口令和资源限制的一个命名的集合。通过CREATE

USER 或 ALTER USER 命令来指定用户。它可以是enabled 或 disabled。可以参考

default profile(默认,资源和口令没有做任何限定)。

sql>create user test

identified by test; //用户和口令都是test

2、口令管理:Account locking >Password history >Password expiration and

aging 口令生命周期和过期时间>Password verification 设定口令的复杂性(符号等)>

用户

口令限制是一直保持的。使用 CREATE USER or Lock,unlock ,expire accounts 这

些命令

sql> alter user test account lock; //帐号锁定

sql>alter user test account unlock; //帐号解锁

sql>alter user test password expire; //口令到期

(1)口令帐号锁定:FAILED_LOGIN_ATTEMPTS 在帐号被锁之前登录尝试的失败次

数 ,PASSWORD_LOCK_TIME 在尝试失败登录达到一定的次数后帐号被锁定的时间(单

位:1天),超过这个时间将自动解锁。

sql>create profile profile1 limit

password_lock_time 1/1440

failed_login_attempts 3; //配置文件profile1已创建

sql>alter user kong profile profile1; //将用户kong使用配置文件profile1

sql>conn kong/kkk //ERROR

sql>conn kong/kxf //ERROR

sql>conn kong/kkk //ERROR

sql>conn kong/111 //the account is locked 帐号已被锁定(登录失败3次后帐号

自动锁定)

sql>alter profile profile1 limit

password_lock_time 1/1440; //表示1分钟后锁定的帐号将自动解锁(1/60*1/24)

sql>conn kong/kxf;

(2)口令生存周期和失效后允许改变的时间:PASSWORD_LIFE_TIME 口令的生存

周期(口令经过多少天后会提示到期)/ PASSWORD_GRACE_TIME 失效后锁定,即设定

几天后锁定。