Installation, Tools and Environment Setup

2.1 Installation Options

Oracle Database 23ai/26ai Free: RPM for Oracle Linux/RHEL, Windows installer, or Docker/Podman container (the easiest).

Enterprise installation on Linux: Prerequisites: oracle-database-preinstall-19c (or -23ai) RPM, kernel parameters, oracle user, oinstall/dba groups, OFA directory layout.

Run runInstaller (software only) → dbca (create the database) → netca (listener).

Silent installs with response files.

Oracle Cloud: Always Free Autonomous Database, or an OCI Base Database VM.

VirtualBox Developer Day VMs / Vagrant boxes (oracle/vagrant-projects on GitHub).

docker run -d --name oracle23 -p 1521:1521 -e ORACLE_PWD=<StrongPwd1> \
  container-registry.oracle.com/database/free:latest

2.2 Important Environment Variables

Optimal Flexible Architecture (OFA), Oracle Inventory (oraInventory), /etc/oratab, oraenv.

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
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

2.3 Tools

Classic command-line client Modern command line: history, formatting, Liquibase, INFO, DDL, LOAD, MCP server for AI tools

SQL Developer (desktop) / SQL Developer extension for VS Code

GUI IDE, debugger, Data Modeler, migrations SQL Developer Data Modeler ER and relational modeling Database Actions (web) Browser-based SQL worksheet (with ORDS)

Enterprise Manager (OEM) Cloud Control Enterprise monitoring and management DBCA / NETCA / NETMGR

Database creation and network configuration Backup and recovery expdp / impdp SQL*Loader bulk load Diagnostic repository CLI OPatch / AutoUpgrade Patching and upgrades Low-code app builder

2.4 Connecting

sqlplus / as sysdba                              # OS authentication
sqlplus hr/hr@localhost:1521/FREEPDB1            # EZConnect
sqlplus system@ORCLPDB1                          # tnsnames alias
sql admin@mydb_high?TNS_ADMIN=/wallet            # SQLcl with an ADB wallet
SELECT banner_full FROM v$version;
SELECT name, open_mode, cdb FROM v$database;
SHOW con_name
ALTER SESSION SET CONTAINER = FREEPDB1;
SHOW USER

2.5 SQL*Plus / SQLcl Essentials

SET LINESIZE 200 PAGESIZE 100 TIMING ON SERVEROUTPUT ON FEEDBACK ON
COLUMN last_name FORMAT A20
DESC employees
SPOOL output.txt  ...  SPOOL OFF
@script.sql          -- run a script
/                    -- re-run the buffer
DEFINE dept = 10
SELECT * FROM employees WHERE department_id = &dept;   -- substitution variable
VARIABLE v NUMBER
EXEC :v := 100
PRINT v
SET AUTOTRACE TRACEONLY EXPLAIN STATISTICS
SET SQLFORMAT csv    -- SQLcl: csv, json, insert, ansiconsole
INFO employees       -- SQLcl
DDL employees        -- SQLcl
HISTORY              -- SQLcl

2.6 Installing the Sample Schemas

git clone https://github.com/oracle-samples/db-sample-schemas
cd db-sample-schemas/human_resources && sql system@FREEPDB1 @hr_install.sql