您好,登录后才能下订单哦!
这篇文章主要讲解了“设定Oracle用户名密码的规则有哪些”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“设定Oracle用户名密码的规则有哪些”吧!
$ sqlplus / as sysdba
SQL > select profile,resource_name,resource_type,limit from dba_profiles where profile=(select PROFILE from dba_users where username=upper('&user_name'));
$ sqlplus / as sysdba
SQL > @?/rdbms/admin/utlpwdmg.sql
l 最小长度8
l 不能与用户名相同或相似
l 不能是用户名倒序。
l 不能与前密码超过3个字符相同
l 至少包含一个“\”、“数字”以及“字符”
$ sqlplus / as sysdba
SQL> select 'alter profile ' || profile ||
' limit PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION;'
from dba_profiles
group by profile;
'ALTERPROFILE'||PROFILE||'LIMITPASSWORD_VERIFY_FUNCTIONVERIFY_FUNCTION;'
--------------------------------------------------------------------------------------------
alter profile MONITORING_PROFILE limit PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION;
alter profile DEFAULT limit PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION; # 使用需要修改profile相应语句即可
SYS@honor1 > alter profile DEFAULT limit PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION;
Profile altered.
SYS@honor1 > alter user hr identified by 111111; # 规则已经生效,简单密码已经无法使用
alter user hr identified by 111111
*
ERROR at line 1:
ORA-28003: password verification for the specified password failed
ORA-20003: Password should contain at least one \
digit, one character and one punctuation
SYS@honor1 > CREATE PROFILE new_profile LIMIT
SESSIONS_PER_USER UNLIMITED
CPU_PER_SESSION UNLIMITED
CPU_PER_CALL UNLIMITED
CONNECT_TIME UNLIMITED
IDLE_TIME 600
LOGICAL_READS_PER_SESSION UNLIMITED
LOGICAL_READS_PER_CALL UNLIMITED
COMPOSITE_LIMIT UNLIMITED
PRIVATE_SGA UNLIMITED
FAILED_LOGIN_ATTEMPTS UNLIMITED
PASSWORD_LIFE_TIME UNLIMITED
PASSWORD_REUSE_TIME UNLIMITED
PASSWORD_REUSE_MAX UNLIMITED
PASSWORD_LOCK_TIME 1
PASSWORD_GRACE_TIME 10
PASSWORD_VERIFY_FUNCTION verify_function;
Profile created.
SYS@honor1 > alter user hr profile new_profile;
User altered.
SYS@honor1 > alter user hr identified by 111111;
alter user hr identified by 111111
*
ERROR at line 1:
ORA-28003: password verification for the specified password failed # 新规则已经生效
ORA-20003: Password should contain at least one \
digit, one character and one punctuation
SYS@honor1 > alter profile DEFAULT limit PASSWORD_VERIFY_FUNCTION null;
Profile altered.
SYS@honor1 > alter user hr identified by 111111; # 可以看到密码规则已经失效
User altered.
SYS@honor1 > alter user hr profile default; #如果原来使用了自定义profile则输入原来名称
User altered.
SYS@honor1 > alter user hr identified by 111111; # 可以看到密码规则已经失效
User altered.
SYS@honor1 > alter profile DEFAULT limit PASSWORD_LIFE_TIME 90; # 修改为90天
Profile altered.
SYS@honor1 > select profile,resource_name,resource_type,limit from dba_profiles where profile='DEFAULT';
Caution:
设定较短有效期,一定要注意密码有效期,及时在有效期前修改密码,防止密码过期导致应用连接数据库失败。
SYS@honor1 > alter profile default limit PASSWORD_REUSE_TIME 365;
Profile altered.
SYS@honor1 > select profile,resource_name,resource_type,limit from dba_profiles where profile='DEFAULT';
SYS@honor1 > alter profile default limit PASSWORD_REUSE_MAX 5;
Profile altered.
SYS@honor1 > select profile,resource_name,resource_type,limit from dba_profiles where profile='DEFAULT';
SYS@honor1 > alter profile DEFAULT limit PASSWORD_LIFE_TIME 180;
SYS@honor1 > alter profile default limit PASSWORD_REUSE_TIME UNLIMITED;
SYS@honor1 > alter profile default limit PASSWORD_REUSE_MAX UNLIMITED;
感谢各位的阅读,以上就是“设定Oracle用户名密码的规则有哪些”的内容了,经过本文的学习后,相信大家对设定Oracle用户名密码的规则有哪些这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。