Search This Blog

Friday, September 26, 2014

How to install Oracle Apex4 on Windows: A step by step description

Installing Oracle Apex on Windows

How you install Oracle Application Express depends upon which HTTP server you Decide to use. There are three options

  • 1: Oracle Application Express Listener
  • 2: Embedded PL/SQL Gateway
  • 3: Oracle HTTP Server

In all of these options Apex installation procedure is same and configuring Embedded PL/SQL Gateway is simpler. Embedded PL/SQL gateway provides the equivalent core features of Oracle HTTP Server and MOD_PLSQL.

In this article I’ll show how to install apex and configure the Embedded PL/SQL Gateway. In this case I've used

  • Oracle Database 11gR2 (11.2.0)
  • Oracle apex 4.2.5
  • Toad 10.5
  • Windows 7
If you want to configure oracle rest data service with tomcat read this article How to install Apex5 in windows and configure Oracle REST Data Services as web listener
Remember I’ll not discus about installing database.I assume that you have a database already installed and you have the administrative privileges on the database. Also assume that you have downloaded apex. If not so, you may get a copy of Oracle Apex 4.2.5 on OTN

Steps to install Oracle Apex

Step 1

Login to database and create a table space (e.g.TS_APEX). Table space creating command is as below

CREATE TABLESPACE ts_apex
DATAFILE 'C:\APP\ADMINISTRATOR\ORADATA\CANOPAS\TS_APEX01.DBF'
SIZE 2048M AUTOEXTEND ON NEXT 100M
MAXSIZE UNLIMITED
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
FLASHBACK ON;

Step 2

Unzip the apex folder. (Right click on apex_4.2.5.zip folder then choose extract here) you will find a folder named apex. Copy this folder anywhere on your hard drive you wish. In my case I’ve put it in C:\apex.

Step 3

Open Command Prompt (cmd). Change your working directory to apex where you put the unzipped apex folder (in my case it is C:\apex). Below images showing the command

Step 4

Now open SQL*Plus with nolog option by executing the command

C:\apex> sqlplus /nolog ENTER

Then

SQL> conn sys as sysdba ENTER

(To connect to database with sysdba privileges)

When password require enter sys user’s password. ENTER

Step 5

Now you need to run apex installation file named apexins.sql. in command prompt enter the command like below

SQL> @apexins.sql ts_apex ts_apex temp /i/ ENTER

[ Here APEXINS.SQL is the apex main installation file. TS_APEX is the table space name which we creates at first step for apex user, apex files and temp is also a table space for apex temporary file. /i/ is a virtual drive for images. ]

It may take 30/40 minutes and may be disconnect from database. Remember whenever you disconnect from database every time you must follow the step (3, 4) to connect again.

When Oracle Application Express installs, it creates three new database accounts:

  • • APEX_040100 - The account that owns the Oracle Application Express schema and metadata.
  • • FLOWS_FILES - The account that owns the Oracle Application Express uploaded files.
  • • APEX_PUBLIC_USER - The minimally privileged account used for Oracle

When installation is finished it shows message like flowing image


In a new installation of Oracle Application Express, you must change the password of the internal ADMIN account. To changes password connect to database again and run the flowing command

SQL> @apxchpwd

When prompted enter a password for the ADMIN account. It should be complex password like abcd#1234

Also you need to unlock APEX_PUBLIC_USER. To unlock account execute the following command

ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;

ALTER USER APEX_PUBLIC_USER IDENTIFIED BY new_password;

Configuring the embedded PL/SQL gateway

To Configuring the embedded PL/SQL gateway run apex_epg_config.sql passing the file system path to the base directory where the Oracle Application Express software was copied after unzipped as shown in the following example:

SQL> @apex_epg_config system_drive:\temp

In my case it is SQL> @apex_epg_config C:\

Then, you need to unlock the ANONYMOUS account.

ALTER USER ANONYMOUS ACCOUNT UNLOCK;

Enable Oracle XML DB HTTP server:

SQL> exec dbms_xdb.sethttpport(8080);

SQL> commit;

to make sure the port is set to 8080 run the following statement

select all DBMS_XDB.GETHTTPPORT() from dual

You could also check the following statement

select all t.status from dba_registry t where ( ( t.comp_id = 'APEX' )) expect VALID;

Unlock some users which are related to apex (anonymous, apex_030200, apex_040100, apex_public_user

How to Uninstall Oracle Application Express

Open Command Prompt. change your working directory to the apex folder where it was installed then connect to the database

sqlplus /nolog press enter

conn sys@xe as sysdba

here XE is database name.

SQL>@apxremov.sql

After completed the process Remove the apex folder from the drive

Browse Apex from Your PC

Open a browser (firefox/Explorer etc). Write the URL: http://host:port/apex (eg: http://blackhorse:8080/apex)
Your default workspace is- internal
user name is- admin
password is- admin user password which you changed at step 5

I hope it will help you to understand how to install and uninstall oracle application express

If you have any query\comment please leave it in comment box. I'll be very pleased to reply you. Thank you.