Skip to main content

oracle password expired and lock

I use the following SQL to reset the password:

select  distinct  'alter profile '||profile||' limit PASSWORD_REUSE_MAX UNLIMITED;' from dba_profiles where profile in (select profile from dba_users where ACCOUNT_STATUS like '%EXPIRED%');
select  distinct 'alter profile '||profile||' limit PASSWORD_REUSE_TIME UNLIMITED;' from dba_profiles where profile in (select profile from dba_users where ACCOUNT_STATUS like '%EXPIRED%');
select  distinct 'alter profile '||profile||' limit PASSWORD_LIFE_TIME unlimited;' from dba_profiles where profile in (select profile from dba_users where ACCOUNT_STATUS like '%EXPIRED%');

select 'alter user '||sys.user$.name||' identified by values '||''''||sys.user$.password||''''||';'
from sys.user$, dba_users b where sys.user$.name=b.username and  b.account_status like '%EXPIRED%';


Comments