users密码复杂度的具体例子及操作过程(unix中).doc_第1页
users密码复杂度的具体例子及操作过程(unix中).doc_第2页
users密码复杂度的具体例子及操作过程(unix中).doc_第3页
users密码复杂度的具体例子及操作过程(unix中).doc_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

一.修改密码复杂读 更改orcle数据库用户的密码复杂度 1. 用sys用户创建存储过程#splplus /nologSQLconnect /as sysdbaSQLCREATE OR REPLACE FUNCTION verify_passwd(username varchar2, password varchar2, old_password varchar2) RETURN boolean IS n boolean; m integer; differ integer; isdigit boolean; ischar boolean; ispunct boolean; digitarray varchar2(20); punctarray varchar2(25); chararray varchar2(52);BEGIN digitarray:= 0123456789; chararray:= abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; punctarray:=!#$%&()*+,-/:;?_; - Check if the password is same as the username IF NLS_LOWER(password) = NLS_LOWER(username) THEN raise_application_error(-20001, Password same as or similar to user); END IF; - Check for the minimum length of the password IF length(password) 4 THEN raise_application_error(-20002, Password length less than 4); END IF; - Check if the password is too simple. A dictionary of words may be - maintained and a check may be made so as not to allow the words - that are too simple for the password. IF NLS_LOWER(password) IN (welcome, database, account, user, password, oracle, computer, abcd) THEN raise_application_error(-20002, Password too simple); END IF; - Check if the password contains at least one letter, one digit and one - punctuation mark. - 1. Check for the digit isdigit:=FALSE; m := length(password); FOR i IN 1.10 LOOP FOR j IN 1.m LOOP IF substr(password,j,1) = substr(digitarray,i,1) THEN isdigit:=TRUE; GOTO findchar; END IF; END LOOP; END LOOP; IF isdigit = FALSE THEN raise_application_error(-20003, Password should contain at least one digit, one character and one punctuation); END IF; - 2. Check for the character ischar:=FALSE; FOR i IN 1.length(chararray) LOOP FOR j IN 1.m LOOP IF substr(password,j,1) = substr(chararray,i,1) THEN ischar:=TRUE; GOTO findpunct; END IF; END LOOP; END LOOP; IF ischar = FALSE THEN raise_application_error(-20003, Password should contain at least one digit, one character and one punctuation); END IF; - 3. Check for the punctuation ispunct:=FALSE; FOR i IN 1.length(punctarray) LOOP FOR j IN 1.m LOOP IF substr(password,j,1) = substr(punctarray,i,1) THEN ispunct:=TRUE; GOTO endsearch; END IF; END LOOP; END LOOP; IF ispunct = FALSE THEN raise_application_error(-20003, Password should contain at least one digit, one character and one punctuation); END IF; - Check if the password differs from the previous password by at least - 3 letters IF old_password IS NOT NULL THEN differ := length(old_password) - length(password); IF abs(differ) 3 THEN IF length(password) length(old_password) THEN m := length(password); ELSE m := length(old_password); END IF; differ := abs(differ); FOR i IN 1.m LOOP IF substr(password,i,1) != substr(old_password,i,1) THEN differ := differ + 1; END IF; END LOOP; IF differ create profile verify_pass limit PASSWORD_VERIFY_FUNCTION verify_passwd;配置文件一创建-前面的verify_pass 为所创建的profile文件名,后面的verify_passwd 为刚才创建的存储过程名称。#SQL create profile passwd_user limit PASSWORD_VERIFY_FUNCTION verify_pass;3.为用户指派该profile文件SQLalter user zzhp profile verify_pass;用户已更改SQLcommit;提交完成4.测试在修改前SQL alter user zzhp identified by zhang;用户已更改。在修改后SQL alter user zzhp identified by zhang;alter user zzhp identified by zhang*第 1 行出现错误:ORA-28003: 指定口令的口令验证失败ORA-20

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论