Installing APEX Tutorial

Prior to training, we’ve found it really useful that developers install Oracle APEX and Oracle XE locally. Not only does this give them a safe environment in which to experiment, but it gives them an understanding of what Oracle APEX actually is. They can use this knowledge to help support our customer installations and in investigation of any setup or installation issues that we have.

The following step-by-step instructions have been followed successfully by many developers now and we’ve got the installation time down to well under two hours, including configuration. These instructions refer to APEX 3.0.1 but could be used for APEX 3.1 or later releases. You need to download Oracle XE and the latest release of APEX.

1 – Create a new folder on your C: drive called Apex and copy the Oracle XE executable and APEX zip file there.

2 – Right click on Apex_3.0.1.zip and select Extract Files. Ensure the path is C:\Apex\apex_3.0.1 and hit OK. (This is probably a good point to get a coffee as it takes a couple of minutes.)

Note: C:\Apex\apex_3.0.1 is your Apex Home directory for this installation.

3 – First install Oracle XE. This will create a local database on your PC with the SID XE which will have APEX 2.1 automatically installed. To do this double click on OracleXEUniv.exe.

4 – Follow through the windows by clicking Next, I Accept, Next until you’re asked for a password. This is the password for the system user, enter manager in both fields and click Next.

5 – Before clicking Install, take a note of the port for the listener and HTTP server. These should be 1521 and 8080 respectively, but may be different if these ports are already in use on your PC. Now click Install and Finish when the install is completed.

6 – Now we’ll upgrade APEX to version 3.0.1. First log into SQL*Plus on your XE database as sysdba. To do this, you’ll need to set up a new tnsnames entry for the database or you can click Run SQL Command Line through the Windows start bar. The IP address will be 127.0.0.1, the port is the TNS listener port you recorded in step 5 (probably 1521) and the SID is XE. When you log into SQL*Plus you will need to type conn system/manager@XE as sysdba at the prompt.

7 – You’ll need to create two new tablespaces for the installation. In SQL*Plus type the following:

CREATE TABLESPACE APEX datafile ‘C:\oraclexe\oradata\XE\APEX.dbf’
SIZE 500M
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;
CREATE TABLESPACE APEX_FILES datafile ‘C:\oraclexe\oradata\XE\APEX_FILES.dbf’
SIZE 100M
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;

8 – Set your working directory in SQL*Plus to C:\Apex\apex_3.0.1\Apex. Do this by opening the file C:\Apex\apex_3.0.1\Apex\apxsqler.sql. Now at the prompt type the following:

@apexins htmldb APEX APEX_FILES TEMP /i/

This takes a couple of minutes to install, but there is pretty output to watch scroll past. When it’s done it will close SQL*Plus.

9 – Now check the log file created for errors (they’re usually at the end of the file, so this is a good place to start). The log file will be created in C:\Apex\apex_3.0.1\Apex. Only if there are errors, remove everything done in step 8 by logging into SQL*Plus as sysdba and issuing the following command:

DROP USER FLOWS_030000 CASCADE;

You’ll then need to correct whatever caused the errors.

10 – Log back into SQL*Plus as sysdba and open C:\Apex\apex_3.0.1\apex\apxsqler.sql again. Now type the following:

@apxldimg.sql C:\Apex\apex_3.0.1

(This loads the images into the Oracle XE database).

Then when this has finished type:

@apxxepwd.sql htmldb

(This sets the APEX password for the Admin user).

When this has run the installation is complete!

Configuring Your Internet Browser

You’ll need to make a small change to your Internet browser to run APEX on your XE database. Depending on your favourite browser you’ll need to do one of the following:

Configuring for Microsoft Internet Explorer

To configure Microsoft Internet Explorer to connect to the Oracle Database XE Database Home Page:

  1. From the Start menu, select Control Panel, then Internet Options.
  2. In the Internet Options dialog box, click the Security tab.
  3. Under Security, select Local Intranet and then select Sites.
  4. In the Local Intranet dialog box, select Advanced.
  5. Under Add this Web site to the zone, enter the following site: 127.0.0.1
  6. Click OK.

Configuring Netscape Navigator or Mozilla

