Thursday, July 4, 2024

Installing Oracle 23ai Database and APEX 24ai

Everyone is jumping on the AI bandwagon, including Oracle who have just released Oracle Database 23ai and APEX 24ai.

In this post I'll go over the steps to install Oracle Database 23ai and APEX 24ai but won't touch on the AI features, I'll save that for another post.

I'll be installing into a VM; I use Proxmox, a really good alternative to VMWare ESXi. If you have an old box around I'd recommend setting it up, it's really useful as a lab.

I used OEL 8 from here: https://yum.oracle.com/oracle-linux-isos.html

I tried OEL9 but had issues, so I wouldn't recommend it.

Oracle 23ai Free from here: https://www.oracle.com/database/free/get-started/

Oracle APEX 24ai: https://www.oracle.com/tools/downloads/apex-downloads/

You will also need ORDS. I tried the latest ORDS but couldn't get it to work, so used a previous version: https://download.oracle.com/otn_software/java/ords/ords-23.4.0.346.1619.zip

So, install OEL8 to a VM, then login to it and download the database, apex and ords.

Navigate to the download directory, make sure you are root and install the database

dnf install -y oracle-database-free*



This will install all the pre-requisites as well. Next, run the configure step.

/etc/init.d/oracle-free-23ai configure

It will prompt for a password, give it one. It will then run through the steps to install and create the database.


For some reason this process doesn't create the oracle user properly, so as root, create a home directory for oracle and set a password

mkdir /home/oracle

chown oracle:oinstall /home/oracle

passwd oracle

Once installed, login as the oracle user and use the default pdb. It creates one called FREEPDB1 so you can use that.

. oraenv

FREE

sqlplus / as sysdba

show pdbs


You can either use SYSAUX for the APEX files, or create 2 tablespaces - APEX and FILES.

For simplicity here I'll use SYSAUX.

I like to create a directory in /tmp and work from that so I know where everything is

as the oracle user

mkdir /tmp/apex
mkdir /tmp/apex/ords

Then as root:

cd /home/andy/Downloads
cp apex* /tmp/apex
cp ords* /tmp/apex/ords
chown oracle:oinstall /tmp/apex/*
chown oracle:oinstall /tmp/apex/ords/*


Log back in as oracle and cd to the /tmp/apex directory and unzip the apex file.

It will create an APEX directory. Navigate to that and set the environment and sqlplus.

cd apex
. oraenv
FREE
export ORACLE_PDB_SID=FREEPDB1
sqlplus / as sysdba
show con_name


Run the command to install apex

@apexins sysaux sysaux temp /i/

It will take around 7-10 minutes to run

Once that's done, run the command to set the password.

@apxchpwd

Let the username and email default, enter a password which needs to be complex (like Welcome#123).


Next, run apex_rest_config - enter the Welcome#123 password again for the APEX_LISTENER and the APEX_REST_PUBLIC_USER accounts.

You also need to unlock and set the password for these accounts:


You don't need to change the router one.

alter user apex_listener identified by Welcome#123 account unlock;
alter user apex_rest_public_user identified by Welcome#123 account unlock;
alter user apex_public_user identified by Welcome#123 account unlock;
alter user apex_240100 identified by Welcome#123 account unlock;


Exit from SQLPlus and cd to the ords directory and extract the ords zip file.

You need to make sure the JAVA executable is in your path:

export PATH=$ORACLE_HOME/jdk/bin:$PATH
export JAVA_HOME=$ORACLE_HOME/jdk
which java
java -version


Copy the images folder from the apex folder to the ords folder.


Run the command to install ords

java -jar ords.war install

Ignore the warning and follow the prompts. At the first prompt, let it default to 2.


At the second prompt, let it default to 1


Let it default to localhost, then 1521.

At the service name, you need to enter FREEPDB1


Enter sys at the next prompt, and the sys password


It will connect to the database, let the rest default by hitting Enter.


Let the next prompts default to 1 (Standalone, http, 8080)


This next prompt is important - you need to enter the location of the copied images directory. If you followed this guide, it will be

/tmp/apex/ords/images


The ORDS install will start.

Ignore the warnings about a production environment, you should see this


Don't exit from this terminal session or ORDS will stop and you won't be able to connect to APEX.

Open a browser and go to 

http://localhost:8080/ords/apex_admin

You should see this


Login with admin / Welcome#123 (or whatever you used for the ADMIN password).


In the next APEX post I'll look at creating a sample app and using the AI features.