转自:

https://blog.51cto.com/carefree/1382811

测试环境:10.2.0.2.0
测试用户:SCOTT
测试用的三组密码:oracle1 oracle2 oracle3

PASSWORD_REUSE_TIME和PASSWORD_REUSE_MAX:这两个参数必须互相关联设置,password_reuse_time指定了密码不能重用前的天数,而password_reuse_max则指定了当前密码被重用之前密码改变的次数。

总结两者之间的规律:
 (1)PASSWORD_REUSE_MAX,PASSWORD_REUSE_TIME都为UNLIMITED,密码可以随意重用,没有任何限制。
 (2)PASSWORD_REUSE_MAX,PASSWORD_REUSE_TIME均为指定值时,必须满足这两者的条件时才可以重用密码。
 (3)当PASSWORD_REUSE_MAX,PASSWORD_REUSE_TIME两个有其中一个不为UNLIMITED,则密码永远不能重用。

以下为验证过程:

--确认SCOTT使用的DEFAULT profile
SQL> select USERNAME from dba_users where PROFILE='DEFAULT' and USERNAME='SCOTT';
USERNAME
------------------------------
SCOTT
 

第一种情况,PASSWORD_REUSE_TIME,PASSWORD_REUSE_MAX值均为UNLIMITED

SQL>  select profile,limit from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_REUSE_TIME';
PROFILE LIMIT
------------------------------ ----------------------------------------
DEFAULT UNLIMITED
SQL> select profile,limit from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_REUSE_MAX';
PROFILE LIMIT
------------------------------ ----------------------------------------
DEFAULT UNLIMITED
--测试
SQL> alter user scott identified by oracle;
User altered.
SQL> /
User altered.
SQL> /
User altered.
 

可以发现,用户密码可以不受限制的重用

第二种情况,PASSWORD_REUSE_TIME,PASSWORD_REUSE_MAX值均不为UNLIMITED,这里设定ASSWORD_REUSE_TIME 1/1440表示一分钟后可以重用,PASSWORD_REUSE_MAX 1表示密码更新过一次即可重用。

SQL> alter profile DEFAULT limit PASSWORD_REUSE_MAX 1;
Profile altered.
SQL> alter profile DEFAULT limit PASSWORD_REUSE_TIME 1/1440;
Profile altered.
--测试
SQL> alter user scott identified by oracle1;
User altered.
SQL> select to_char(sysdate,'yyyy-mm-dd,hh24:mi:ss') as a from dual;
A
-------------------
2014-03-20,23:40:45
SQL> alter user scott identified by oracle;
User altered.
SQL> select to_char(sysdate,'yyyy-mm-dd,hh24:mi:ss') as a from dual;
A
-------------------
2014-03-20,23:42:05
SQL> alter user scott identified by oracle1;
User altered.
SQL> select to_char(sysdate,'yyyy-mm-dd,hh24:mi:ss') as a from dual;
A
-------------------
2014-03-20,23:42:18
--间隔不足一分钟,更改提示失败
SQL> alter user scott identified by oracle;
alter user scott identified by oracle
*
ERROR at line 1:
ORA-28007: the password cannot be reused
--直接用上一次的密码更改,更改失败
SQL> alter user scott identified by oracle1;
alter user scott identified by oracle1
*
ERROR at line 1:
ORA-28007: the password cannot be reused
 

由上面的实验,我们可以看出,PASSWORD_REUSE_TIME,PASSWORD_REUSE_MAX值均不为UNLIMITED,必须同时满足这两个条件才可以更改密码。

第三种情况,PASSWORD_REUSE_TIME 为UNLIMITED,PASSWORD_REUSE_MAX为1

SQL> alter profile DEFAULT limit PASSWORD_REUSE_TIME unlimited;
Profile altered.
--测试
SQL> alter user scott identified by oracle1;
alter user scott identified by oracle1
*
ERROR at line 1:
ORA-28007: the password cannot be reused
SQL> alter user scott identified by oracle2;
User altered.
SQL> alter user scott identified by oracle1;
alter user scott identified by oracle1
*
ERROR at line 1:
ORA-28007: the password cannot be reused
SQL> alter user scott identified by oracle;
alter user scott identified by oracle
*
ERROR at line 1:
ORA-28007: the password cannot be reused
 

由此可以看出,当PASSWORD_REUSE_TIME 为UNLIMITED,PASSWORD_REUSE_MAX为指定值,密码在任何时候都不可以重用。

第四种情况,PASSWORD_REUSE_MAX 为UNLIMITED,PASSWORD_REUSE_TIME为1/1440。

SQL> alter profile DEFAULT limit PASSWORD_REUSE_MAX unlimited;
Profile altered.
SQL> alter profile DEFAULT limit PASSWORD_REUSE_TIME 1/1440;
Profile altered.
SQL> select to_char(sysdate,'yyyy-mm-dd,hh24:mi:ss') as a from dual;
A
-------------------
2014-03-20,23:50:16
SQL> select to_char(sysdate,'yyyy-mm-dd,hh24:mi:ss') as a from dual;
A
-------------------
2014-03-20,23:53:10
SQL> alter user scott identified by oracle2;
alter user scott identified by oracle2
*
ERROR at line 1:
ORA-28007: the password cannot be reused
SQL> alter user scott identified by oracle1;
alter user scott identified by oracle1
*
ERROR at line 1:
ORA-28007: the password cannot be reused
SQL> alter user scott identified by oracle;
alter user scott identified by oracle
*
ERROR at line 1:
ORA-28007: the password cannot be reused
SQL> alter user scott identified by oracle4;
User altered.
SQL> alter user scott identified by oracle;
alter user scott identified by oracle
*
ERROR at line 1:
ORA-28007: the password cannot be reused
 

从上面的实验可以看出,当PASSWORD_REUSE_MAX为UNLIMITED,PASSWORD_REUSE_TIME为指定值,密码在任何时候都不可以重用。

最新文章

  1. spring 定时任务
  2. (转)POJ题目分类
  3. 【NOIP模拟赛】工资
  4. MapBox TileMill
  5. [改善Java代码]构造代码块会想你所想
  6. Openvpn完美解决公司网络没有固定公网IP的问题
  7. 该项目中不存在目标 precomputecompiletypescript The target "PreComputeCompileTypeScript" does not exist in the project
  8. 监听<input/>标签行为的方法总结
  9. 对Linux 新手非常有用的20 个命令
  10. Immediate Decodability(字典树)
  11. http://blog.csdn.net/baimafujinji/article/details/10931621
  12. 新买一款打印机hp5525N
  13. Go/Python/Erlang编程语言对比分析及示例
  14. MySQL数据库写入图片并读取图片显示到JLabel上的详解
  15. Java模仿http请求工具类
  16. C - 继续畅通工程 最小生成树
  17. delphi dbgrid 修改、更新、删除
  18. 设计模式【转自JackFrost的博客】
  19. 认证登录装饰器与form组件的使用
  20. linux检查系统CPU,内存,磁盘使用率

热门文章

  1. 微信小程序 image组件坑
  2. Wenaox 一款轻量性能好的微信小程序状态管理库
  3. python 数据类型 常用法方
  4. Python学习日记(十一) 内置函数
  5. MySQL Error--存储inode用完后报设备没有空间
  6. vs2017 官方下载地址 和 官方建立脱机安装包的方法
  7. 【转】高性能网络编程2----TCP消息的发送
  8. mysql 压力测试工具sysbench
  9. 使用Cloudera Manager搭建MapReduce集群及MapReduce HA
  10. Codeforces Round #581 (Div. 2)-E. Natasha, Sasha and the Prefix Sums-动态规划+组合数学