Tuesday, 23 May 2017

How to Reset the Oracle Apex Username Password

What if we forget the apex admin password? Is there any mechanism to reset the password? The answer is "Yes". This can be achieved easily by following the steps mentioned below. 

1. Identify the User Id/Username from the the table "wwv_flow_fnd_user"; This is usually available in the Schema "APEX_050100" (if you are using Apex 5.1).  


  1. select * from  APEX_050100.wwv_flow_fnd_user;  

2. Execute the following script and pass the argument such as userId, username, email and the new password.

  1. declare  
  2.       c_user_id  constant number         := to_number( '19380353220414198' );  
  3.       c_username constant varchar2(4000) := upper( 'ADMIN' );  
  4.       c_email    constant varchar2(4000) := 'admin@yourdomain.com';  
  5.       c_password constant varchar2(4000) := 'Abc#123';  
  6.   
  7.       c_old_sgid constant number := wwv_flow_security.g_security_group_id;  
  8.       c_old_user constant varchar2(255) := wwv_flow_security.g_user;  
  9.   
  10.       procedure cleanup  
  11.       is  
  12.       begin  
  13.            wwv_flow_security.g_security_group_id := c_old_sgid;  
  14.            wwv_flow_security.g_user              := c_old_user;  
  15.       end cleanup;  
  16.   begin  
  17.        wwv_flow_security.g_security_group_id := 10;  
  18.        wwv_flow_security.g_user              := c_username;  
  19.   
  20.        wwv_flow_fnd_user_int.create_or_update_user( p_user_id  => c_user_id,  
  21.                                                    p_username => c_username,  
  22.                                                    p_email    => c_email,  
  23.                                                    p_password => c_password );  
  24.   
  25.       commit;  
  26.       cleanup();  
  27.   exception  
  28.       when others then  
  29.           cleanup();  
  30.           raise;  
  31.   end;  
  32.   /  

Once the PL/SQL block is executed successfully, Password will be updated in the table APEX_050100.wwv_flow_fnd_user 

2 comments:

  1. This PL/SQL was taken from a script that you can optionally, just find and run from the apex home.

    apxchpwd.sql

    ReplyDelete
  2. ERROR at line 20:
    ORA-06550: line 20, column 8:
    PLS-00201: identifier 'WWV_FLOW_FND_USER_INT.CREATE_OR_UPDATE_USER' must be
    declared
    ORA-06550: line 20, column 8:
    PL/SQL: Statement ignored

    ReplyDelete