SQL> create profile prof_test limit password_reuse_max unlimited2password_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;用户已更改。
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 wherethe PASSWORD_REUSE_TIME clause specifies that the user cannot reuse the passwordfor 60 days.CREATE PROFILE prof LIMITPASSWORD_REUSE_TIME 60PASSWORD_REUSE_MAX UNLIMITED;In the next statement, the PASSWORD_REUSE_MAX clause specifies that the numberof password changes the user must make before the current password can be used again is three.CREATE PROFILE prof LIMITPASSWORD_REUSE_MAX 3PASSWORD_REUSE_TIME UNLIMITED;Note: If you specify PASSWORD_REUSE_TIME or PASSWORD_REUSE_MAX, you must setthe other to UNLIMITED or not specify it at all.
SQL> alter profile prof_test limit password_reuse_max 3;配置文件已更改SQL> select resource_name, limit from dba_profiles2where profile = 'PROF_TEST' and resource_type = 'PASSWORD';RESOURCE_NAMELIMIT-------------------------------- ------------------------FAILED_LOGIN_ATTEMPTSDEFAULTPASSWORD_LIFE_TIMEDEFAULTPASSWORD_REUSE_TIMEUNLIMITEDPASSWORD_REUSE_MAX3PASSWORD_VERIFY_FUNCTIONDEFAULTPASSWORD_LOCK_TIMEDEFAULTPASSWORD_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: 无法重新使用口令
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_profiles2where profile = 'PROF_TEST' and resource_type = 'PASSWORD';RESOURCE_NAMELIMIT-------------------------------- --------------FAILED_LOGIN_ATTEMPTSDEFAULTPASSWORD_LIFE_TIMEDEFAULTPASSWORD_REUSE_TIME.0069PASSWORD_REUSE_MAXUNLIMITEDPASSWORD_VERIFY_FUNCTIONDEFAULTPASSWORD_LOCK_TIMEDEFAULTPASSWORD_GRACE_TIMEDEFAULT已选择7行。SQL> set time on16: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> alter profile prof_test limit password_reuse_time unlimited;配置文件已更改SQL> alter user test identified by test;用户已更改。SQL> alter profile prof_test limit2password_reuse_max 3 password_reuse_time 1/144;配置文件已更改SQL> set time on17: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;用户已更改。