oracle用户密码规则,ORACLE密码策略——密码重用规则

二、PASSWORD_REUSE_MAX和PASSWORD_REUSE_TIME中有一个为UNLIMITED,另一个为其他值。

这个时候你的密码将永远无法重用。

看看administrator guide上是怎么说的:

Use the CREATE PROFILE statement to specify a time interval during which users cannot reuse a password. In the following statement, a profile is defined where the PASSWORD_REUSE_TIME clause specifies that the user cannot reuse the password

for 60 days.

CREATE PROFILE prof LIMIT

PASSWORD_REUSE_TIME 60

PASSWORD_REUSE_MAX UNLIMITED;

In the next statement, the PASSWORD_REUSE_MAX clause specifies that the number of password changes the user must make before the current password can be used again is three.

CREATE PROFILE prof LIMIT

PASSWORD_REUSE_MAX 3

PASSWORD_REUSE_TIME UNLIMITED;

Note: If you specify PASSWORD_REUSE_TIME or PASSWORD_REUSE_MAX, you must set the other to UNLIMITED or not specify it at all.

文档告诉我们,只使用其中一个,把另外一个设置为UNLIMITED,但是这是不正确的,这样会导致你的密码永远无法重用。

SQL> alter profile prof_test limit password_reuse_max 3;

配置文件已更改

SQL> select resource_name, limit from dba_profiles

2  where profile = 'PROF_TEST' and resource_type = 'PASSWORD';

RESOURCE_NAME                    LIMIT

-------------------------------- ----------------------------------------

FAILED_LOGIN_ATTEMPTS            DEFAULT

PASSWORD_LIFE_TIME               DEFAULT

PASSWORD_REUSE_TIME              UNLIMITED

PASSWORD_REUSE_MAX               3

PASSWORD_VERIFY_FUNCTION         DEFAULT

PASSWORD_LOCK_TIME               DEFAULT

PASSWORD_GRACE_TIME              DEFAULT

已选择7行。

SQL> alter user test identified by test;

用户已更改。

SQL> alter user test identified by test;

alter user test identified by test

*

ERROR 位于第 1 行:

ORA-28007: 无法重新使用口令

SQL> alter user test identified by t1;

用户已更改。

SQL> alter user test identified by t2;

用户已更改。

SQL> alter user test identified by t3;

用户已更改。

SQL> alter user test identified by test;

alter user test identified by test

*

ERROR 位于第 1 行:

ORA-28007: 无法重新使用口令

修改profile后,只对test用户的后续操作有效,第一次可以修改密码为test是因为oracle没有记录初始密码,而第二次修改就会失败,因为密码已经不能重用了。

根据文档,我们只需要修改密码三次,就可以重用,但是测试的结果确是密码无法在重用。

SQL> alter profile prof_test limit password_reuse_max unlimited;

配置文件已更改

SQL> alter user test identified by test;

用户已更改。

SQL> alter profile prof_test limit password_reuse_time 1/144;

配置文件已更改

SQL> select resource_name, limit from dba_profiles

2  where profile = 'PROF_TEST' and resource_type = 'PASSWORD';

RESOURCE_NAME                    LIMIT

-------------------------------- ----------------------------------------

FAILED_LOGIN_ATTEMPTS            DEFAULT

PASSWORD_LIFE_TIME               DEFAULT

PASSWORD_REUSE_TIME              .0069

PASSWORD_REUSE_MAX               UNLIMITED

PASSWORD_VERIFY_FUNCTION         DEFAULT

PASSWORD_LOCK_TIME               DEFAULT

PASSWORD_GRACE_TIME              DEFAULT

已选择7行。

SQL> set time on

16:47:29 SQL> alter user test identified by test;

alter user test identified by test

*

ERROR 位于第 1 行:

ORA-28007: 无法重新使用口令

16:47:48 SQL>

16:48:23 SQL>

16:59:45 SQL> alter user test identified by test;

alter user test identified by test

*

ERROR 位于第 1 行:

ORA-28007: 无法重新使用口令

16:59:59 SQL>

17:07:32 SQL> alter user test identified by test;

alter user test identified by test

*

ERROR 位于第 1 行:

ORA-28007: 无法重新使用口令

17:07:40 SQL> set time off

SQL>

修改PASSWORD_REUSE_TIME为1/144,也就是说大概10分钟的时间,考虑的oracle的误差,我们在10分钟和20分钟后分别进行测试。结果发现密码仍然无法重用。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值