Install Oracle Database 23AI on Oracle Linux OEL9

This article presents how to install Oracle 23AI Release on Oracle Enterprise Linux 9 (OEL9) using RPM.

Read following article how to install Oracle Enterprise Linux 9: Install Oracle Linux 9 (OEL9) (for comfort set 8G memory for your virtual machine before proceeding with Oracle software installation).

Software

Software for 23AI is available here

Original Oracle documentation for installation 23ai for Linux

Database Installation Guide for Linux(Release 23ai)

Database RPM to download

  • oracle-database-free-23ai-1.0-1.el9.x86_64.rpm

OS configuration and preparation

OS configuration is executed as root. To login as root just execute following command in terminal.

su - root

The “/etc/hosts” file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>

For example.

192.168.122.1 oel9 oel9.dbaora.com

Set hostname

hostnamectl set-hostname oel9.dbaora.com --static

It’s recommended to update OS with latest packages

dnf update

Extra preinstallation steps

Execute following command as user root

dnf install -y oracle-database-preinstall-23ai

Details about steps executed by above statement can be found in file

/var/log/oracle-database-preinstall-23ai/backup/<DATE>/orakernel.log

It will configure following things:

  • download/install required extra packages
  • configure required os groups
  • create oracle user
  • setup kernel parameters
  • setup user limits
  • change boot settings
  • network specific parameters
  • disable transparent hugepages – Refer Oracle Note:1557478.1
  • disable defrag – Refer Oracle Note:1557478.1

Install main package

Install main package

dnf -y localinstall /tmp/oracle-database-free-23ai-1.0-1.el9.x86_64.rpm

It will configure oracle binaries in directory /opt/oracle/product/23ai/dbhomeFree/

Install database

To configure Oracle Database Free, optionally modify the parameters in /etc/sysconfig/oracle-free-23ai.conf and then run /etc/init.d/oracle-free-23ai configure as root

Install database with following command where “OraclePass23” is password for user SYS,SYSTEM,PDADMIN as root user

(echo "OraclePass23"; echo "OraclePass23";) | \
/etc/init.d/oracle-free-23ai configure

Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:
Confirm the password:
Configuring Oracle Listener.
Listener configuration succeeded.
Configuring Oracle Database FREE.
Enter SYS user password:
*************
Enter SYSTEM user password:
**************
Enter PDBADMIN User Password:
**************
Prepare for db operation
7% complete
Copying database files
29% complete
Creating and starting Oracle instance
30% complete
33% complete
36% complete
39% complete
43% complete
Completing Database Creation
47% complete
49% complete
50% complete
Creating Pluggable Databases
54% complete
71% complete
Executing Post Configuration Actions
93% complete
Running Custom Scripts
100% complete
Database creation complete. For details check the logfiles at:
/opt/oracle/cfgtoollogs/dbca/FREE.
Database Information:
Global Database Name:FREE
System Identifier(SID):FREE
Look at the log file "/opt/oracle/cfgtoollogs/dbca/FREE/FREE.log" for further details.

Connect to Oracle Database using one of the connect strings:
Pluggable database: oel9.dbaora.com:1539/FREEPDB1
Multitenant container database: oel9.dbaora.com:1539

Next steps

Add following lines in /home/oracle/.bash_profile for user oracle

# Oracle Settings
export TMP=/tmp

export ORACLE_HOSTNAME=oel9.dbaora.com
export ORACLE_UNQNAME=FREE
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/23ai/dbhomeFree
export ORACLE_SID=FREE

PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

alias cdob='cd $ORACLE_BASE'
alias cdoh='cd $ORACLE_HOME'
alias tns='cd $ORACLE_HOME/network/admin'
alias envo='env | grep ORACLE'

umask 022

if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
       ulimit -u 16384 
       ulimit -n 65536
    else
       ulimit -u 16384 -n 65536
    fi
fi

envo

check environment settings as user oracle

sudo su - oracle

check environment

--I defined 4 aliases in .bash_profile of user oracle to make 
--administration easier :)

[oracle@oel9 ~]$ alias envo tns cdoh cdob
alias envo='env | grep ORACLE'
alias tns='cd $ORACLE_HOME/network/admin'
alias cdoh='cd $ORACLE_HOME'
alias cdob='cd $ORACLE_BASE'

--run alias command envo to display environment settings
[oracle@oel9 ~]$ envo
ORACLE_UNQNAME=FREE
ORACLE_SID=FREE
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/product/23ai/dbhomeFree
ORACLE_HOSTNAME=oel9.dbaora.com
--run alias command cdob and cdoh --to check ORACLE_BASE, ORACLE_HOME [oracle@oel9 ~]$ cdob [oracle@oel9 oracle]$ pwd /opt/oracle [oracle@oel9 ~]$ cdohsqlplus [oracle@oel9 db_1]$ pwd /opt/oracle/product/23ai/dbhomeFree

Verify connection

[oracle@oel9 ~]$ sqlplus / as sysdba

SQL*Plus: Release 23.0.0.0.0 - Production on Fri May 24 11:35:42 2024
Version 23.4.0.24.05
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.4.0.24.05

SQL> show parameter db_name

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string FREE
SQL> alter session set container=FREEPDB1;
Session altered.

SQL> show con_id
CON_ID
------------------------------
3

SQL> show con_name
CON_NAME
------------------------------
FREEPDB1
SQL>

Listener status

[oracle@oel9 ~]$ lsnrctl status

LSNRCTL for Linux: Version 23.0.0.0.0 - Production on 24-MAY-2024 11:38:11
Copyright (c) 1991, 2024, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel9)(PORT=1539)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 23.0.0.0.0 - Production
Start Date 24-MAY-2024 11:15:34
Uptime 0 days 0 hr. 22 min. 37 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service FREE
Listener Parameter File /opt/oracle/product/23ai/dbhomeFree/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/oel9/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel9)(PORT=1539)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "1930b48dcdeb39e6e0630f02000a5022" has 1 instance(s).
Instance "FREE", status READY, has 1 handler(s) for this service...
Service "FREE" has 1 instance(s).
Instance "FREE", status READY, has 1 handler(s) for this service...
Service "FREEXDB" has 1 instance(s).
Instance "FREE", status READY, has 1 handler(s) for this service...
Service "freepdb1" has 1 instance(s).
Instance "FREE", status READY, has 1 handler(s) for this service...
The command completed successfully

Database and listener can be quickly started stopped with following commands as root

/etc/init.d/oracle-free-23ai stop
/etc/init.d/oracle-free-23ai start

Have a fun 🙂

  Tomasz

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.