Creating a second administrator
When installing APEX, by
default the workspace Internal
with the administrator user Admin
is created. Some users know more than the average end user. Also, developers have more knowledge than the average user. Imagine that such users try to log in to either the APEX Administration Services or the normal login page with the workspace Internal
and administrator Admin
, and consequently use the wrong password. As a consequence, the Admin account would be locked after a number of login attempts. This is a very annoying situation, especially when it happens often. Big companies and APEX Hosting companies with many workspaces and a lot of anonymous users or developers may suffer from this. Fortunately there is an easy solution, creating a second administrator account.
If the account is already locked, we have to unlock it first. This can be easily done by running the apxchpwd.sql
script, which can be found in the main Apex directory of the unzipped installation file of
APEX:
Start SQL*Plus and connect as
sys
with thesysdba
role.Run the script by entering
@apxchpwd.sql
.Follow the instructions and enter a new password.
Now we are ready to create a second administrator account. This can be done in two ways, using the web interface or the command line.
APEX web interface
Follow these steps to create a new administrator, using the browser.
First, we need to log in to the APEX Administrator Services at http://server:port/apex/
. Log in to the workspace Internal
, with the administrator credentials.
After logging in, perform the following steps:
Go to Manage Workspaces.
Select Existing Workspaces.
You can also select the edit icon of the workspace
Internal
to inspect the settings. You cannot change them. Select Cancel to return to the previous screen.Select the workspace
Internal
by clicking on the name.Select Manage Users. Here you can see the user
Admin
.You can also select the user
Admin
to change the password. Other settings cannot be changed. Select Cancel or Apply Changes to return to the previous screen.Select Create User. Make sure that Internal is selected in the Workspace field and
APEX_xxxxxx
is selected in Default Schema, and that the new user is an administrator.xxxxxx
has to match your APEX scheme version in the database, for instance, APEX_040100.Click on Create to finish.
Command line
When we still have access, we can use the web interface of APEX. If not we can use the command line:
Start SQL*Plus and connect as
SYS
with theSYSDBA
role.Unlock the
APEX_xxxxxx
account by issuing the following command:alter user APEX_xxxxxx account unlock;
Connect to the
APEX_xxxxxx
account. If you don't remember your password, you can just reset it, without impacting the APEX instance.Execute the following (use your own username, e-mail, and password):
BEGIN wwv_flow_api.set_security_group_id(p_security_group_id=>10); wwv_flow_fnd_user_api.create_fnd_user( p_user_name => 'second_admin', p_email_address => 'email@company.com', p_web_password => 'second_admin_password') ; END; / COMMIT /
The new administrator is created. Connect again as
SYS
with theSYSDBA
role and lock the account again with the following command:alter user APEX_xxxxxx account lock;
Now you can log in to the
Internal
workspace with your newly created account and you'll be asked to change your password.
Other accounts
When an administrator of a developer workspace loses his/her password or has a locked account, you can bring that account back to life by following these steps:
Log in to the APEX Administrator Services.
Go to Manage Workspace.
Select Existing Workspaces.
Select the workspace.
Select Manage Users.
Select the user, change the password, and unlock the user.
A developer or an APEX end user account can be managed by the administrator of the workspace from the workspace itself. Follow these steps to do so:
Log in to the workspace.
Go to Administration.
Select the user, change the password, and unlock the user.