Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Oracle APEX Best Practices

You're reading from   Oracle APEX Best Practices Make the most of Oracle Apex with this guide to best practices. It will help you look at the bigger picture when building applications and take more elements into account such as security and performance.

Arrow left icon
Product type Paperback
Published in Nov 2012
Publisher Packt
ISBN-13 9781849684002
Length 298 pages
Edition 1st Edition
Arrow right icon
Toc

Table of Contents (14) Chapters Close

Oracle APEX Best Practices
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Prepare and Build 2. Leveraging the Database FREE CHAPTER 3. Printing 4. Security 5. Debugging and Troubleshooting 6. Deploy and Maintain Database Cloud Service and APEX 4.2 Index

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.

Login attempt in workspace Internal as Admin

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:

  1. Start SQL*Plus and connect as sys with the sysdba role.

  2. Run the script by entering @apxchpwd.sql.

  3. 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:

  1. Go to Manage Workspaces.

  2. Select Existing Workspaces.

  3. 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.

  4. Select the workspace Internal by clicking on the name.

  5. Select Manage Users. Here you can see the user Admin.

  6. 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.

  7. 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.

  8. Click on Create to finish.

    Settings for the new administrator

Command line

When we still have access, we can use the web interface of APEX. If not we can use the command line:

  1. Start SQL*Plus and connect as SYS with the SYSDBA role.

  2. Unlock the APEX_xxxxxx account by issuing the following command:

    alter user APEX_xxxxxx account unlock;
    
  3. Connect to the APEX_xxxxxx account. If you don't remember your password, you can just reset it, without impacting the APEX instance.

  4. 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
    /
  5. The new administrator is created. Connect again as SYS with the SYSDBA role and lock the account again with the following command:

    alter user APEX_xxxxxx account lock;
    
  6. 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:

  1. Log in to the APEX Administrator Services.

  2. Go to Manage Workspace.

  3. Select Existing Workspaces.

  4. Select the workspace.

  5. Select Manage Users.

  6. 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:

  1. Log in to the workspace.

  2. Go to Administration.

  3. Select the user, change the password, and unlock the user.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image