To configure Netscape Navigator or Mozilla to connect to the Oracle Database XE Database Home Page:

  1. From the Edit menu, select Preferences.
  2. Under Category, click the Advanced category to expand it, and then select Proxies.
  3. If you are using a proxy server, add the following setting to the No Proxy For setting: 127.0.0.1
  4. Click OK.

Configuring Firefox

To configure Firefox to connect to the Oracle Database XE Database Home Page:

  1. Under the Tools menu, select Options.
  2. From the General tab, select Connection Settings.
  3. If you are using a proxy server, add the following setting to the No Proxy For setting: 127.0.0.1
  4. Click OK.

Running and setting up APEX

1 – You should now be able to run APEX on your PC. The url will be something like http://127.0.0.1:8080/apex where 8080 is the port of the HTTP server noted in step 5 of the XE installation.

2 – You should see a login screen. To start with, login with the following credentials:

Workspace – internal
Username – Admin
Password – htmldb

3 – This will take you to the admin area. You’ll need to create a workspace which contains the sample application. First we need to check that the sample application will automatically be created. To do this click Manage Service then Feature Configuration. The option ‘Create demonstration objects in new workspaces’ should be set to Yes. If it isn’t, select Yes and then Apply Changes, otherwise click Cancel.

4 – Now select Manage Workspaces and Create Workspace. The workspace name should be TRAIN, then click Next.

5 – The first option should be No, the schema name should be TRAIN and the schema password should be train (just to make things easy!). Set the space quota to 10 and click Next.

6 – Now set the Admin password to htmldb and enter your email address in the last field. The email address isn’t used for anything but Oracle have set it to mandatory, so you need to put something in here. Now click Next, then Finish and Done on the final screen. Now you can log out.

7 – Don’t worry, this is the final bit, then you can have a play. Now log back in using the following credentials:

Workspace – TRAIN
Username – Admin
Password – htmldb

You’ll see there are three options, Application Builder, SQL Browser and Utilities. If you click on the Application Builder icon, you should have one Sample Application listed. If you click on this it will display the pages in that application and clicking Run Application will run it. The username and password are Admin and train. Check that the application runs successfully.

Follow these instructions to install Oracle XE and upgrade APEX to 3.0.1, configure your web browser and create a new workspace in APEX with the sample application installed. Tutorials on this site assume that you have either followed these steps or already have a workspace with the sample application installed.

Sara

Sara Blair is a freelance Oracle developer with over 10 years Oracle experience. She has been working with Oracle APEX for nearly 4 years since htmldb 1.5, and is available to hire through Silvercore Solutions.

42 Responses to “Installing APEX Tutorial”

  • Jim says:

    Ignore the last comment.

    I’m not going to upgrade to 3.2 at this right now. Spend some time playing with the default apex. Keep getting the error with the images and not able to login.

  • Jim says:

    Hi Sara,

    I upgraded to 3.1.2 on one machine and to 3.2 on a different machine.

    Both where successful following this suggestion I copied from above:
    ************
    joseph Says:
    August 4th, 2008 at 6:11 am

    installing on vista business.
    make sure your directory structure is like this

    c:\oraclexe\apex

    and NOT c:\oraclexe\apex\apex_3.1.1
    ************

    When upgrading to 3.2, also followed these directions:
    http://www.oracle.com/technology/products/database/application_express/html/3.2_and_xe.html

    Thanks,

    Jim

  • Robert says:

    @ash – probably means you have not unlocked the apex_public_user account.

  • Rahim says:

    Thanks very much, its also working for 4.0.1

  • Cristina says:

    Hello
    I followed the steps and I belive it all went verry well until “Running and setting up APEX”. that’s when I got stuck because I try to insert the url: “http://127.0.0.1:1521/apex “.
    My SID is orcl, port 1521, hostname: localhost. I don’t know who “apex” from the path in the url is, I installed apex 4.0 in the folder app from D: where I had previously installed Oracle 11g r2.Hope you can help me

  • Cristina says:

    I forgot to mention that when I insert the url http://127.0.0.1:1521/apex the browser(Internet Explorer) cannot disply the webpage (error:”Internet Explorer cannot display the webpage”)

    • Sara Blair says:

      Hi Cristina

      The URL you are using has the database port in it, but it needs to use the HTTP server port instead. This is usually 8080, which would make the URL http://127.0.0.1:8080/apex

      Sara

Comments can no longer be submitted.