Oracle APEX Installation Documentation


Contents of this Documentation are:
APEX Installation & Configuration
Installing Oracle REST Data Services
Deploying ORDS with Tomcat

APEX Installation & Configuration

Downloading and Installing Oracle Application Express

To install Oracle Application Express:

  1. Download Oracle Application Express ZIP file from download Page

    For installations where the development will be in English only, download the file apex_18.2_en.zip. If the development will include languages other than English, download apex_18.2.zip file.

  2. Unzip downloaded zip file to your local directory. for example C:/ .

  3. Open your command line tool and Change your working directory to the directory on whcih you unzip APEX file. in our Case C:\APEX.

      C:\Users\user>cd ..   
          C:\Users>cd .. 
          C:> cd apex
          C:\apex

  4. Open SQL*Plus from the command tool and connect to the database as sysdba. Another way is to start SQL*Plus in APEX directory.

          C:\apex>sqlplus sys as sysdba
          Enter password: SYS_password
          SQL>
  5. Select the appropriate installation option.

    You have two choices: Full development environment and Runtime environment

    Full development environment provides complete access to the App Builder environment to develop applications. A Runtime environment enables users to run applications that cannot be modified.

    • Full development environment.

    • Run The apexins.sql file with its four arguments:

      SQL>@apexins.sql tablespace_apex tablespace_files tablespace_temp images 

      Where:

      • tablespace_apex is the name of the tablespace for the Oracle Application Express application user.
      • tablespace_files is the name of the tablespace for the Oracle Application Express files user.
      • tablespace_temp is the name of the temporary tablespace or tablespace group.
      • images is the virtual directory for Oracle Application Express images. For installations using EPG, /i/ is the required value for the images argument. To support future Oracle Application Express upgrades, define the virtual image directory as /i/.

      Example:

      SQL>@apexins.sql SYSAUX SYSAUX TEMP /i/

    Runtime environment.

    • Run The apxrtins.sql file with its four arguments as described above.

      Example:

      SQL>@apxrtins.sql SYSAUX SYSAUX TEMP /i/
  6. After the installation is completed reconnect again to the database using SQL*Plus using sys as sysdba and run the below commands.

          C:\apex>sqlplus sys as sysdba
          Enter password: SYS_password
          SQL>

    Note

    If you install Oracle APEX 20.2 or later, skip running the code below and move to Step 7. EPG is not supported from 20.2 and later  !!

    Run apex_epg_config.sql passing the file system path to the base directory where the Oracle Application Express software was unzipped as shown in the following example:

     SQL>@apex_epg_config.sql C:

    where C: is the base directory where the Oracle Application Express software was unzipped.

  7. Run the apxchpwd.sql script to create and update APEX Instance Administrator account. For example:

    SQL>@apxchpwd.sql
          Enter the administrator's username [ADMIN]
          Enter ADMIN's email [ADMIN]
          Enter ADMIN's password []type the password here
        
  8. Configuring the APEX_PUBLIC_USER Account.

    The APEX_PUBLIC_USER Account is created with a random password in a new installation of Oracle Application Express. So, you must change the password and unlock the account. For Example:

    SQL>ALTER USER APEX_PUBLIC_USER IDENTIFIED BY new_password  ACCOUNT UNLOCK;

    Also, unlock the Anonymous account as below.

    SQL>ALTER USER ANONYMOUS ACCOUNT UNLOCK;

The next step is to install ORDS.


Installing Oracle REST Data Services

In previous section, we describe how to install Oracle Application Express in a on-premises (or local) installation. In this section, we will describe how to deploy Oracle Application Express on a Web server using Oracle REST Data Services (ORDS).

This section will contains the following topics:

Installation Prerequisites

Before Installing Oracle REST Data Services, you have to be sure that the following prerequisites are already installed:

  1. Oracle Database at least 11.2.0.4 or later. Or you can install Oracle XE version 11 or later.

  2. Oracle Application Express version 18.2 or later.

  3. Java JDK package. you can download it from Download site.

Installing Oracle REST Data Services

