oracle怎么开启复杂密码验证
本篇内容介绍了“oracle怎么开启复杂密码验证”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
ORACLE 11g开启复杂密码验证
SQL> set line 200
SQL> SELECT * FROM Dba_Profiles d WHERE d.profile='DEFAULT';
PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT COMPOSITE_LIMIT KERNEL UNLIMITED
DEFAULT SESSIONS_PER_USER KERNEL UNLIMITED
DEFAULT CPU_PER_SESSION KERNEL UNLIMITED
DEFAULT CPU_PER_CALL KERNEL UNLIMITED
DEFAULT LOGICAL_READS_PER_SESSION KERNEL UNLIMITED
DEFAULT LOGICAL_READS_PER_CALL KERNEL UNLIMITED
DEFAULT IDLE_TIME KERNEL UNLIMITED
DEFAULT CONNECT_TIME KERNEL UNLIMITED
DEFAULT PRIVATE_SGA KERNEL UNLIMITED
DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD 10
DEFAULT PASSWORD_LIFE_TIME PASSWORD 180
PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT PASSWORD_REUSE_TIME PASSWORD UNLIMITED
DEFAULT PASSWORD_REUSE_MAX PASSWORD UNLIMITED
DEFAULT PASSWORD_VERIFY_FUNCTION PASSWORD NULL
DEFAULT PASSWORD_LOCK_TIME PASSWORD 1
DEFAULT PASSWORD_GRACE_TIME PASSWORD 7
16 rows selected.
注意跑完这个脚本会初始化profile,之前设置的unlimited会变成默认的
SQL> @?/rdbms/admin/utlpwdmg.sql
Function created.
Grant succeeded.
Profile altered.
Function created.
Grant succeeded.
SQL> SELECT * FROM Dba_Profiles d WHERE d.profile='DEFAULT';
PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT COMPOSITE_LIMIT KERNEL UNLIMITED
DEFAULT SESSIONS_PER_USER KERNEL UNLIMITED
DEFAULT CPU_PER_SESSION KERNEL UNLIMITED
DEFAULT CPU_PER_CALL KERNEL UNLIMITED
DEFAULT LOGICAL_READS_PER_SESSION KERNEL UNLIMITED
DEFAULT LOGICAL_READS_PER_CALL KERNEL UNLIMITED
DEFAULT IDLE_TIME KERNEL UNLIMITED
DEFAULT CONNECT_TIME KERNEL UNLIMITED
DEFAULT PRIVATE_SGA KERNEL UNLIMITED
DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD 10
DEFAULT PASSWORD_LIFE_TIME PASSWORD 180
PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT PASSWORD_REUSE_TIME PASSWORD UNLIMITED
DEFAULT PASSWORD_REUSE_MAX PASSWORD UNLIMITED
DEFAULT PASSWORD_VERIFY_FUNCTION PASSWORD VERIFY_FUNCTION_11G
DEFAULT PASSWORD_LOCK_TIME PASSWORD 1
DEFAULT PASSWORD_GRACE_TIME PASSWORD 7
16 rows selected.
SQL> alter profile default limit PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION;
Profile altered.
PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT COMPOSITE_LIMIT KERNEL UNLIMITED
DEFAULT SESSIONS_PER_USER KERNEL UNLIMITED
DEFAULT CPU_PER_SESSION KERNEL UNLIMITED
DEFAULT CPU_PER_CALL KERNEL UNLIMITED
DEFAULT LOGICAL_READS_PER_SESSION KERNEL UNLIMITED
DEFAULT LOGICAL_READS_PER_CALL KERNEL UNLIMITED
DEFAULT IDLE_TIME KERNEL UNLIMITED
DEFAULT CONNECT_TIME KERNEL UNLIMITED
DEFAULT PRIVATE_SGA KERNEL UNLIMITED
DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD 10
DEFAULT PASSWORD_LIFE_TIME PASSWORD 180
PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT PASSWORD_REUSE_TIME PASSWORD UNLIMITED
DEFAULT PASSWORD_REUSE_MAX PASSWORD UNLIMITED
DEFAULT PASSWORD_VERIFY_FUNCTION PASSWORD VERIFY_FUNCTION
DEFAULT PASSWORD_LOCK_TIME PASSWORD 1
DEFAULT PASSWORD_GRACE_TIME PASSWORD 7
16 rows selected.
跑完脚本后会创建2个关于密码验证的函数VERIFY_FUNCTION_11G,VERIFY_FUNCTION
ORACLE 12C开启复杂密码验证
CDB执行
SQL> set line 200
SQL> col PROFILE for a30
SQL> col LIMIT for a30
SQL> col RESOURCE_NAME for a30
SQL> SELECT * FROM Dba_Profiles d WHERE d.profile='DEFAULT';
PROFILE RESOURCE_NAME RESOURCE LIMIT COM INH IMP
------------------------------ -------------------------------- -------- ------------------------------ --- --- ---
DEFAULT COMPOSITE_LIMIT KERNEL UNLIMITED NO NO NO
DEFAULT SESSIONS_PER_USER KERNEL UNLIMITED NO NO NO
DEFAULT CPU_PER_SESSION KERNEL UNLIMITED NO NO NO
DEFAULT CPU_PER_CALL KERNEL UNLIMITED NO NO NO
DEFAULT LOGICAL_READS_PER_SESSION KERNEL UNLIMITED NO NO NO
DEFAULT LOGICAL_READS_PER_CALL KERNEL UNLIMITED NO NO NO
DEFAULT IDLE_TIME KERNEL UNLIMITED NO NO NO
DEFAULT CONNECT_TIME KERNEL UNLIMITED NO NO NO
DEFAULT PRIVATE_SGA KERNEL UNLIMITED NO NO NO
DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD 10 NO NO NO
DEFAULT PASSWORD_LIFE_TIME PASSWORD 180 NO NO NO
PROFILE RESOURCE_NAME RESOURCE LIMIT COM INH IMP
------------------------------ -------------------------------- -------- ------------------------------ --- --- ---
DEFAULT PASSWORD_REUSE_TIME PASSWORD UNLIMITED NO NO NO
DEFAULT PASSWORD_REUSE_MAX PASSWORD UNLIMITED NO NO NO
DEFAULT PASSWORD_VERIFY_FUNCTION PASSWORD NULL NO NO NO
DEFAULT PASSWORD_LOCK_TIME PASSWORD 1 NO NO NO
DEFAULT PASSWORD_GRACE_TIME PASSWORD 7 NO NO NO
DEFAULT INACTIVE_ACCOUNT_TIME PASSWORD UNLIMITED NO NO NO
ALTER PROFILE DEFAULT LIMIT PASSWORD_VERIFY_FUNCTION ora12c_verify_function;
或者
alter profile default limit PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION;
需要在PDB执行
SQL> alter session set container=PDB1;
会话已更改。
SQL> set line 200
SQL> col PROFILE for a30
SQL> col LIMIT for a30
SQL> col RESOURCE_NAME for a30
SQL> SELECT * FROM Dba_Profiles d WHERE d.profile='DEFAULT';
PROFILE RESOURCE_NAME RESOURCE LIMIT COM INH IMP
------------------------------ ------------------------------ -------- ------------------------------ --- --- ---
DEFAULT COMPOSITE_LIMIT KERNEL UNLIMITED NO NO NO
DEFAULT SESSIONS_PER_USER KERNEL UNLIMITED NO NO NO
DEFAULT CPU_PER_SESSION KERNEL UNLIMITED NO NO NO
DEFAULT CPU_PER_CALL KERNEL UNLIMITED NO NO NO
DEFAULT LOGICAL_READS_PER_SESSION KERNEL UNLIMITED NO NO NO
DEFAULT LOGICAL_READS_PER_CALL KERNEL UNLIMITED NO NO NO
DEFAULT IDLE_TIME KERNEL UNLIMITED NO NO NO
DEFAULT CONNECT_TIME KERNEL UNLIMITED NO NO NO
DEFAULT PRIVATE_SGA KERNEL UNLIMITED NO NO NO
DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD 10 NO NO NO
DEFAULT PASSWORD_LIFE_TIME PASSWORD 180 NO NO NO
PROFILE RESOURCE_NAME RESOURCE LIMIT COM INH IMP
------------------------------ ------------------------------ -------- ------------------------------ --- --- ---
DEFAULT PASSWORD_REUSE_TIME PASSWORD UNLIMITED NO NO NO
DEFAULT PASSWORD_REUSE_MAX PASSWORD UNLIMITED NO NO NO
DEFAULT PASSWORD_VERIFY_FUNCTION PASSWORD NULL NO NO NO
DEFAULT PASSWORD_LOCK_TIME PASSWORD 1 NO NO NO
DEFAULT PASSWORD_GRACE_TIME PASSWORD 7 NO NO NO
DEFAULT INACTIVE_ACCOUNT_TIME PASSWORD UNLIMITED NO NO NO
已选择 17 行。
SQL> create user test identified by test;
用户已创建。
SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_VERIFY_FUNCTION ora12c_verify_function;
配置文件已更改
SQL> alter user test identified by test;
alter user test identified by test
*
第 1 行出现错误:
ORA-28003: 指定口令的口令验证失败 ORA-20001:
Password length less than 8
SQL> alter user test identified by "test123!@#";
alter user test identified by "test123!@#"
*
第 1 行出现错误:
ORA-28003: 指定口令的口令验证失败 ORA-20002:
Password contains the username
SQL> alter profile default limit PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION;
配置文件已更改
SQL> alter user test identified by "test123!@#" ;
用户已更改。
“oracle怎么开启复杂密码验证”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341