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”

  • AM says:

    First, your site looks great!

    Hi, I tried a couple times to get the images loaded but no luck. At least that is what I think is going on. When I open 127.0.0.1:8080 I see a red X next to Application Express. When I enter internal admin and htmldb all I get is Error on page. in the bottom left corner. It does not look like it is hitting the database?

    Can you help me with this?

    Thanks
    Andy awilco@hotmail.com

  • Sara says:

    Hi Andy

    From what you’ve said it sounds exactly like your images aren’t loaded. This explains the red cross and the error you receive.

    When you try to load the images do you get any messages or errors? Or does everything seems to work and complete very quickly? If it finishes very quickly it could be that the path you are passing in doesn’t exist. If you are installing APEX 3.1 check that you have unzipped the files to C:\Apex\apex_3.1 and try typing in

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

    You should have a folder called C:\Apex\apex_3.1\images on your PC which contains all the images and javascript files. If you don’t then you will need to pass in the directory path of the directory that contains this images directory.

    Hope this helps.

    Regards
    Sara

  • AM says:

    Hi, Sara, thanks for the reply. It takes a little while to run, below is the output. Funny thing is after I installed XE I could see images and log into the database. After I ran the script below I can no longer see the images even from XE? I am running the script as system/password as sysdba, is that correct?

    Here is the command and output from the script.

    SQL> @apxldimg.sql c:\apex\apex_3.1.2

    PL/SQL procedure successfully completed.

    old 1: create directory APEX_IMAGES as ‘&1/apex/images’
    new 1: create directory APEX_IMAGES as ‘c:\apex\apex_3.1.2/apex/images’

    Directory created.

    PL/SQL procedure successfully completed.

    PL/SQL procedure successfully completed.

    Commit complete.

    timing for: Load Images
    Elapsed: 00:01:02.54

    Directory dropped.

  • Sara says:

    Hi Andy

    When you look in windows explorer does the directory c:\apex\apex_3.1.2\apex\images exist? A sure fire way of checking is to paste c:\apex\apex_3.1.2\apex\images into the run command which should open up the folder. If it doesn’t then this is the problem.

    When you install XE it comes with APEX 2.2, so there are already images there. As the script failed then APEX is looking for the 3.1.2 images but can’t find them.

    If you’re directory doesn’t exist then you need to find where the apex directory is, this will be where you’ve extracted the Apex 3.1.2 zip to and pass in the parent directory path for this directory instead.

    Regards
    Sara

  • dharmesh says:

    its really very good artical
    this help me lot to install apex 3.1.2
    and its working fine…

    thanks.

  • Suhas says:

    I have installed Apex 3.1.2 . When I login through http://localhost:8081/apex/apex_admin , it ask for password for admin for XDB. How to get the password for XDB

    • Sara Blair says:

      Hi Suhas

      From what you’ve said I assume that when you access this page you see a popup window asking for the XDB password. If so, it sounds like you have a problem with your installation. Try entering the system username and password and see if it displays the page correctly. You are usually prompted for this password when directly accessing the /i/ images directory, but I’ve not received it when accessing the login screen. Hopefully entereing it once will allow you to continue.

      Hope this helps.
      Sara

  • Akbar says:

    Hi,
    I have installed apex after installation I couldn’t able to see the Images,What can I do?

    Thanks in advance,
    Akbar

  • Glenn says:

    Upgrade of default APEX version 2.X on 10g XE for windows to APEX version 3.2 this evening went smoothly without any problems as a result of referring to this tutorial plus OTN document located at URL:

    http://www.oracle.com/technology/products/database/application_express/html/3.2_and_xe.html

  • Kevin says:

    This is a great article. I managed to instal APEX 3.2 by following the steps. Would have been good if the user comments reporting some discrepancies could be used to correct the article (or the article points out there has been a correction), as in the case of the apex3.1 -> apex_3.1 that was corrected in the article after numero 3 and 4 were made…

    Overall, it’s a very helpful guide unlike the stupid idiotic oracle guides full of texts but meaning not much, and crotchingly difficult to find the exact information you need, where you have to scroll millions of pages or guides to find the one line of instruction you were looking for, or go to their OTN discussion forums which are helpful though (at least that is a plus, as compared to discussion boards where you have stupid butts telling you to go read the oracle guide instead of pointing you to the info you need – why would I go to their stupid forums if I did not read the oracle encyclopedias and not found the necessary info? They think I am lazy? THEY are the LAZY ones and willy wonkers too)

  • Kamal says:

    I was following these instructions for Apex 3.2 and was stuck in step #10 to load the images; and getting following error. Please help.
    Moreover I am connected as sysdba.
    (Note: I have the folder C:\APEX\apex which contains apxldimg.sql)
    —————————————
    SQL> @apxldimg.sql C:\APEX\apex

    PL/SQL procedure successfully completed.

    old 1: create directory APEX_IMAGES as ‘&1/apex/images’
    new 1: create directory APEX_IMAGES as ‘C:\APEX\apex/apex/images’

    Directory created.

    declare
    *
    ERROR at line 1:
    ORA- 22288: file or LOB operation FILEOPEN failed
    The system cannot find the path specified.
    ORA- 06512: at “SYS.DBMS_LOB”, line 523
    ORA- 06512: at “SYS.XMLTYPE”, line 287
    ORA- 06512: at line 15
    —————————————

    • Sara Blair says:

      Hi Kamal

      Have you managed to resolve this problem yet? If not, have you checked the following:
      - that directory C:\APEX\apex\apex\images exists
      - that it’s accessible from the database server
      - that the read/write privileges are set up correctly

      Regards
      Sara

  • Biodun says:

    hello, pls i i tried upgrading my apex to 3.2… i have XE installed on my machine (windows vista)… it`s not working!!
    pls help me out.

    • Sara Blair says:

      Hi Biodun

      Can you provide any more information? Do you receive an error when you try to install? Or does it say that it’s successfully installed but you can’t log in?

      Sara

  • I was struggling with the apxldimg.sql routine failing. I finally tracked the problem down and wanted to share it in case anyone else has the same problem.

    In my case, I put the Apex installation files on a shared network drive H:\ in the directory H:\apex_3.2. The line of the script that tries to open this directory fails. If I put the files on my local drive C:\apex_3.2 then everything works okay.

    I searched Metalink and there are lots of reported problems with using networked drives.

  • Jim says:

    From Kamal’s above …

    SQL> @apxldimg.sql C:\APEX\apex

    PL/SQL procedure successfully completed.

    old 1: create directory APEX_IMAGES as ‘&1/apex/images’
    new 1: create directory APEX_IMAGES as ‘C:\APEX\apex/apex/images’
    -^—-^——- bad windows path “/”

    has anyone noticed this? The PL/SQL proc is appending the path with “/apex/images” , shouldn’t it by “\apex\images”

    I changed the code in apxldimg.sql to use “\apex\images” and am still having a problem. The images are in the “c:\apex\apex_3.1.2\apex\images” on my PC and this directory appears when I enter this path in the browser.

    • Sara Blair says:

      Hi Jim

      apxldimg.sql works fine with the forward slashes and shouldn’t need to be changed. Can you provide more information on the problem you are having and the output produced.

      Thanks

  • Jim says:

    Hi Sara,

    I’m not seeing the images like stated in some of the other postings. (red x). Re-installing everything.

    I’m downloading version Apex 3.2 right now. Already have Oracle Database 10g Express Edition Release 10.2.0.1.0 installed.

    Should I follow steps for the 3.1 install, like:

    If you are installing Apex 3.1 instead of entering
    @apexins htmldb APEX APEX_FILES TEMP /i/
    instead enter
    @apexins APEX APEX_FILES TEMP /i/

    Any other suggestions with Apex 3.2 install?

  • Jim says:

    Should I see the Application Builder icon in OracleXE?

    • Sara Blair says:

      Hi Jim

      It depends on who you log in as as to whether you see the Application Builder in OracleXE. What do you see?

      Have you managed to upgrade yet? I would advise checking the Oracle documentation for the 3.2 upgrade as this isn’t something I’ve done yet and they changed the parameters for the apexins script for 3.1. Instead of passing in the password (htmldb in the documentation above) you only passing the other four parameters and there are a few more steps that you need to take. So I would advise checking the Oracle documentation.

      Sara

Leave a Comment

Registered users may Log in first.