Monday, June 12, 2023

Oracle Database 23c Free RPM Installation On Oracle Linux 8 (OL8)

Oracle Database 23c Free RPM Installation On Oracle Linux 8 (OL8)

Oracle 23c free developer-release can be installed on Oracle Linux 8 using an RPM. This article describes the RPM installation of Oracle Database 23c free 64-bit on Oracle Linux 8 (OL8) 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  ol8-23.localdomain  ol8-23

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

ol8-23.localdomain

Oracle Installation


Download the relevant RPM from download page here.

◉ oracle-database-free-23c-1.0-1.el8.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 oraclelinux-developer-release-el8
dnf install -y oracle-database-preinstall-23c

We now install the 23c 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-23c-1.0-1.el8.x86_64.rpm

The ORACLE_HOME for the software installation is "/opt/oracle/product/23c/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-23c 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/23c/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-23c stop
/etc/init.d/oracle-free-23c start

Thoughts


Here are some thoughts about this method of installation.

◉ The mechanism is designed for a software-only installation of the Oracle database software. It is not a single command to get Oracle running. As a result it doesn't feel particularly simpler than doing a regular silent installation of the database software, but people with less experience may disagree.
◉ The RPM can only be used to install the software, not update it. This is a "one-shot" solution.
◉ We have no control of the software installation itself. If you have a corporate standard you use for your installations, this is not the solution for you. Remember, the ORACLE_HOME for the software installation is "/opt/oracle/product/23c/dbhomeFree".
◉ Even with a ULN subscription, it is unlikely you would want to pull this software down for each installation. You would need to create a local Yum repository to host it.
◉ It's an interesting exercise, but I would not consider using this approach for anything other than demos at this time.

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