Skip to main content

Lab 1: Install Oracle 19c on Linux

A hands-on lab to train a junior DBA. Each participant installs and configures an Oracle 19c database on Linux from scratch, then uses the scripts from this guide to understand what is running. By the end, everyone has a working environment of their own to keep practicing.

LAB About 4 hours. Run it on lab VMs only, never on a client or production server.

Prerequisites

  • VM running Oracle Linux 8 with at least 8 GB of RAM and 60 GB of disk
  • LINUX.X64_193000_db_home.zip already copied to /tmp on the VM
  • SSH access to the VM and a client such as MobaXterm or PuTTY

Agenda

#BlockTimeWhat we cover
1Welcome and goals10 minHow the lab works and what everyone takes away
2Oracle architecture in a nutshell20 minInstance versus database, SGA, PGA, background processes, datafiles, redo logs, control files, CDB and PDB
3Hands-on 1. Preparing Linux30 minPreinstall package, oracle user and groups, directories, kernel parameters and limits
4Hands-on 2. Installing Oracle 19c45 minSoftware install, root scripts, listener, CDB and PDB
5Break15 min
6Hands-on 3. Configuring the environment30 minEnvironment variables, oratab, start and stop, connections
7Hands-on 4. Running the scripts45 minRun the scripts from this guide and understand what each one checks
8Troubleshooting challenge20 minSimulated failures for everyone to fix
9Recap and next steps15 minQuestions, study materials and the next lab

Execution plan

Before the lab, instructor tasks

  • Create the Oracle Linux 8 VMs and test SSH access for every participant
  • Copy LINUX.X64_193000_db_home.zip to /tmp on all VMs
  • Share the link to this guide with the participants
  • Take a VM snapshot after Hands-on 1 so anyone who gets stuck can recover

Hands-on 1. Preparing Linux

ROOT Run these steps as root.

dnf install -y oracle-database-preinstall-19c
passwd oracle
mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1 /u02/oradata
chown -R oracle:oinstall /u01 /u02
chmod -R 775 /u01 /u02
firewall-cmd --permanent --add-port=1521/tcp
firewall-cmd --reload
  • Install the preinstall package
  • Set the oracle user password
  • Create the directories owned by oracle:oinstall
  • Check the hostname in /etc/hosts
  • Open port 1521 for the listener
  • Review /etc/sysctl.conf and /etc/security/limits.d/ to see what the package changed

Hands-on 2. Installing Oracle 19c

su - oracle
cd /u01/app/oracle/product/19.0.0/dbhome_1
unzip -q /tmp/LINUX.X64_193000_db_home.zip
export CV_ASSUME_DISTID=OEL7.8
./runInstaller

TIP On Oracle Linux 8 the 19.3 base installer usually fails the OS check. CV_ASSUME_DISTID=OEL7.8 avoids it. Applying a Release Update during the install also works.

  • Unzip the software inside ORACLE_HOME as oracle
  • Run ./runInstaller and choose a software-only Enterprise Edition install
  • As root, run /u01/app/oraInventory/orainstRoot.sh and $ORACLE_HOME/root.sh
  • Create the default listener on port 1521 with netca
  • Create the database with dbca using CDB ORCLCDB, PDB ORCLPDB1 and character set AL32UTF8

Hands-on 3. Configuring the environment

# ~/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1
export ORACLE_SID=ORCLCDB
export PATH=$ORACLE_HOME/bin:$PATH
sqlplus / as sysdba
shutdown immediate
startup
alter pluggable database all open;
alter pluggable database all save state;
  • Set the environment variables in .bash_profile
  • Check the database entry in /etc/oratab
  • Practice shutdown immediate and startup
  • Practice lsnrctl status, lsnrctl stop and lsnrctl start
  • Open the PDB and save its state
  • Add ORCLPDB1 to tnsnames.ora and test with tnsping ORCLPDB1 and sqlplus system@ORCLPDB1

Hands-on 4. Running the scripts

For each script, run it, read the output and find out which view it queries. Every page below follows the same structure, so participants also learn how to use this guide.

READ ONLY All the scripts in this block only query the data dictionary.

Troubleshooting challenge

The instructor breaks something on each VM. Participants find the error, explain the cause and fix it.

ScenarioHow the instructor sets it upErrorReference
Listener downlsnrctl stopORA-12541Hands-on 3
Instance downshutdown abortORA-01034The database does not start
Wrong environmentWrong ORACLE_SID in the sessionORA-01034 or ORA-12162Hands-on 3
Tablespace fullSmall tablespace without autoextend, filled with a test tableORA-01653A tablespace is full

After the lab