Oracle 19c on Oracle Linux in Proxmox
This guide details the process of installing Oracle Database 19c on an Oracle Linux system virtualised on Proxmox.
Note: This installation procedure is intended for Oracle Linux R9 or earlier versions.
Prerequisites
Before starting the installation, an Oracle Linux system is required. The installation ISO for Oracle Linux can be downloaded from the official Oracle Linux ISOs page.
It is recommended to use OracleLinux-R9-U7-x86_64-dvd.iso for this setup.
Proxmox VM Config
root@pve:~# qm config 999
agent: 1
balloon: 8192
bios: ovmf
boot: order=scsi0
cores: 2
cpu: host
efidisk0: local-zfs:vm-999-disk-0,efitype=4m,ms-cert=2023,pre-enrolled-keys=1,size=1M
machine: q35
memory: 8192
meta: creation-qemu=10.1.2,ctime=1769003620
name: ora19c
net0: virtio=BC:24:11:AC:1C:05,bridge=vmbr0
numa: 0
onboot: 1
ostype: l26
scsi0: local-zfs:vm-999-disk-1,cache=unsafe,discard=on,iothread=1,size=20G,ssd=1
scsi1: local-zfs:vm-999-disk-2,cache=unsafe,discard=on,iothread=1,size=50G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=3ebfa95a-e8e4-4c73-94de-acade1e425e4
sockets: 1
tags: prod
vga: virtio
vmgenid: a7d35a97-8cd3-471d-bfcb-3365c322dc9fSystem Preparation
During the Oracle Linux installation, follow these steps for the initial setup:
- In the Software Selection menu, choose Minimal Install.
- In the Additional Packages menu, enable the Guest Agent Package.
- Disable swap on the system.
- After the installation, complete the base system setup which includes updating the system and installing essential tools like
vim,tmux, andwget.
Additional Disk for Oracle Data
For better performance and management, it is advisable to use a separate disk for the Oracle database files (oradata).
- Attach a new disk to the virtual machine (e.g., 50GB).
- Create a new partition on the new disk (e.g.,
/dev/sdb1). - Format the partition with an
ext4filesystem. - Mount the partition to
/optand ensure it is mounted automatically on boot by adding an entry to/etc/fstab.
Oracle 19c Installation
The Oracle Database 19c software is distributed as an RPM package.
- Download the
oracle-database-ee-19c-1.0-1.x86_64.rpmpackage from the Oracle website. - Install the package using
yum.
yum install oracle-database-ee-19c-1.0-1.x86_64.rpmOracle Configuration
Create Oracle Home and Profile
A home directory for the oracle user needs to be created, and a bash profile with the necessary environment variables must be set up.
mkdir -p /home/oracle
chown oracle:oinstall /home/oracle
chmod 750 /home/oracleCreate a .bash_profile for the oracle user.
# /home/oracle/.bash_profile
# Oracle environment
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19c/dbhome_1
export ORACLE_SID=ORCLCDB
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/libCreate and Start the Database
The database can be configured and started using the provided init script.
sudo /etc/init.d/oracledb_ORCLCDB-19c configureDefault User Password Change
The above command creates default users (SYS, SYSTEM, PDBADMIN) with randomly generated passwords. It is highly recommended to change these passwords immediately.
Oracle recommends that passwords should be at least 8 characters long, and include at least one uppercase letter, one lowercase letter, and one digit.
ALTER USER sys IDENTIFIED BY "new_password";
ALTER USER system IDENTIFIED BY "new_password";
ALTER SESSION SET CONTAINER=ORCLPDB1;
ALTER USER pdbadmin IDENTIFIED BY "new_password";Open Pluggable Database (PDB)
By default, the pluggable database (PDB) is not open. It needs to be opened and saved to be available after a restart.
ALTER PLUGGABLE DATABASE ALL OPEN;
ALTER PLUGGABLE DATABASE ALL SAVE STATE;Register Database with Listener
It is mandatory to register the database with the listener to allow remote connections.
ALTER SYSTEM REGISTER;After this, the output of lsnrctl status should show the database service, and should no longer report that the listener supports no services.
Firewall Configuration
To allow remote connections to the database, the default Oracle port 1521 needs to be opened in the firewall.
sudo firewall-cmd --add-port=1521/tcp --permanent
sudo firewall-cmd --reloadArchive Log Verification
You can verify the archive log mode of the database.
ARCHIVE LOG LIST;The output should indicate that Archive Mode is disabled.
Database log mode No Archive Mode
Automatic archival DisabledLog Management
To prevent the alert log from growing indefinitely, it is a good practice to set up log rotation.
Create a new logrotate configuration file for the Oracle alert log.
# /etc/logrotate.d/oracle19c
/opt/oracle/diag/rdbms/*/*/trace/alert*.log {
daily
rotate 7
compress
delaycompress
missingok
notifempty
copytruncate
}Connect DB using DBeaver
Connection Details:
Host: ora19c.example.com
Port: 1521
Conn Type: Service Name
Database: ORCLPDB1
Authentication:
Type: Oracle Database Native
Username: system
Password: new_passowrd
Role: Normal