2.3.5 Unlocking a Locked Account

Table of Contents Previous Next


2 SQL Tutorial : 2.3 Profile Management : 2.3.5 Unlocking a Locked Account

A database superuser can use clauses of the ALTER USER|ROLE… command to lock or unlock a role. The syntax is:
ALTER USER|ROLE name
ACCOUNT
{LOCK|UNLOCK}
LOCK TIME '
timestamp'
Include the ACCOUNT LOCK clause to lock a role immediately; when locked, a role’s LOGIN functionality is disabled. When you specify the ACCOUNT LOCK clause without the LOCK TIME clause, the state of the role will not change until a superuser uses the ACCOUNT UNLOCK clause to unlock the role.
Use the ACCOUNT UNLOCK clause to unlock a role.
Use the LOCK TIME 'timestamp' clause to instruct the server to lock the account at the time specified by the given timestamp for the length of time specified by the PASSWORD_LOCK_TIME parameter of the profile associated with this role.
Combine the LOCK TIME 'timestamp' clause and the ACCOUNT LOCK clause to lock an account at a specified time until the account is unlocked by a superuser invoking the ACCOUNT UNLOCK clause.
The following example uses the ACCOUNT LOCK clause to lock the role named john. The account will remain locked until the account is unlocked with the ACCOUNT UNLOCK clause:
The following example uses the ACCOUNT UNLOCK clause to unlock the role named john:
The following example uses the LOCK TIME 'timestamp' clause to lock the role named john on September 4, 2015:
The following example combines the LOCK TIME 'timestamp' clause and the ACCOUNT LOCK clause to lock the role named john on September 4, 2015:

2 SQL Tutorial : 2.3 Profile Management : 2.3.5 Unlocking a Locked Account

Table of Contents Previous Next