Advertisements

Showing posts with label Data Base. Show all posts
Showing posts with label Data Base. Show all posts

Tuesday, February 17, 2015

When oracle db password expires

Use this instructions to unlock the user account when the password is expired:

--check user status
select username, expiry_date, account_status from dba_users where username = 'USERACC';


--To unlock an user:

alter user USERACC ACCOUNT UNLOCK;


--To reset the password:

alter user USERACC identified by ARISBP01;


--But we'd like to use the existing password so we proceed with:

--To Keep same Password:



select 'alter user "'||d.username||'" identified by values '''||u.password||''';'

from dba_users d, sys.user$ u

where d.username = upper('USERACC ')

and u.user# = d.user_id; 



alter user "USERACC " identified by values '4301288F751F9615';





--On a production system, has to change this limit to unlimited to solve this and to avoid this in future.

ALTER PROFILE DEFAULT LIMIT password_life_time UNLIMITED;

Don't forget to commit;