Friday, July 5, 2024

Oracle Database 23ai Free RPM Installation On Oracle Linux 9 (OL9)

Oracle Database 23ai Free RPM Installation On Oracle Linux 9 (OL9)

Oracle Database 23ai free can be installed on Oracle Linux 9 using an RPM. This article describes the RPM installation of Oracle Database 23ai free 64-bit on Oracle Linux 9 (OL9) 64-bit. The article is based on a server installation with a minimum of 2G swap and secure Linux set to permissive.

◉ Hosts File


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

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

For example.

127.0.0.1       localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.56.107  ol9-23.localdomain  ol9-23

Set the correct hostname in the "/etc/hostname" file.

ol9-23.localdomain

◉ Oracle Installation


Download the relevant RPM from download page here.

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

With the RPM file downloaded, we can install the Oracle prerequisites using the following commands as the "root" user.

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

We now install the 23ai software using the following command as the root user. This assumes the RPM file is in the "/tmp" directory.

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

The ORACLE_HOME for the software installation is "/opt/oracle/product/23ai/dbhomeFree".

◉ Create Database


In addition to the software installation, the RPM creates a script that allows us to create a demo database called "FREE", with a pluggable database (PDB) called "FREEPDB1". In the following example we set the DB_PASSWORD environment variable so we can do a silent database creation using the script.

# export DB_PASSWORD=SysPassword1

# (echo "${DB_PASSWORD}"; echo "${DB_PASSWORD}";) | /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: localhost.localdomain/FREEPDB1
     Multitenant container database: localhost.localdomain
[root@localhost yum.repos.d]#

We can of course create a database in the normal way, using the Database Configuration Assistant (DBCA). We don't have to use this script.

◉ Using It


From the "oracle" user we can connect as follows.

export ORACLE_HOME=/opt/oracle/product/23ai/dbhomeFree
export PATH=$ORACLE_HOME/bin:$PATH

-- Root container
sqlplus sys/SysPassword1@//localhost:1521/free as sysdba

-- Pluggable database
sqlplus sys/SysPassword1@//localhost:1521/freepdb1 as sysdba

We can stop and start the service from the root user with the following commands.

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

◉ Vagrant Example


If you want to see it in action, you might want to try one of these Vagrant build.


Source: oracle-base.com

Related Posts

0 comments:

Post a Comment