Oracle Apex 21 install in Oracle 19c Database (pluggable) and Oracle Linux
Oracle Application Express (APEX) is a low-code development platform that enables you to build scalable, secure enterprise apps, with world-class features, that can be deployed anywhere. Here are the step by step instructions to install Oracle Apex 21.2 on Windows and Unix/Linux systems.
- Oracle Apex Installation Requirements
- Oracle Application Express release 21.1 requires
- an Oracle Database release 19c or later,
- OS Windows 10 / Linux
Here are the steps to install Oracle Application Express release 21.2.
Step 1 Downloading Apex Software from online
First of all, you need to download the latest version oracle apex software (I used Oracle APEX 21.2 - All languages ) from following link -
https://www.oracle.com/tools/downloads/apex-downloads.html
Step 2 Unziping on specific location
After downloading, we need to unzip on a specific folder. In linux, preferable location is /opt/oracle/apex
Step 3 Connecting database from Apex directory
Open terminal and change directory to /opt/oracle/apex
Cd /opt/oracle/apex Sqlplus /nolog Connect sys as sysdba; Enter
Step 4 Altering session to PDB database
if you want to install apex unser specific PDB, you need to alter the session. If not exist PDB, you need to create PDB at first and then alter session for that PDB:
To create PDB, please follow the link: How to Create New Pluggable Databases in Oracle 19c
Simple step to create PDB
Create a folder:
mkdir /u01/app/oracle/oradata/TECHNOLOGY/apexpdb/
Execute the following query when you are connected in a CDB:
CREATE PLUGGABLE DATABASE apexpdb ADMIN USER apexpdbadmin IDENTIFIED BY ApxPD#123
FILE_NAME_CONVERT = ('/u01/app/oracle/oradata/TECHNOLOGY/pdbseed/', '/u01/app/oracle/oradata/TECHNOLOGY/apexpdb/');
// open mounted database
alter pluggable database apexpdb open;
// session set
alter session set container = apexpdb;
Step 5 Creating tablespace for Apex metadata
You can create tablespace for apexpdb by executing the following query.
Create Tablespace tbs_apexpdb logging datafile '/u01/app/oracle/oradata/TECHNOLOGY/TBS_APEXPDB.DBF' size 1024m autoextend on next 64m maxsize 5G extent management local;
Step 6 Installing apex
Before installing the apex command, you must connect the database from the apex: /opt/oracle/apex directory.
Syntax:
@apexins.sql tablespace_apex tablespace_files tablespace_temp images
Description:
- tablespace_apex is the name of the tablespace for the Oracle Application Express application user. In our case tbs_apexpdb
- tablespace_files is the name of the tablespace for the Oracle Application Express files user. In our case TBS_APEXPDB
- tablespace_temp is the name of the temporary tablespace or tablespace group. In our case temp
- images is the virtual directory for Oracle Application Express images.To support future Oracle Application
Express upgrades, define the virtual image directory as /i/.
So execute
SQL> @apexins.sql tbs_apexpdb TBS_APEXPDB temp /i/
After successfully complete, you see output like this-
…………………………
Thank you for installing Oracle Application Express 21.2.0 Oracle Application Express is installed in the APEX_210200 schema. The structure of the link to the Application Express administration services is as follows: http://host:port/ords/apex_admin The structure of the link to the Application Express development interface is as follows: http://host:port/ords
Next Steps:
1. Create your Instance Administration Account
Run the apxchpwd.sql script
2. Configure the APEX_PUBLIC_USER Account
See the Installation Guide for details
3. Configure RESTful Services
Run the apex_rest_config.sql script
timing for: Phase 3 (Switch)
Elapsed: 00:00:09.75
timing for: Complete Installation
Elapsed: 00:10:12.41
………………
According to Apex success message, we have to follow 3 steps
1. Create your Instance Administration Account
Run the apxchpwd.sql script
2. Configure the APEX_PUBLIC_USER Account
See the Installation Guide for details
3. Configure RESTful Services
Run the apex_rest_config.sql script
When Application Express installs, it creates the following database accounts:
- APEX_210200 - This account owns the Application Express schema and metadata. (This name might differ based on Apex version)
- FLOWS_FILES - This account owns the Application Express uploaded files.
- APEX_PUBLIC_USER - This minimally privileged account is used for Application Express configuration with Oracle REST Data Services or Oracle HTTP Server and mod_plsql.
If you configured RESTful Web services, then these additional accounts will be created:
- APEX_INSTANCE_ADMIN_USER - A minimally privileged account used for the REST
- APEX_REST_PUBLIC_USER - The account used when invoking RESTful Services definitions stored in Oracle Application Express.
- APEX_LISTENER - The account used to query RESTful Services definitions stored in Oracle Application Express.
If you are upgrading from a previous release, then FLOWS_FILES already exists and
- APEX_PUBLIC_USER is created if it does not already exist.
Step 6 Changing Apex Instance Administrator password
What Is an Instance Administrator?
Instance administrators are superusers that are responsible for managing an entire Oracle Application Express instance, including managing workspace provisioning, configuring features and instance settings, and managing security.
-Change your working directory to the apex directory where you unzipped the installation software.
-Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role
Then execute : @apxchpwd.sql admin - enter Email - enter Password: ApxPD#123 (same as PDB which will helpful to remember)
Output like:
======================================================================== This script can be used to change the password of an Application Express instance administrator. If the user does not yet exist, a user record will be created. ======================================================================== Enter the administrator's username [ADMIN] User "ADMIN" does not yet exist and will be created. Enter ADMIN's email [ADMIN] Enter ADMIN's password [] Created instance administrator ADMIN.
Step 7 Configuring the APEX_PUBLIC_USER Account
Unlock and change password of user – APEX_PUBLIC_USER
SQL> ALTER USER APEX_PUBLIC_USER IDENTIFIED BY ApxPD#123 account unlock ;
*Note to remember: Password might expire in 180 days, so need a separate profile with a never expire password then assigned to this user.
----------------------------Apex software Installation completed--------------------------
Now need to Install ORDS to run the application and (this is must from APEX 20 onwards)
Step 8 Configuring Oracle RESTful Services (ORDS)
In a new installation of Oracle Application Express, you must run the configuration script apex_rest_config.sql to configure RESTful Services.
SQL>@apex_rest_config.sql
APEX_LISTENER - ApxPD#123
Insert password ApxPD#123 for APEX_LISTENER and and APEX_REST_PUBLIC_USER
Output:
...set_appun.sql ...setting session environment ...create APEX_LISTENER and APEX_REST_PUBLIC_USER users ...grants for APEX_LISTENER and ORDS_METADATA user
When Prompted, enter a password for the APEX_LISTENER and APEX_REST_PUBLIC_USER accounts.
When configuring RESTful Services in Oracle Application Express, it creates two new database accounts.
- APEX_LISTENER - The account used to query RESTful Services definitions stored in Oracle Application Express.
- APEX_REST_PUBLIC_USER - The account used when calling RESTful Services definitions stored in Oracle Application Express.
Step 8 Unlock all below users if they are locked and change password if you forgot
ALTER USER APEX_LISTENER IDENTIFIED BY ApxPD#123 ACCOUNT UNLOCK; ALTER USER APEX_PUBLIC_USER IDENTIFIED BY ApxPD#123 ACCOUNT UNLOCK; ALTER USER APEX_REST_PUBLIC_USER IDENTIFIED BY ApxPD#123 ACCOUNT UNLOCK;
……………
ORDS Installation …………………
What is ORDS?
ORDS offers you the power to publish a REST API for your information residing in the database. ORDS makes it simple to develop a REST interface/service for relative information. This comparative information is often held on either Associate in Nursing Oracle information, Associate in Nursing Oracle 12c JSON Document Store, or Associate in Nursing Oracle NoSQL information.
ORDS could be a java-based utility employed to wrap your information DML operative with web-service like GET, PUT, POST, etc., and result in a JSON format.
In general, the standalone APEX installation for the PDB is recommended.
Regarding ORDS see https://www.jadeglobal.com/blog/ords-oracle-rest-data-services
Download ORDS
Download the file ords.zip from the Oracle REST Data Services page.
https://www.oracle.com/database/technologies/appdev/rest-data-services-downloads.html
SELECT DBMS_XDB.gethttpport FROM DUAL; EXEC DBMS_XDB.sethttpport(0); ALTER USER APEX_PUBLIC_USER IDENTIFIED BY Apex123 ACCOUNT UNLOCK;
ORDS installation
java -jar ords.war