This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This repository contains automated installation scripts for various Oracle Database versions (11g R2 through 21c) on Oracle Linux. Each version has its own directory with consistent structure and scripts that handle the entire installation process including database creation and optional sample schemas.
Each Oracle Database version directory contains a provision.sh script that handles the complete installation:
# Navigate to specific version directory
cd install-OracleDatabase19/
# Create .env file from sample (mandatory step)
cp dotenv.sample .env
# Edit .env to set proper values, especially MEDIA path
# Run installation
./provision.shAfter installation, verify the database:
# Connect to CDB as system user
sudo su - oracle
sqlplus system/oracle
# Connect to PDB
sqlplus system/oracle@localhost/pdb1
# Test sample schemas (if installed)
SELECT JSON_OBJECT(*) FROM hr.employees WHERE rownum <= 3;# Run all linting (hadolint, shellcheck, shfmt)
make lint
# Run individual linting tools
make shellcheck # Check shell scripts for issues
make shfmt # Check shell script formatting
make hadolint # Lint DockerfilesA Docker-based test environment is available for testing Oracle Database installations in isolated containers.
- Configure Oracle media path:
# Set ORACLE_MEDIA_PATH environment variable (default: /mnt)
export ORACLE_MEDIA_PATH=/path/to/oracle-media- Build Docker images:
make build# Install Oracle Database versions in containers
make install-11.2-ol7 # Oracle Database 11g R2 on Oracle Linux 7
make install-12.1-ol7 # Oracle Database 12c R1 on Oracle Linux 7
make install-12.2-ol7 # Oracle Database 12c R2 on Oracle Linux 7
make install-18-ol7 # Oracle Database 18c on Oracle Linux 7
make install-19-ol7 # Oracle Database 19c on Oracle Linux 7
make install-19-arm-ol8 # Oracle Database 19c ARM on Oracle Linux 8
make install-21-ol7 # Oracle Database 21c on Oracle Linux 7
make install-21-ol8 # Oracle Database 21c on Oracle Linux 8# Test database status after installation
make test-11.2-ol7 # Test Oracle Database 11g R2 on Oracle Linux 7
make test-12.1-ol7 # Test Oracle Database 12c R1 on Oracle Linux 7
make test-12.2-ol7 # Test Oracle Database 12c R2 on Oracle Linux 7
make test-18-ol7 # Test Oracle Database 18c on Oracle Linux 7
make test-19-ol7 # Test Oracle Database 19c on Oracle Linux 7
make test-19-arm-ol8 # Test Oracle Database 19c ARM on Oracle Linux 8
make test-21-ol7 # Test Oracle Database 21c on Oracle Linux 7
make test-21-ol8 # Test Oracle Database 21c on Oracle Linux 8# Enter containers for manual testing
make shell-ol7 # Enter Oracle Linux 7 container
make shell-ol8 # Enter Oracle Linux 8 container
# Inside container:
cd /workspace/install-OracleDatabase19
cp dotenv.sample .env
# Edit .env to set MEDIA=/mnt
sudo ./provision.shinstall-OracleDatabase/
├── Makefile # Build, test, and linting commands
├── compose.yml # Docker Compose configuration
├── Dockerfile.ol7 # Oracle Linux 7 base image
├── Dockerfile.ol8 # Oracle Linux 8 base image
├── setup-swap.sh # Host swap space setup script for Oracle requirements
├── test-database.sh # Database status testing script (validates DB installation)
├── CLAUDE.md # AI assistant instructions for Claude Code
├── README.md # Main project documentation
├── LICENSE # Project license
└── install-*/ # Oracle Database installation scripts for each version
General:
make help- Show all available commands
Host Environment Setup:
make setup-swap- Setup swap space for Oracle installation (default: 2048MB)
Container Management:
make build- Build Docker imagesmake build-ol7- Build Oracle Linux 7 imagemake build-ol8- Build Oracle Linux 8 imagemake clean- Clean up all containers, volumes, and networksmake shell-ol7- Enter Oracle Linux 7 container shellmake shell-ol8- Enter Oracle Linux 8 container shell
Installation:
make install-[version]-[os]- Install specific Oracle Database version
Testing:
make test-[version]-[os]- Test specific Oracle Database installation
Code Quality:
make lint- Run all linting (hadolint, shellcheck, shfmt)make hadolint- Lint Dockerfilesmake shellcheck- Lint shell scriptsmake shfmt- Lint shell script formatting
| Oracle Version | Base OS | Container Image |
|---|---|---|
| 11g R2 | Oracle Linux 7 | install-oracledatabase-oracle-linux-7 |
| 12c R1 | Oracle Linux 7 | install-oracledatabase-oracle-linux-7 |
| 12c R2 | Oracle Linux 7 | install-oracledatabase-oracle-linux-7 |
| 18c | Oracle Linux 7 | install-oracledatabase-oracle-linux-7 |
| 19c | Oracle Linux 7 | install-oracledatabase-oracle-linux-7 |
| 19c ARM | Oracle Linux 8 | install-oracledatabase-oracle-linux-8 |
| 21c | Oracle Linux 7/8 | Both images |
- ShellCheck: Install from https://github.com/koalaman/shellcheck#installing
- shfmt: Install from https://github.com/mvdan/sh#shfmt
- hadolint: Install from https://github.com/hadolint/hadolint#install
- Docker or Podman: Container runtime (auto-detected)
- Docker Compose: Required for orchestrating containers (docker compose or docker-compose)
- Oracle installation media: Downloaded separately from Oracle's website
- Oracle installation media must be placed in the directory specified by
ORACLE_MEDIA_PATHenvironment variable - Linting tools (ShellCheck, shfmt, hadolint) must be installed on the host system
- Containers run with testuser and sudo privileges for testing
- The Mo tool (Mustache template processor) is installed during provision.sh execution
Each Oracle version follows the same structure:
provision.sh- Main installation orchestratordotenv.sample- Environment configuration templatedb_install.rsp.mustache- Oracle installer response templatedbca.rsp.mustache- Database creation assistant response templateREADME.md- Version-specific documentation
The scripts use a .env file (created from dotenv.sample) with these key variables:
MEDIA- Directory containing Oracle installation ZIP filesORACLE_BASE- Oracle base directory (typically/u01/app/oracle)ORACLE_HOME- Oracle home directoryORACLE_SID- Database SIDORACLE_PDB- Pluggable database nameORACLE_PASSWORD- System passwordsORACLE_SAMPLESCHEMA- Whether to install sample schemasORACLE_CHARACTERSET- Database character set (typically AL32UTF8)ORACLE_EDITION- Oracle Database edition (EE, SE2, etc.)
The scripts use Mustache templates (.mustache files) processed by the Mo tool to generate Oracle response files. Variables from .env are substituted into templates at runtime.
- Pre-requisite Installation: Oracle preinstallation RPM packages
- Directory Setup: Create Oracle directories with proper ownership
- Environment Configuration: Set oracle user environment variables
- Software Installation: Unzip and install Oracle Database software
- Post-Installation: Run root scripts for kernel parameters
- Listener Creation: Configure Oracle Net listener
- Database Creation: Create database using DBCA with response file
- Sample Schemas: Optional installation (21c has separate script)
The install-Oracle-Database-19c-for-LINUX-ARM/ directory contains specialized scripts for ARM64 architecture, using different installation media (LINUX.ARM64_1919000_db_home.zip).
Scripts use:
set -eu -o pipefailfor strict error handling- Conditional
set +earound Oracle installer (which may return non-zero on warnings) - File existence checks before proceeding
- Temporary directory cleanup
- Installation requires root/sudo access for system configuration
- Oracle installation media must be downloaded separately from Oracle's website
- Scripts are designed for Oracle Linux 7/8 environments
- Each version has specific preinstallation RPM requirements
- The oracle user password is set during installation