Ansible Role: Oracle Database
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The oracle Ansible role is designed to automate the installation and configuration of the Oracle Database Enterprise Edition (EE) Single Instance. It specifically targets environments used for the Merative Social Program Management (SPM) platform, formerly known as IBM Cúram. This role handles the end-to-end lifecycle of a database setup, including system prerequisite validation, base software installation, patching via OPatch, and database instance configuration.
Sources: roles/oracle/README.md:1-5, roles/oracle/meta/main.yml:2-5
Role Architecture and Lifecycle
The role follows a modular task structure that separates installation, configuration, and maintenance (patching). It supports Oracle versions 12c and 19c on Enterprise Linux (EL) versions 7 and 8.
Installation Flow
The execution flow begins by including version-specific variables and then proceeds through a series of conditional task files based on the defined oracle_family.
System Prerequisites
Before installation, the role performs extensive system-level preparation. This includes installing required Linux packages, configuring kernel parameters via sysctl, and setting security limits for the oracle user.
Key OS Configurations
- Packages: Installs a wide array of dependencies including
binutils,libaio,glibc, andcompat-libstdc++. - User/Group Management: Creates required groups (
oinstall,dba,oper) and theoracleuser with specific GIDs/UIDs. - Security Limits: Configures
softandhardlimits fornofile,nproc,stack, andmemlockin/etc/security/limits.conf.
Sources: roles/oracle/tasks/12c_install.yml:11-135
Installation and Patching Logic
The role manages software acquisition through either local file copying or downloading from a remote Artifactory/HTTP server using get_url with optional headers.
OPatch and Patching Process
Patching involves shutting down the database and listener, applying the patch using the opatch tool, and then restarting services. The role can also upgrade the OPatch utility itself if a newer version is provided.
Sources: roles/oracle/tasks/patch.yml:58-135
Configuration Variables
The following table outlines the primary configuration options available for the role:
| Variable | Description | Default Value |
|---|---|---|
oracle_version | Target Oracle version | 19.26.0.0.0 |
oracle_home | Path to Oracle Home | /opt/oracle/product/<family>/dbhome_1 |
oracle_sid | System Identifier | orcl |
oracle_admin_password | SYS/SYSTEM password | Password1 |
sql_username | Application DB user | curam |
oracle_inventory | Path to oraInventory | /opt/Oracle/oraInventory |
Sources: roles/oracle/README.md:11-30, molecule/__oracle-v19c/verify.yml:6-10
Verification and Testing
The role includes Molecule scenarios to verify the installation. Verification tasks check for:
- The existence of the database directory and ORACLE_HOME.
- Correct software version via
sqlplusoropatch lspatches. - Successful configuration of the
CURAMdatabase user. - Persistence of the environment through
oratab(checking if entries end with 'Y').
Sources: molecule/__oracle-v19c/verify.yml:12-92, roles/oracle/tasks/main.yml:30-33
Summary
The Oracle Database role provides a robust framework for deploying production-ready database instances tailored for SPM workloads. By automating complex tasks like silent response file installations, kernel tuning, and multi-step patching sequences, it ensures consistency across development and test environments while maintaining compliance with Oracle's prerequisite requirements.