Expire Oracle User Password in Few Minutes Using Profile Resouces PASSWORD_LIFE_TIME and PASSWORD_GRACE_TIME

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Values for the parameters PASSWORD_LIFE_TIME and PASSWORD_GRACE_TIME can be in number of days or can be in hours or minutes. You can specify the hours or minuts in decimal values.

In below mentioned example I am going to expire the login in 4 minutes (2 mins PASSWORD_LIFE_TIME and 2 mins PASSWORD_GRACE_TIME). In this example I mentioned a number 1440 which is equivalent for 24hr*60Min*1day.


Step 1. Create a New profile

SQL> CREATE PROFILE TEST
LIMIT PASSWORD_REUSE_MAX 10
     PASSWORD_REUSE_TIME 30
LIMIT PASSWORD_LIFE_TIME 2/1440;

Profile created.

Step 2. Assign the new profile to the user

SQL> set time on
01:32:48 SQL>  ALTER USER SCOTT PROFILE TEST;

User altered.
01:59:17 SQL> ALTER PROFILE TEST LIMIT PASSWORD_LIFE_TIME 2/1440;

Profile altered.

01:59:21 SQL> connect scott@testdb
Enter password:
ERROR:
ORA-28011: the account will expire soon; change your password now


Connected.

Now the user is running on grace time and I am going to change the grace time also to 2 mins.

02:04:12 SQL> ALTER PROFILE TEST LIMIT PASSWORD_GRACE_TIME 2/1440;

Profile altered.

02:04:36 SQL> connect scott@testdb
Enter password:
ERROR:
ORA-28002: the password will expire within 0 days


Connected.

02:06:39 SQL> connect scott@testdb
Enter password:
ERROR:
ORA-28001: the password has expired


Changing password for scott
New password:

After 2 minutes of grace time the password got expired and asking for new password.

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer