A very common task for system administrators within their daily routine is to reset passwords for Oracle users. The normal procedure is query the user in the user form, from System Administrator responsibility. This takes several minutes for each password reset. Also, the user would need to change the password on their first login.
To reset the passwords very fast and without having to change the password on login, we can use an API as shown
 below.
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
 | -- Change password of TEST_USER to oracle123 (does not ask for reset on first logon)BEGIN   fnd_user_pkg.updateuser (x_user_name                   => 'TEST_USER',x_owner => 'CUST',x_unencrypted_password => 'oracle123',                            x_end_date                    => fnd_user_pkg.null_date,x_password_date => SYSDATE - 10,                            x_password_accesses_left      => 10000,                            x_password_lifespan_accesses  => 10000,                            x_password_lifespan_days      => 10000                           );   COMMIT;END; | 
Note: If the password is changed from the backend then the user will not be prompted to change his/her password on login screen.
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
 | -- Change TEST_USER Password from PL/SQLSET serverout onDECLARE   return_value   VARCHAR2 (200);BEGINreturn_value := fnd_web_sec.change_password ('TEST_USER', 'oracle123');   DBMS_OUTPUT.put_line ('Result ' || return_value);   -- Y Means Success Else Fail.   COMMIT;END; | 
You also execute the API as a SQL query
1 
 | select fnd_web_sec.validate_login('SA1','etihad123') from dual; | 
0 comments