linux初探

首页

应用服务器

Linux技巧

中文文档

Linux初级

服务器源代码

命令详解

Linux技术应用

Linux安全应用

Linux业界新闻

UniX技术文章

Linux编程与内核

Linux数据库

Linux服务器

Linux安装指导

Linux论坛


首页>>Linux数据库>>

热门文章

·用mysqldump 来备份数据库
·Oracle 8.1.6的一次恢复!
·oracle启动 shell脚本
·使用Connector/J连接MySQL数
·oracle入门
·MySQL占领Oracle市场 技术支
·SQL Server与Oracle、DB2的性
·从黑客角度检验Oracle数据库
·开源数据库影响传统IT服务市
·在Oracle 9i isqlplus中使用

推荐文章

Oracle 9i密码策略--密码重用规则


Oracle通过PROFILE中的PASSWORD_REUSE_TIME和PASSWORD_REUSE_MAX来确定密码是否可以重用以及密码重用的限制。


  但是,经过测试,发现Oracle的ADMINISTRATOR GUIDE里面的描述是错误的,我查阅了一下METALINK,METALINK上的一篇文章虽然对这两个参数进行了比较详细的说明,但是仍然有一部分描述是错误。


  PASSWORD_REUSE_TIME是重用密码的最小时间间隔,单位是天。可以给出整数或分数,如1/1440表示1分钟(出于效率的考虑,oracle不会每分钟都去进行检查,一般来说,有5分钟左右的误差,因此如果这个数小于1/144则没有多大的意义)。


  PASSWORD_REUSE_MAX是重用密码前更换密码的最小次数。这两项本身没有任何异议,关键是两项如何配合使用。可以分为3种情况进行描述:


一、PASSWORD_REUSE_MAX和PASSWORD_REUSE_TIME都为UNLIMITED


  这时密码可以任意重用,没有限制这也是DEFAULT profile的默认值。当这两项都为UNLIMITED时,认为这两个参数没有使用,因此,密码重用没有任何限制。

QUOTE:
SQL> create profile prof_test limit password_reuse_max unlimited
2password_reuse_time unlimited;
配置文件已创建
SQL> create user test identified by test profile prof_test;
用户已创建
SQL> alter user test identified by test;
用户已更改。
SQL> alter user test identified by test;
用户已更改。

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


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


  看看administrator guide上是怎么说的:
QUOTE:
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,但是这是不正确的,这样会导致你的密码永远无法重用。
QUOTE:
SQL> alter profile prof_test limit password_reuse_max 3;

配置文件已更改

SQL> select resource_name, limit from dba_profiles
2where profile = 'PROF_TEST' and resource_type = 'PASSWORD';

RESOURCE_NAMELIMIT
-------------------------------- ----------------------------------------
FAILED_LOGIN_ATTEMPTSDEFAULT
PASSWORD_LIFE_TIMEDEFAULT
PASSWORD_REUSE_TIMEUNLIMITED
PASSWORD_REUSE_MAX3
PASSWORD_VERIFY_FUNCTIONDEFAULT
PASSWORD_LOCK_TIMEDEFAULT
PASSWORD_GRACE_TIMEDEFAULT

已选择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没有记录初始密码,而第二次修改就会失败,因为密码已经不能重用了。


  根据文档,我们只需要修改密码三次,就可以重用,但是测试的结果确是密码无法在重用。
QUOTE:
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
2where profile = 'PROF_TEST' and resource_type = 'PASSWORD';

RESOURCE_NAMELIMIT
-------------------------------- ----------------------------------------
FAILED_LOGIN_ATTEMPTSDEFAULT
PASSWORD_LIFE_TIMEDEFAULT
PASSWORD_REUSE_TIME.0069
PASSWORD_REUSE_MAXUNLIMITED
PASSWORD_VERIFY_FUNCTIONDEFAULT
PASSWORD_LOCK_TIMEDEFAULT
PASSWORD_GRACE_TIMEDEFAULT
已选择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

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


三、PASSWORD_REUSE_MAX和PASSWORD_REUSE_TIME都不为UNLIMITED。


  这时只需满足任意一个条件就可以重用密码


  Metalink上的文章在这里描述有误,密码重用不需要同时满足两个条件,只要满足一个既可。
QUOTE:
SQL> alter profile prof_test limit password_reuse_time unlimited;
配置文件已更改
SQL> alter user test identified by test;
用户已更改。
SQL> alter profile prof_test limit
2password_reuse_max 3 password_reuse_time 1/144;
配置文件已更改
SQL> set time on
17:11:30 SQL> alter user test identified by test;
用户已更改。
17:11:47 SQL> alter user test identified by test;
alter user test identified by test
*
ERROR 位于第 1 行:
ORA-28007: 无法重新使用口令
17:11:56 SQL> alter user test identified by t1;
用户已更改。
17:12:06 SQL> alter user test identified by t2;
用户已更改。
17:12:12 SQL> alter user test identified by t3;
用户已更改。
17:12:19 SQL> alter user test identified by test;
用户已更改。
17:12:50 SQL>
17:13:45 SQL> alter user test identified by test;
alter user test identified by test
*
ERROR 位于第 1 行:
ORA-28007: 无法重新使用口令
17:13:55 SQL>
17:14:00 SQL>
17:32:14 SQL> alter user test identified by test;
用户已更改。

  第一次重用test密码才过了1分钟左右,而在第二次重用test密码之前并没有使用过其他密码。可见,只需满足PASSWORD_REUSE_MAX和PASSWORD_REUSE_TIME中的任意一个条件就可以。

相关文章:

·oracle中的sql语句
·Oracle PL/SQL语言基础
·开源数据库影响传统IT服务市场格局
·使用Connector/J连接MySQL数据库
·NBU异机恢复ORACLE 数据库.
·在Linux下访问SQL Server数据库
·开源数据库MySQL公布产品生命周期计划
·MySQL 专用开源数据库 存储引擎出炉
·网络数据库三国:IBM微软Oracle争霸

Copyright@2005 www.linuxGoo.com All Right Reserved