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.zipalready copied to/tmpon the VM- SSH access to the VM and a client such as MobaXterm or PuTTY
Agenda
| # | Block | Time | What we cover |
|---|---|---|---|
| 1 | Welcome and goals | 10 min | How the lab works and what everyone takes away |
| 2 | Oracle architecture in a nutshell | 20 min | Instance versus database, SGA, PGA, background processes, datafiles, redo logs, control files, CDB and PDB |
| 3 | Hands-on 1. Preparing Linux | 30 min | Preinstall package, oracle user and groups, directories, kernel parameters and limits |
| 4 | Hands-on 2. Installing Oracle 19c | 45 min | Software install, root scripts, listener, CDB and PDB |
| 5 | Break | 15 min | |
| 6 | Hands-on 3. Configuring the environment | 30 min | Environment variables, oratab, start and stop, connections |
| 7 | Hands-on 4. Running the scripts | 45 min | Run the scripts from this guide and understand what each one checks |
| 8 | Troubleshooting challenge | 20 min | Simulated failures for everyone to fix |
| 9 | Recap and next steps | 15 min | Questions, 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.zipto/tmpon 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.confand/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_HOMEas oracle - Run
./runInstallerand choose a software-only Enterprise Edition install - As root, run
/u01/app/oraInventory/orainstRoot.shand$ORACLE_HOME/root.sh - Create the default listener on port 1521 with
netca - Create the database with
dbcausing CDBORCLCDB, PDBORCLPDB1and character setAL32UTF8
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 immediateandstartup - Practice
lsnrctl status,lsnrctl stopandlsnrctl start - Open the PDB and save its state
- Add
ORCLPDB1totnsnames.oraand test withtnsping ORCLPDB1andsqlplus 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.
- Instance, host and service
- Containers and PDBs
- Tablespace usage
- Who is connected
- Finding blocking locks
- Morning routine, to put everything together
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.
| Scenario | How the instructor sets it up | Error | Reference |
|---|---|---|---|
| Listener down | lsnrctl stop | ORA-12541 | Hands-on 3 |
| Instance down | shutdown abort | ORA-01034 | The database does not start |
| Wrong environment | Wrong ORACLE_SID in the session | ORA-01034 or ORA-12162 | Hands-on 3 |
| Tablespace full | Small tablespace without autoextend, filled with a test table | ORA-01653 | A tablespace is full |
After the lab
- Keep the VM and repeat the daily routine from Daily, weekly and monthly checklists
- Use the Glossary for any term that was not clear
- Next lab topic to be defined