oracle PASSWORD_VERIFY FUNCTION
时间: 2023-08-21 22:06:14 浏览: 141
Oracle 11gR2创建PASSWORD_VERIFY_FUNCTION对应密码复杂度验证函数步骤.doc
In Oracle, the PASSWORD_VERIFY_FUNCTION is a built-in function that allows you to enforce password complexity rules and policies when creating or altering user passwords. It helps to ensure that passwords meet certain requirements and enhances the security of the Oracle database.
By default, Oracle provides a default password verification function called "ORA12C_STRONG_VERIFY_FUNCTION". This function enforces the following password complexity rules:
1. The password must be at least 8 characters long.
2. It must contain at least one uppercase letter.
3. It must contain at least one lowercase letter.
4. It must contain at least one numeric digit.
5. It must contain at least one special character (e.g., !@#$%^&*).
You can view the details of this default password verification function by querying the DBA_USERS view:
```sql
SELECT * FROM DBA_USERS;
```
To alter the password complexity rules or create a custom password verification function, you can use the DBMS_AUTHENTICATION package. Here's an example of how to create a custom password verification function in Oracle:
```sql
CREATE OR REPLACE FUNCTION my_password_verify_function (
username IN VARCHAR2,
password IN VARCHAR2,
old_password IN VARCHAR2
) RETURN BOOLEAN IS
-- Custom password verification logic goes here
BEGIN
-- Return TRUE if the password meets the desired criteria, otherwise FALSE
END;
/
```
Once you have created your custom password verification function, you can set it as the current password verification function using the ALTER PROFILE statement:
```sql
ALTER PROFILE my_profile LIMIT PASSWORD_VERIFY_FUNCTION my_password_verify_function;
```
This will enforce your custom password complexity rules for new passwords or when altering existing passwords for users associated with the specified profile.
Remember to adjust the logic inside your custom password_verify_function to fit your specific requirements for password complexity and security.
阅读全文