dba_users.Password contains hashed passwords. How can old password be verified before changing password? I have rough idea about two methods:
(1) Find what hash algorithm and seed value oracle is using, then take hash and match hashes. This turns out to be very hard as oracle’s hash algorithm and seed are not publicly known.
(2) EXECUTE IMMEDIATE ‘CONNECT ‘ || p_UserName || ‘/’ || p_OldPassword. What issues do this approach have? How to close connection after this is executed, or do it automatically closed once the statement or procedure exits? Can the same user be login simultaneously multiple times under any scenario?
The ALTER USER command has a REPLACE keyword that lets you specify the old password.