Tuesday, February 7, 2012

Oracle 11g sets by default password expiration - how to change that

To check if we have users with password status expired we have to run following query

SQL> select username, account_status, expiry_date, profile from dba_users;

USERNAME ACCOUNT_STATUS EXPIRY_DA
------------------------------ -------------------------------- ---------
PROFILE
------------------------------
OE EXPIRED 07-FEB-12
DEFAULT


As we can see the password for user OE has been expired. In this case first we have to change the password using

SQL> alter user oe identified by newpassword;

User altered.

Now if we check default profile we will see that default PASSWORD_LIFE_TIME is 180 days.

SQL> SELECT profile, resource_name, limit FROM dba_profiles WHERE profile='DEFAULT';

PROFILE RESOURCE_NAME
------------------------------ --------------------------------
LIMIT
----------------------------------------
DEFAULT FAILED_LOGIN_ATTEMPTS
10

DEFAULT PASSWORD_LIFE_TIME
180

Now i am going to change PASSWORD_LIFE_TIME to UNLIMITED

SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

Profile altered.

SQL> SELECT profile, resource_name, limit FROM dba_profiles WHERE profile='DEFAULT';

PROFILE RESOURCE_NAME
------------------------------ --------------------------------
LIMIT
----------------------------------------
DEFAULT FAILED_LOGIN_ATTEMPTS
10

DEFAULT PASSWORD_LIFE_TIME
UNLIMITED

No comments:

Post a Comment