Purpose
This statement is used to create a profile. A profile is a set of limits on database resources. If a profile is assigned to a user, the user cannot exceed these usage limits.
Syntax
CREATE [WITH HINT] PROFILE [profile_name | DEFAULT] LIMIT
{ FAILED_LOGIN_ATTEMPTS { integer | UNLIMITED | DEFAULT }
| PASSWORD_LOCK_TIME { integer | UNLIMITED | DEFAULT }
| PASSWORD_LIFE_TIME { integer | UNLIMITED | DEFAULT }
| PASSWORD_VERIFY_FUNCTION { function_name | NULL }
| PASSWORD_GRACE_TIME { integer | UNLIMITED | DEFAULT }
}
[, ...]
Parameters
| Parameter | Description |
|---|---|
| WITH HINT | Optional. Specifies the hints used by the query optimizer. |
| profile_name | Specifies the name of the profile to be created. It can be a regular identifier, a non-reserved keyword, or DEFAULT. |
| FAILED_LOGIN_ATTEMPTS | Specifies the number of consecutive failed login attempts allowed before the account is locked. |
| PASSWORD_LOCK_TIME | Specifies the number of days the account is locked due to failed login attempts. |
| PASSWORD_LIFE_TIME | Specifies the password validity period in days. |
| PASSWORD_VERIFY_FUNCTION | Specifies the function used to verify the password. |
| PASSWORD_GRACE_TIME | Specifies the grace period in days after the password expires, during which the user can still log in with the old password but will receive a warning. |
| integer | Specifies the specific integer value of the parameter. |
| UNLIMITED | Specifies that the parameter has no limit. |
| DEFAULT | Uses the system default value. |
| NULL | Sets the parameter to NULL. |
| function_name | Specifies the name of the verification function. |
Examples
Create a password-limited profile named profile1, with FAILED_LOGIN_ATTEMPTS set to 5, PASSWORD_LOCK_TIME set to 1 day, PASSWORD_LIFE_TIME set to 60 days, PASSWORD_VERIFY_FUNCTION set to NULL, and PASSWORD_GRACE_TIME set to the default limit.
obclient> CREATE PROFILE profile1 LIMIT
FAILED_LOGIN_ATTEMPTS 5
PASSWORD_LOCK_TIME 1
PASSWORD_LIFE_TIME 60
PASSWORD_VERIFY_FUNCTION NULL
PASSWORD_GRACE_TIME DEFAULT;
Note
If you want to use a custom function in PASSWORD_VERIFY_FUNCTION, you need to create the function first. If you do not need password verification, you can set it to NULL.