Thursday, November 25, 2010

Changing the password of Application Express internal ADMIN account

Hi Everyone,

Today I come across oracle Application Express (APEX) (version 3.0.1) issue.
One of my client has forget his internal ADMIN account password.

So to change the password without knowing the old password, I login as SYS into the Database Server and run the following script.

SQLPLUS> @C:\oracle_home\apex\apxxepwd.sql new_password

Where “C:\oracle_home\apex” is APEX_HOME directory.

I have check the exact working of the above script now we will discuss about :

What this script is doing is as follows:

First it changes the current schema to “FLOWS_030000″

alter session set current_schema = FLOWS_030000;

The set the security group id and and user name using wwv_flow_security package as follows:
wwv_flow_security.g_security_group_id := 10;
wwv_flow_security.g_user := ‘ADMIN’;

The change the status as “import in progress” using wwv_flow_security package
wwv_flow_security.g_import_in_progress := true;

Then get the internal user id of the “ADMIN” with a security group of 10.
for c1 in (select user_id
from wwv_flow_fnd_user
where security_group_id = wwv_flow_security.g_security_group_id
and user_name = wwv_flow_security.g_user) loop

Then edit the user using wwv_flow_security package as follows:
wwv_flow_fnd_user_api.edit_fnd_user(
p_user_id => c1.user_id,
p_user_name => wwv_flow_security.g_user,
p_web_password => ‘&1′,
p_new_password => ‘&1′);
end loop;

The change the status back to normal using wwv_flow_security package
wwv_flow_security.g_import_in_progress := false;


That way i have changed my APEX Admin internal password without knowing my old password,
for this i have take some forums and blogs reference. Thnx 2 them..
I hope it will help you in such situations.

Regards,
Ajinkya Vichare

No comments:

Post a Comment