Sunday, 16 January 2011

R12: Change Application user password and end date from sqlplus

DECLARE
  v_user_name     VARCHAR2(80) := 'GFMISDBA';
  v_new_password  VARCHAR2(80) := 'oracle123';
  v_hard_password VARCHAR2(1) := fnd_profile.VALUE('SIGNON_PASSWORD_HARD_TO_GUESS');
BEGIN
  fnd_profile.put(NAME => 'SIGNON_PASSWORD_HARD_TO_GUESS'
                 ,val  => 'N');
  -- Call the procedure
  fnd_user_pkg.updateuser(x_user_name            => v_user_name
                         ,x_owner                => 'CUST'
                         ,x_unencrypted_password => v_new_password
                         ,x_end_date             => SYSDATE + 10000);
  fnd_profile.put(NAME => 'SIGNON_PASSWORD_HARD_TO_GUESS'
                 ,val  => v_hard_password);
COMMIT ;
EXCEPTION
  WHEN OTHERS THEN
    fnd_profile.put(NAME => 'SIGNON_PASSWORD_HARD_TO_GUESS'
                   ,val  => v_hard_password);
    RAISE;
END;

No comments:

Post a Comment

Number of Visitors