Sunday 26 January 2020

Script to Reset User Password from Backend in Oracle APPS

SET serveroutput ON;
DECLARE
  l_user_name    VARCHAR2(30):= UPPER('SANDEEP_SHARMA');
  l_new_password VARCHAR2(30):= 'sysadmin';
  l_status       BOOLEAN;
BEGIN
  l_status   := fnd_user_pkg.ChangePassword ( username => l_user_name,
                                              newpassword => l_new_password
                                            );
  IF l_status  THEN
    dbms_output.put_line ('Password reset successfully for the User:'||l_user_name);
    COMMIT;
  ELSE
    DBMS_OUTPUT.put_line ('Unable to reset password due to'||SQLCODE||' '||SUBSTR(SQLERRM, 1, 100));
    ROLLBACK;
  END IF;
END;

No comments:

Post a Comment