profile進行密碼設定
[oracle@tsdb01-shcd admin]$ cd $ORACLE_HOME/rdbms/admin/
[oracle@tsdb01-shcd admin]$ ls utlpwd*
utlpwdmg.sql
[oracle@tsdb01-shcd admin]$ cat utlpwdmg.sql
Rem
Rem $Header: utlpwdmg.sql 31-aug-2000.11:00:47 nireland Exp $
Rem
Rem utlpwdmg.sql
Rem
Rem Copyright (c) Oracle Corporation 1996, 2000. All Rights Reserved.
Rem
Rem NAME
Rem utlpwdmg.sql - script for Default Password Resource Limits
Rem
Rem DESCRIPTION
Rem This is a script for enabling the password management features
Rem by setting the default password resource limits.
Rem
Rem NOTES
Rem This file contains a function for minimum checking of password
Rem complexity. This is more of a sample function that the customer
Rem can use to develop the function for actual complexity checks that the
Rem customer wants to make on the new password.
Rem
Rem MODIFIED (MM/DD/YY)
Rem nireland 08/31/00 - Improve check for username=password. #1390553
Rem nireland 06/28/00 - Fix null old password test. #1341892
Rem asurpur 04/17/97 - Fix for bug479763
Rem asurpur 12/12/96 - Changing the name of password_verify_function
Rem asurpur 05/30/96 - New script for default password management
Rem asurpur 05/30/96 - Created
Rem
-- This script sets the default password resource parameters
-- This script needs to be run to enable the password features.
-- However the default resource parameters can be changed based
-- on the need.
-- A default password complexity function is also provided.
-- This function makes the minimum complexity checks like
-- the minimum length of the password, password not same as the
-- username, etc. The user may enhance this function according to
-- the need.
-- This function must be created in SYS schema.
-- connect sys/
CREATE OR REPLACE FUNCTION verify_function
(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 < 3 THEN
raise_application_error(-20004, 'Password should differ by at
least 3 characters');
END IF;
END IF;
END IF;
-- Everything is fine; return TRUE ;
RETURN(TRUE);
END;
/
-- This script alters the default parameters for Password Management
-- This means that all the users on the system have Password Management
-- enabled and set to the following values unless another profile is
-- created with parameter values set to different value or UNLIMITED
-- is created and assigned to the user.
ALTER PROFILE DEFAULT LIMIT
PASSWORD_LIFE_TIME 60
PASSWORD_GRACE_TIME 10
PASSWORD_REUSE_TIME 1800
PASSWORD_REUSE_MAX UNLIMITED
FAILED_LOGIN_ATTEMPTS 3
PASSWORD_LOCK_TIME 1/1440
PASSWORD_VERIFY_FUNCTION verify_function;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9925929/viewspace-966726/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Profile設定高標準密碼複雜度的方法密碼複雜度
- 分享Profile設定高標準密碼複雜度的方法密碼複雜度
- profile對密碼的限制密碼
- redis設定密碼Redis密碼
- profile使用者密碼管理密碼
- 無需輸入密碼,macOS 設定開機直接免密碼進入桌面密碼Mac
- ubantu 設定root密碼密碼
- redis cluster 設定密碼Redis密碼
- mysql如何設定密碼MySql密碼
- 監聽設定密碼密碼
- Mac os下profile設定Mac
- win10設定密碼在哪裡_win10設定開機密碼怎麼設定Win10密碼
- 電腦鎖屏密碼怎麼設定 win10電腦休眠密碼設定方法設定密碼Win10
- 設定 Homestead root 密碼密碼
- Linux設定密碼策略Linux密碼
- 為監聽設定密碼密碼
- profile 2種不同的設定
- 修改oracle賬戶profile設定Oracle
- 使用Oracle自帶profile以及函式簡單設定Oracle使用者名稱密碼規則Oracle函式密碼
- Oracle 密碼永不過期設定Oracle密碼
- 管理(005):密碼檔案設定密碼
- Redis 密碼設定和檢視Redis密碼
- 教你設定SIM卡密碼密碼
- redis設定認證密碼操作Redis密碼
- ORACLE listener監聽設定密碼Oracle密碼
- win10設定硬碟密碼怎麼取消 win10硬碟設定密碼如何取消Win10硬碟密碼
- 藍芽怎麼設定密碼不讓人連線 藍芽設定密碼的方法藍芽密碼
- win10區域網設定密碼如何設定 win10區域網怎麼設定訪問密碼Win10密碼
- 怎麼設定電腦鎖屏密碼 設定電腦鎖屏密碼的操作方法密碼
- 電腦怎麼設定密碼鎖屏 電腦設定密碼鎖屏的詳細教程密碼
- 怎麼給jupyter設定密碼密碼
- Ubuntu MySQL5.7設定root密碼UbuntuMySql密碼
- 密碼複雜度設定函式密碼複雜度函式
- 設定 Oracle 監聽器密碼(LISTENER)Oracle密碼
- 無線網怎麼設定密碼密碼
- Oracle Listener設定密碼示例說明Oracle密碼
- MAC設定開機密碼的方法Mac密碼
- mongodb設定賬號密碼的方法MongoDB密碼