ORA-28007: the password cannot be reused
Hi,
If you want to reuse your password when changing it or your verify function is so strict, you can use this anonymous pl/sql block to set a password as whatever you want:
–coded by Mustafa DOGANAY (2012)
declare
v_profile VARCHAR2(30);
v_reuse_max VARCHAR2(40);
v_reuse_time VARCHAR2(40);
v_user VARCHAR2(50);
v_pass VARCHAR2(20);
begin
v_user:=’USER1′;
v_pass:=’your_new_passwd’;
select profile into v_profile from dba_users where username=v_user;
select a.limit into v_reuse_max from dba_profiles a, dba_users b
where a.resource_name=’PASSWORD_REUSE_MAX’ and a.profile=b.profile and b.username=v_user;
select a.limit into v_reuse_time from dba_profiles a, dba_users b
where a.resource_name=’PASSWORD_REUSE_TIME’ and a.profile=b.profile and b.username=v_user;
execute immediate ‘alter profile ‘||v_profile||’ limit PASSWORD_REUSE_MAX UNLIMITED’;
execute immediate ‘alter profile ‘||v_profile||’ limit PASSWORD_REUSE_TIME UNLIMITED’;
execute immediate ‘alter user ‘||v_user||’ account unlock identified by “‘||v_pass||'”‘;
execute immediate ‘alter profile ‘||v_profile||’ limit PASSWORD_REUSE_MAX ‘ ||v_reuse_max;
execute immediate ‘alter profile ‘||v_profile||’ limit PASSWORD_REUSE_TIME ‘||v_reuse_time;
end;
/
try and pray 🙂
Leave a comment