To Install Oracle REST Data Services:

  1. Download the latest release of Oracle REST Data Services from the following site:
  2. http://www.oracle.com/technetwork/developer-tools/rest-data-services/downloads/index.html
  3. Unzip the downloaded zip file into a directory (or folder) of your choice:
    • Create a folder in a local drive. For example: C:\ORDS

    • Unzip ords.war file from the downloaded zip file to the folder C:\ORDS.

    • Create sub-folder in C:\ORDS folder and give it a name (For example: conf) for the purpose of storing the configuration of ORDS.

  4. Grant full control permisions to USERS and ALL APPLICATION PACKAGES on Java JDK path:
    • Go to Java JDK path For example:

      C:\Program Files\Java\jdkx.x.x

      where x.x.x is the version of the JDK.

    • In the directory path, you will find a folder named bin . Right click on bin and go to Security tab and click on Edit and grant full control to USERS and ALL APPLICATION PACKAGES groups.
  5. Add Java path to system environment:

    • Right click on Computer icon.

    • Click on Advanced System Settings

    • Click on Environment Variables

    • Under User Variables add new variable and give it a name of JAVA_HOME and the value must be Java JDK path for example: C:\Program Files\Java\jdkx.x.x\bin

      where x.x.x is the version of the JDK.

  6. Open the command line tool and change the directory to the JAVA_PATH (the path you set in step 4). For example:

      C:\Users\user>cd C:\Program Files\Java\jdkx.x.x\bin  
          C:\Program Files\Java\jdkx.x.x\bin>
  7. Now we get the environment ready to install ORDS. To install ORDS follow the steps below:

    • Install ords.war by running the command java -jar ORDS.WAR PATH. In our case, it is C:\ords\ords.war For example:

      C:\Program Files\Java\jdkx.x.x\bin>java -jar C:\ords\ords.war

      after this command, we have to complete the following prompts

    • The location to store configuration data. In our case it is: C:\ords\conf as created in step 2. For example:

      C:\Program Files\Java\jdkx.x.x\bin>java -jar C:\ords\ords.war
          Enter the location to store configuration data:C:\ords\conf
    • The database server, port and service/SID. as shown below

      C:\Program Files\Java\jdkx.x.x\bin>java -jar C:\ords\ords.war
          Enter the location to store configuration data:C:\ords\conf
          Enter the name of the database server [localhost]:
          Enter the database listen port [1521]:
          Enter 1 to specify the database service name, or 2 to specify the database SID [1]:
          Enter the database service name:orcl

      In above prompts we choose default options for Database server as localhost, default port 1521 and default Service/SID 1 and type the service name which is in our case: orcl.

    • Install Oracle REST Data Services schema

      C:\Program Files\Java\jdkx.x.x\bin>java -jar C:\ords\ords.war
          Enter the location to store configuration data:C:\ords\conf
          Enter the name of the database server [localhost]:
          Enter the database listen port [1521]:
          Enter 1 to specify the database service name, or 2 to specify the database SID [1]:
          Enter the database service name:orcl
          Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]:1
          Enter the database password for ORDS_PUBLIC_USER:password 
          password:password 
    • Provide sys password in order to install Oracle REST Data Services schema:

      C:\Program Files\Java\jdkx.x.x\bin>java -jar C:\ords\ords.war
          Enter the location to store configuration data:C:\ords\conf
          Enter the name of the database server [localhost]:
          Enter the database listen port [1521]:
          Enter 1 to specify the database service name, or 2 to specify the database SID [1]:
          Enter the database service name:orcl
          Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]:1
          Enter the database password for ORDS_PUBLIC_USER:
          Confirm password:
          Requires to login with administrator privileges to verify Oracle REST Data Services schema.
          
          Enter the administrator username:sys
          Enter the database password for SYS AS SYSDBA:sys_password
          Confirm password:sys_password 
      
           Connecting to database user: SYS AS SYSDBA url: jdbc:oracle:thin:@//localhost:1521/xe
      
          Retrieving information.
          Enter the default tablespace for ORDS_METADATA [SYSAUX]:SYSAUX
          Enter the temporary tablespace for ORDS_METADATA [TEMP]:TEMP
          Enter the default tablespace for ORDS_PUBLIC_USER [USERS]:USERS
          Enter the temporary tablespace for ORDS_PUBLIC_USER [TEMP]:TEMP
          
    • Specify passwords for the users: APEX_PUBLIC_USERAPEX_LISTENERAPEX_REST_PUBLIC_USER as shown below:

      C:\Program Files\Java\jdkx.x.x\bin>java -jar C:\ords\ords.war
          Enter the location to store configuration data:C:\ords\conf
          Enter the name of the database server [localhost]:
          Enter the database listen port [1521]:
          Enter 1 to specify the database service name, or 2 to specify the database SID [1]:
          Enter the database service name:orcl
          Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]:1
          Enter the database password for ORDS_PUBLIC_USER:
          Confirm password:
          Requires to login with administrator privileges to verify Oracle REST Data Services schema.
          
          Enter the administrator username:sys
          Enter the database password for SYS AS SYSDBA:sys_password 
          Confirm password:sys_password
           Connecting to database user: SYS AS SYSDBA url: jdbc:oracle:thin:@//localhost:1521/xe
      
          Retrieving information.
          Enter the default tablespace for ORDS_METADATA [SYSAUX]:SYSAUX
          Enter the temporary tablespace for ORDS_METADATA [TEMP]:TEMP
          Enter the default tablespace for ORDS_PUBLIC_USER [USERS]:USERS
          Enter the temporary tablespace for ORDS_PUBLIC_USER [TEMP]:TEMP
          
      Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step. If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]: 1 Enter the PL/SQL Gateway database user name [APEX_PUBLIC_USER]: Enter the database password for APEX_PUBLIC_USER:Password Confirm password:Password Enter 1 to specify passwords for Application Express RESTful Services database users (APEX_LISTENER, APEX_REST_PUBLIC_USER) or 2 to skip this step [1]: 1 Enter the database password for APEX_LISTENER:Password Confirm password:Password Enter the database password for APEX_REST_PUBLIC_USER:Password Confirm password:Password Enter a number to select a feature to enable: [1] SQL Developer Web (Enables all features) [2] REST Enabled SQL [3] Database API [4] REST Enabled SQL and Database API [5] None Choose [1]:1

      Note

      Keep the passwords you specify above and the password you specify for ORDS_PUBLIC_USER for we will need them in next steps.


    • Choose Web Server mode. In our case we will use Tomcat, so we will specify 2.

      C:\Program Files\Java\jdkx.x.x\bin>java -jar C:\ords\ords.war
          Enter the location to store configuration data:C:\ords\conf
          Enter the name of the database server [localhost]:
          Enter the database listen port [1521]:
          Enter 1 to specify the database service name, or 2 to specify the database SID [1]:
          Enter the database service name:orcl
          Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]:1
          Enter the database password for ORDS_PUBLIC_USER:
          Confirm password:
             Requires to login with administrator privileges to verify Oracle REST Data Services schema.
          
          Enter the administrator username:sys
          Enter the database password for SYS AS SYSDBA:sys_password
          Confirm password:sys_password
           Connecting to database user: SYS AS SYSDBA url: jdbc:oracle:thin:@//localhost:1521/xe
      
          Retrieving information.
          Enter the default tablespace for ORDS_METADATA [SYSAUX]:SYSAUX
          Enter the temporary tablespace for ORDS_METADATA [TEMP]:TEMP
          Enter the default tablespace for ORDS_PUBLIC_USER [USERS]:USERS
          Enter the temporary tablespace for ORDS_PUBLIC_USER [TEMP]:TEMP
          
      Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step. If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]: 1 Enter the PL/SQL Gateway database user name [APEX_PUBLIC_USER]: Enter the database password for APEX_PUBLIC_USER:Password Confirm password:Password Enter 1 to specify passwords for Application Express RESTful Services database users (APEX_LISTENER, APEX_REST_PUBLIC_USER) or 2 to skip this step [1]: 1 Enter the database password for APEX_LISTENER:Password Confirm password:Password Enter the database password for APEX_REST_PUBLIC_USER:Password Confirm password:Password Enter a number to select a feature to enable: [1] SQL Developer Web (Enables all features) [2] REST Enabled SQL [3] Database API [4] REST Enabled SQL and Database API [5] None Choose [1]:1
      Enter 1 if you wish to start in standalone mode or 2 to exit [1]: 2
    • Configuring Oracle Application Express Images. Use the static command to create a web archive file named i.war .

      java -jar ords.war static [apex directory]\images

      In our case [apex directory] is C:/apex. The command will be:

      C:\Program Files\Java\jdkx.x.x\bin>java -jar C:\ords\ords.war static C:\apex\images
  8. Configure RESTful Services in Oracle Application Express:

    • Open your command line tool and Change your working directory to the directory on which you unzip APEX file. in our Case C:\APEX.

        C:\Users\user>cd ..   
            C:\Users>cd .. 
            C:> cd apex
            C:\apex

    • Open SQL*Plus from the command tool and connect to the database as sysdba. Another way is to start SQL*Plus in APEX directory.

            C:\apex>sqlplus sys as sysdba
            Enter password: SYS_password
            SQL>
    • Run apex_rest_config.sql. For example:

      SQL>@apex_rest_config.sql
  9. Change the passwords for the users: APEX_PUBLIC_USERAPEX_LISTENERAPEX_REST_PUBLIC_USER and ORDS_PUBLIC_USER as the passwords you specified in step 6 and unlock the accounts as well. For example:

    SQL> alter user APEX_PUBLIC_USER identified by password account unlock;
        User altered
        SQL> alter user APEX_LISTENER identified by password account unlock;
        User altered
        SQL> alter user APEX_REST_PUBLIC_USER identified by password account unlock;
        User altered
        SQL> alter user ORDS_PUBLIC_USER identified by password account unlock;
        User altered
        


