Install and configure Oracle Database on a Linux server, create a starter database, and enable SQL access.
Installation requires system preparation, software deployment, database creation, listener configuration, and service enablement. Oracle supplies RPM and GUI installers to automate most steps.
Use a supported distribution (OL 8/9, RHEL 8/9, CentOS 8-stream), 8 GB RAM, 30 GB free disk, swap = RAM, and hostname resolving to a static IP. Disable SELinux or set it to permissive.
sudo yum install -y oracle-database-preinstall-21c
The preinstall RPM creates oracle groups, users, kernel parameters, ulimits, and required libraries.
# Download from OTN, then
sudo yum localinstall -y oracle-database-ee-21c-1.0-1.x86_64.rpm
RPM places binaries under /opt/oracle/product/21c/dbhome_1 and installs the oracledb service unit.
sudo /etc/init.d/oracledb_ORCLCDB-21c configure
This script sets the CDB name ORCLCDB, listener port 1521, creates a PDB ORCLPDB1, and outputs the generated SYS user password.
sudo su - oracle
sqlplus sys@ORCLPDB1 as sysdba
SQL> SELECT open_mode FROM v$database;
The query should return READ WRITE, confirming the PDB is open and ready.
CREATE USER shop IDENTIFIED BY "Sh0pPwd" QUOTA UNLIMITED ON users;
GRANT connect, resource TO shop;
ALTER SESSION SET current_schema = shop;
CREATE TABLE customers (
id NUMBER PRIMARY KEY,
name VARCHAR2(100),
email VARCHAR2(255),
created_at DATE DEFAULT SYSDATE
);
CREATE TABLE products (
id NUMBER PRIMARY KEY,
name VARCHAR2(100),
price NUMBER(10,2),
stock NUMBER
);
CREATE TABLE orders (
id NUMBER PRIMARY KEY,
customer_id NUMBER REFERENCES customers(id),
order_date DATE DEFAULT SYSDATE,
total_amount NUMBER(10,2)
);
CREATE TABLE orderitems (
id NUMBER PRIMARY KEY,
order_id NUMBER REFERENCES orders(id),
product_id NUMBER REFERENCES products(id),
quantity NUMBER
);
These tables mirror a typical online store and help confirm DML functionality after installation.
Create a separate ASM or LVM volume for datafiles, enable flashback, schedule RMAN backups, and patch quarterly with opatchauto
.
Skipping the preinstall RPM causes missing libraries; running the configure script twice corrupts ORACLE_HOME. Always verify logs in /opt/oracle/diag.
Oracle only certifies its database on selected Red Hat compatible distributions. For Ubuntu use Oracle XE in a container or run Oracle inside a supported VM.
Yes. The RPM places files under /opt/oracle, registers a systemd service, and supports patching with OPatch. For advanced options, use the GUI installer instead.
Download the quarterly RU patch from MOS, unzip it, and run opatchauto apply
as root. Reboot the server if requested to relink binaries.