Pages

Search This Blog

Thursday, February 4, 2010

How to change Oracle applications user password programmatically

Generally Oracle applications user password is reset/changed through the System administrator> Define user form.
But sometimes developers/testers need to do a quick test using some user's credentials in dev/test instance and in these situations, you lose time if you follow the above procedure just for resetting the user password.

To address this pain, developers can use fnd_user_pkg.changepassword API to change the password of an Oracle application user.

This returns boolean value and has two input parameters,

1. User name
2. Password

Following PL/SQL block can be used to reset password to welcome@123,

begin
if fnd_user_pkg.changepassword('USER_NAME','welcome@123') then
null;

end if;
end;

4 comments:

  1. I tried doing something similar to what you have but kept getting The following error:

    PLS-00306: wrong number or types of arguments in call to 'CHANGEPASSWORD'
    ORA-06550: line 2, column 5:

    When I explicitly list my arguments as follows it works just fine:

    fnd_user_pkg.changepassword(username => 'USER'
    ,newpassword => 'pwd' );

    When I checked the package spec this function is overloaded so I'm guessing that's what caused my problem?

    Thanks,
    Brian B.

    ReplyDelete
  2. DOH! Just realized the cause of my problem is because I wasn't properly handling the return value from the function which you did with your If then Null;

    Sorry about that...
    Brian B.

    ReplyDelete
  3. Is this function changepassword visible in Integrated SOA gateway, As I want to use this function from external system as exposed web service.

    I am trying to find it out in Application Technology -> User management -> user -> FND_USER_PKG

    ReplyDelete
  4. Dont forget to issue commit in the end.

    ReplyDelete

Followers

Contributors