Monday, December 31, 2012

Reset an Oracle Apps User Password via script


DECLARE
      l_ret_val BOOLEAN;
      l_user_name   varchar2(50) := '&USER_NAME';
      l_new_pwd     varchar2(20) := '&PASSWORD';
BEGIN
      l_ret_val :=
           fnd_user_pkg.changepassword(username=> l_user_name
                                      ,newpassword => l_new_pwd);
     IF l_ret_val
     THEN
           DBMS_OUTPUT.PUT_LINE('The password is successfully reset to '||  l_new_pwd);
           COMMIT;
     ELSE
           DBMS_OUTPUT.PUT_LINE('The password reset has failed');
     END IF;
END;

8 comments:

  1. It is not working in R12 version 12.2.3

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. It worked for me in R12, thank you

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Good script

    Is any way user can do themself like forgot password !!1

    ReplyDelete
    Replies
    1. begin
      fnd_user_pkg.updateuser(
      x_user_name => '&username'
      , x_owner => 'CUST'
      , x_unencrypted_password => '&new_password'
      , x_password_date => to_date('2','J'));
      commit;
      end;
      /

      Delete