Deploying ORDS

After Installing ORDS, now we will deploy the ords.war to a web server, Apache Tomcat, in this section.

This section Contains the following topics:

Installing the Apache Tomcat

To Install Apache Tomcat:
  1. Download the latest release of Apache Tomcat, Windows Installer, from the download site:

  2. https://tomcat.apache.org/download-90.cgi

  3. Install Apache Tomcat windows installer:

    • Launch the exe installer you downloaded and click Nexttomcat-01

    • Read the terms of agreement and click I Agreetomcat-02

    • click on Nexttomcat-03

    • In this Screen, be sure to change HTTP/1.1 Connector Port from its default value 8080 to another value. In our case, changed to 9090. Also, specify Tomcat Administrator Login Username & Password:tomcat-04

    • click on Nexttomcat-05

    • click on Installtomcat-06

    • click on Finishtomcat-07

Deploying ORDS to Apache Tomcat

To deploy ords.war to the web server:

  1. Go to ORDS path in which you install ords. In our case: C:\ords.

  2. Copy ords.war file to the Web server webapps folder:

    Apache Tomcat Directory\webapps
    For example: go to C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps and paste the ords.war file in this path.

  3. Go to APEX Images path inside APEX installation folder. In our case: C:\apex\images.

  4. Inside Web server webapps folder, create a new folder and name it i.

  5. Copy all images folder contents to the folder inside webapps folder you created in previous step:

    Apache Tomcat Directory\webapps\i
    For example: go to C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\i and paste the images contnts in this path.

  6. Restart Apache Tomcat Service:

    • Go to Apache Tomcat Directory\bin and open TomcatXw.

      where X is the version of Apache Tomcat installed.

      Example:

      • In our case, go to: C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\bin and open Tomcat9w.exe execution file.
      • Click on Stop then click on Start or click on Start if it is already stopped.

      • tomcat-stop

      • tomcat-start.

  7. You can now open Oracle Oracle Application Express using Oracle REST Data Services using the url:

    http://Host:Web server port/ords.war file name/
    Where:
    • Host: is the host on which you installed Oracle APEX. It can be the machine name or IP address. In our case we will use localhost.
    • Web server port: is the port of the installed web server. In our case it is 9090 as configured during Tomcat installation.
    • ords.war file name: is the name of ords.war file. In our case it is: ords.

    Example:

    http://localhost:9090/ords


Comments

Popular posts from this blog

Solve ORDS was unable to make a connection to the database

APEX PDF Printing using Oracle Reports RDF Files