Installing and Configuring Oracle Database 23ai


Oracle Database 23ai, rebranded from Oracle 23c, is the newest long-term support release from Oracle. It brings over 300 new features that include, but are not limited to, AI Vector Search, SQL Firewall, True Cache, and other schema enhancements. You can learn more here.
This tutorial takes you first through Installing Oracle Linux 9.4 on a VMware Workstation 17 Player instance. Then, Oracle 23ai database will be installed and configured. Lastly, an existing schema will be installed that will allow you to go through basic Oracle database statements. This guide assumes you have the minimal PC hardware requirements and working knowledge of the command-line interface.
Prerequisites
Minimal PC Hardware Requirements
RAM: 2 GB RAM - recommended
Hard Disk Space: At least 20GB of empty space. 40GB is recommended.
A minimum of 2 logical CPUs
Processor: Based on either Intel EM64T or AMD64 architecture
At least 1024 x 768 display resolution
VMware Workstation 17 Player or VirtualBox - This guide uses VMware Workstation 17 Player. Note that obtaining VMware is now done through Broadcom. Please follow their steps to download it. If it proves to be too much of a struggle, VirtualBox is definitely a good alternative.
Working knowledge of the command-line interface (terminal)
Installation Steps
Install and Configure an Oracle Linux 9 VM instance.
System Preparation
Database 23ai Installation
Default Schema Installation
Basic commands
Uninstall steps
Step 1: Install and Configure Oracle Linux 9
First, you need to download the .iso file. Navigate to https://yum.oracle.com/oracle-linux-isos.html
Click the .iso file under Full ISO for the 9.4 Release.
The file will start downloading
Open VMware (or Virtualbox).
Click on ‘Create a New Virtual Machine’. You can also navigate to Player > File > New Virtual Machine.
Choose ‘Installer disk image file (iso)’. Select Browse and select the location where you downloaded the Oracle Linux iso. Click ‘Next’.
Enter a name for the virtual machine, then choose the drive path where you want the VM instance to reside. Click ‘Next’.
Change the maximum disk size to your preferred size and select ‘Store virtual disk as a single file’.
Click on ‘Customize Hardware’. You can leave ‘Power on this virtual machine after creation’ checked.
Under Memory, move the blue arrow to ‘4GB’, or your preferred memory amount.
Select Processors and choose the number of processor cores to dedicate to the VM. You can keep the default of 2 or change it as needed.
Click on ‘Network Adapters’ and choose Bridged under Network Connection. Also make sure that ‘Connected’ and ‘Connect at power On’ are checked under Device Status. Click OK when finished.
Navigate back to the VMware default screen. Click the newly created VM and select ‘Play virtual machine’.
Upon successful startup, you will be met with the installer screen. Use the up-arrow key to navigate to and choose ‘Install Oracle Linux 9.4.0.’
Select the appropriate language and click ‘Continue’.
Click on ‘Installation Destination’
Select the disk that Oracle 9 will be installed on. You may need to click on it twice. (In cases like this, where it is installed locally, it will be the location you chose in step 7). Click ‘Done’ when finished.
Select ‘Root Password’ under User Settings.
Uncheck ‘Lock root account’ and enter in a password to use for the root account.
Back under User Settings click on ‘User Creation’. The Create User window will appear. Enter in a Full name (does not have to be your name) and an User name. Ensure that ‘Make this user administrator’ is checked. Enter a password for the user. When you are finished, click ‘Done’.
Optional – Back at the default install screen Click on ‘Kdump’ and disable it.
Confirm your settings and click ‘Begin Installation’.
The installation will begin.
Upon successful installation, you will receive notification that it is complete. Click on ‘Reboot System’.
Upon successful reboot the login screen will appear. Login with your username and password.
Now that you have Oracle Linux 9 installed and configured, it’s time to set up the system for the installation and configuration of Oracle Database 19c (RPM).
Step 2: Configure the System
Before the database is installed, some configurations to the system need to be performed to ensure proper functionality when installing and interacting with the database.
To begin, make sure the system is up to date - enter the ‘sudo yum update’ command. Confirm what is being installed and click ‘y’ at the prompt(s).
Once the updates are complete, reboot the system using ‘sudo systemctl reboot’ and log back in.
Now, you need to configure the network.
Click on the network icon in the top right corner of the display. Click on ‘Wired Settings’.
Take note of the IPV4 address and DNS information.
Click on the IPV4 tab, then select the ‘Manual’ method. Fill in the Address, Netmask, Gateway and DNS information from the previous step.
Go back to the default Network window and toggle the Wired connection slider off and then on again. Ensure the wired connection is changed and established.
Enter the ‘hostnamectl set-hostname’ command to set a hostname; this will allow ease of identification and configuration over the network.
Now, you need to add the hostname to the /etc/hosts file. Open it with a text editor such as nano or vim.
Set the correct IP and hostname. Save the file when finished.
Open the /etc/selinux/config file.
Navigate to and change the line that reads SELINUX=enforcing to permissive. Save it when done.
Enter the ‘setenforce Permissive’ command and then use ‘getenforce’ to confirm the change.
The Linux firewall is usually enabled by default. This will need to be disabled to ensure proper installation and functionality of the database. Disable the Linux firewall by entering the ‘systemctl stop firewalld’ command, then ‘sudo systemctl disable firewalld’.
Enter the ‘systemctl status firewalld’ command to confirm it is disabled.
Now that the system and network have applicable configuration, you will run and install the Database Preinstallation.
Step 3: Install Oracle 23ai Database
Log in as root
Enter the command -’sudo dnf -y install oracle-database-preinstall-23ai’- to install the Oracle Database Preinstall RPM Package. This automatically downloads and installs any needed RPM packaged, settings, parameters, an oracle user and applicable groups for the user.
Change to the /tmp directory.
Download and Install the 23ai software using the following command – sudo yum install -y https://download.oracle.com/otn-pub/otn_software/db-free/oracle-database-free-23ai-1.0 -1.el9.x86_64.rpm’.
Once successfully downloaded and installed you will receive a message that it is ‘Complete!’
(Optional) Confirm the presence of and review the RPM log file.
Confirm the presence of the ORACLE_HOME path.
Step 4: Create and Configure the Oracle Database
Execute the configuration script as shown below. This creates a container database (FREEPDB1) with one pluggable database and configures the listener (default port 1521). These parameters can be modified by editing the oraclefree-23ai.conf file.
Create and confirm a password for the database.
You will receive a message that the installation is complete. The database and listener are automatically started after the configuration is complete.
(Optional) The configuration parameters can be modified by editing the oraclefree-23ai.conf file.
/etc/sysconfig/oracle-free-23ai.conf
Set a password for the oracle user.
Switch to the Oracle user account
Open the .bash_profile file
Edit the file with the code below to configure specific environment variables.
export ORACLE_SID=FREE
export ORACLE_HOME=/opt/oracle/product/23ai/dbhomeFree
export ORAENV_ASK=NO
export PATH=$ORACLE_HOME/bin:$PATH
Reload the profile.
Confirm the presence of the $ORACLE_HOME path
Check and confirm the status of the listener
Step 5: Connect to the Database
Connect to the pluggable database with the SYS user. (sqlplus sys@localhost:1521/FREEPDB1 as sysdba)
Enter the password you created earlier for the database.
Use the ‘show pdbs command to view the PDB(s).
Use the ‘alter session set container = FREEPDB1’; statement to switch to the FREEPDB1 database.
If at any time you want to exit the database se the ‘exit’ command.
Step 5: Install a Sample Schema
In this section you will install the HR sample schema. This will allow you to explore Oracle database commands further.
Switch to the /tmp directory
The sample schema you will be installing is available at Github. Use ‘wget https://github.com/oracle-samples/db-sample-schemas/archive/refs/tags/v23.3.zip’ to download the file to the /tmp directory.
Confirm the presence of the file using the ‘echo’ command.
Move the file into the $ORACLE_HOME/demo/schema directory
Switch to the $ORACLE_HOME/demo/schema directory
Confirm the presence of the zip file using the ‘ls’ command.
Unzip the file
Go back to your database session. Log back in if needed.
Enter the ‘@/opt/oracle/product/23ai/dbhomeFree/demo/schema/db-sample-schemas-23.3/human_resources/hr_install.sql’ command to install the HR database.
Enter a password for the HR user. Then, enter an appropriate table name for the user and type ‘yes’.
The installation will run, creating the default tables. Once complete you will be disconnected from the database.
Before you log in with the hr user, you need to edit the tnsnames.ora file. Navigate to /opt/oracle/product/23ai/dbhomeFree/network/admin and open the tnsnames.ora file
Add the following lines to the file and save it.
FREEPDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = orc-23ai.localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = freepdb1)
)
)
Connect to the HR user. You should get the following response indicating a successful connection. You are now free to navigate the database, create a table or perform other SQL functions. A guide on entering and executing using SQL*Plus statements can be found here.
Step 7: Remove Oracle 23ai
Exit out of the database session, if it’s still running.
Log in as root
Use the de-install command found in the $ORACLE_HOME/de-install directory. This process deletes Oracle Database configuration files, user data, and fast recovery area (FRA) files, even if they are stored outside the Oracle base directory path.
Or you can do a manual uninstall with the following:
Enter the ‘/etc/init.d/oracle-free-23ai delete’ command. This removes all the oracle database free files, the listener and configuration files.
Next, enter ‘yum remove oracle-database-free-23ai’. This removes the software.
(Optional) If you solely installed Oracle Database Free on your system without any additional Oracle Database software, you may also proceed to uninstall the Oracle Database pre-installation RPM.
yum remove oracle-database-preinstall-23ai
Manually delete the downloaded RPM files
Rm oracle-database-preinstall-23ai*
Rm oracle-database-free-23ai*
For a more in depth tutorial on removing Oracle 23ai see this blog.
Conclusion
I hope the steps in this guide were useful for setting up Oracle Linux 23ai on Oracle Linux 9 in a VMware environment. I authored this last year in hopes that I would have the opportunity to get it posted on a site like Digital Ocean. However, and like a few others, they have halted their writer program for the time being. So, I finally decided to post it here. :)
Have any suggestions? Please leave useful, constructive feedback
Subscribe to my newsletter
Read articles from T3chScribe directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

T3chScribe
T3chScribe
Pursuing a Masters Degree in Instructional Design. B.A.S. in Cybersecurity - 2024 Linux user since 2005. Interested in design,writing, cybersecurity, accessibility, higher ed, and database administration topics. previous hashnode blog - https://t3chscr1be.hashnode.dev/