As a feature designed to significantly improve operational management efficiency and enhance security for Oracle Databases, a “Read-Only ORACLE_HOME” has been recommended since Oracle Database 19c. This article explains the differences from traditional configurations, specific structural changes in directories, and the officially recommended activation procedure using the Database Configuration Assistant (DBCA) with visual diagrams tailored for beginner to intermediate Oracle engineers.
- Conclusion & Quick Procedure (Read-Only ORACLE_HOME Activation Checklist)
- Background and Basics: What is a Read-Only ORACLE_HOME?
- Configuration and Directory Structure Changes
- Activation Steps and Execution Examples
- Troubleshooting
- Operational and Monitoring Notes & Risks
- FAQ (Frequently Asked Questions)
- Summary
Conclusion & Quick Procedure (Read-Only ORACLE_HOME Activation Checklist)
The overall workflow and “To-Do Checklist” for building a read-only ORACLE_HOME are as follows:
- Verify Prerequisites: Confirm the target operating system (Linux/Unix) and version (Oracle Database 18c/19c or later).
- Software-Only Installation: Execute
runInstallerto deploy only the binaries without creating a database. - Run Dedicated Script: Execute the
roohctl -enablecommand to switch the home directory to read-only. - Create Database: Launch
dbcato generate configuration files and data under the separate, writable directories.
Background and Basics: What is a Read-Only ORACLE_HOME?
In traditional Oracle Database environments, the directory known as ORACLE_HOME housed a mixture of immutable “program main bodies (binaries)” alongside “configuration files (init.ora, listener.ora, etc.)” and “log files” that change during operation.
A “Read-Only ORACLE_HOME” completely freezes (statizes) this binary portion and clearly separates dynamic files where changes occur into distinct, writable directories (ORACLE_BASE_HOME and ORACLE_BASE_CONFIG).
This makes it dramatically easier to share a single, common binary (Gold Image) across multiple servers, substantially simplifying patch application and security governance.
Configuration and Directory Structure Changes
When you enable read-only mode, the storage locations for various files change as follows.
Directory Structure Comparison (Text Diagram)
◆ Traditional Configuration (Read-Write)
/u01/app/oracle/product/19.0.0/dbhome_1/ (ORACLE_HOME)
├── bin/, lib/, rdbms/ (Binaries)
├── dbs/ (spfile, init.ora coexist here)
├── network/admin/ (listener.ora coexists here)
└── log/, trace/ (Logs coexist here)
◆ Read-Only Configuration (Read-Only)
/u01/app/oracle/product/19.0.0/dbhome_1/ (ORACLE_HOME: Immutable)
└── bin/, lib/, rdbms/ (Pure binaries only)
/u01/app/oracle/homes/OraDB19Home1/ (ORACLE_BASE_HOME: Writable)
├── dbs/ (Target location for spfile, init.ora)
└── network/admin/ (Target location for listener.ora, etc.)
Main File Locations Matrix
| File Type | Traditional Location (Example) | Location After Enabling Read-Only (Example) |
Initialization Parameter File (spfile) | $ORACLE_HOME/dbs/ | $ORACLE_BASE_CONFIG/dbs/ |
Listener Configuration (listener.ora) | $ORACLE_HOME/network/admin/ | $ORACLE_BASE_HOME/network/admin/ |
Password File (orapw) | $ORACLE_HOME/dbs/ | $ORACLE_BASE_CONFIG/dbs/ |
Activation Steps and Execution Examples
This section describes the actual steps to construct a read-only ORACLE_HOME on a Linux environment.
Prerequisites & Environment
- Target OS: Oracle Linux 7 / 8
- Target Version: Oracle Database 19c (19.3) Enterprise Edition / Standard Edition 2
- Operating User:
oracleuser (possessing installation privileges) - Configuration Assumption: Multitenant architecture containing a Container Database (CDB) and Pluggable Databases (PDBs).
Step 1: Software-Only Installation
Deploy only the binaries without creating a database. Set the environment variables and start the installer.
# 1. Set environment variables
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
# 2. Launch the installer (GUI will start)
cd $ORACLE_HOME
./runInstaller
Note: Follow the on-screen instructions and select “Software Only” to complete the installation.
Step 2: Read-Only Conversion via roohctl Command
After the installation is complete and before creating any databases, use the dedicated utility roohctl to configure the home directory as read-only.
# Command to switch ORACLE_HOME to read-only
$ORACLE_HOME/bin/roohctl -enable
Note: Executing this command internally updates definition files such as
$ORACLE_HOME/inventory/orabasehome.propertiesand automatically generates the dynamic directories.
Step 3: Verify Current Configuration Status
Execute the status check command to verify whether the switch succeeded normally.
# Execute the status check command
$ORACLE_HOME/bin/roohctl -status
Verification of Output Result:
Read-Only Oracle Home is ENABLED
If ENABLED is displayed as shown above, the read-only conversion was successful.
Step 4: Database Creation via Oracle DBCA
Once the home stabilization is complete, launch the Database Configuration Assistant (DBCA) as usual to create your database.
# Launch DBCA
dbca
Note: DBCA automatically detects that it is in a read-only configuration and properly places and generates initialization parameter files and network configuration files on the
$ORACLE_BASE_HOMEside.
Troubleshooting
The table below summarizes common issues encountered during Read-Only ORACLE_HOME operations along with their solutions.
| Symptom / Error | Assumed Cause | Checkpoint & Solution |
ORA-01078: failure in processing system parameters | During startup, it referenced the traditional $ORACLE_HOME/dbs and failed to find the spfile. | Verify whether the environment variables ORACLE_BASE_HOME or ORACLE_BASE_CONFIG are properly recognized, and confirm if the file exists at the correct path. |
| Custom scripts result in errors | File paths such as $ORACLE_HOME/network/admin are hardcoded inside the scripts. | Modify the reference targets to $ORACLE_BASE_HOME/network/admin, or rewrite them to dynamically retrieve the path using the orabasehome command. |
roohctl -enable fails | A database has already been created via DBCA or other means. | This feature must be executed before database creation. Delete the home directory once and reinstall. |
Operational and Monitoring Notes & Risks
Benefits and Operational Pitfalls
- Maximum Benefit: Centralized binary management. When applying patches (such as a Release Update (RU)), you simply prepare a new read-only binary and switch the reference path (
ORACLE_HOME) for each instance. This completes the update safely and in a short time. - Pitfall / Disadvantage: No utility is provided to revert an ORACLE_HOME that has been activated via
roohctl -enableback to its traditional read-write state later.
Actions if You Absolute Need to Revert to a Traditional Configuration (Recovery Plan)
If you must revert the configuration back to a traditional model, recreate it using the following steps:
- Delete existing databases and listeners safely (or back up definitions) using
dbca. - Completely delete the relevant read-only
ORACLE_HOMEdirectory. - Install the software again using
runInstaller, and rebuild the database viadbcawithout executingroohctl.
FAQ (Frequently Asked Questions)
Q1. Can an existing 19c database (traditional configuration) be converted to a read-only configuration midway?
A1. No, you cannot perform an in-place conversion of an existing read-write home directly into a read-only home. You must perform a “Software Only” installation of the software into a new directory, execute roohctl -enable, and then migrate the existing database to the new home (upgrade/migration tasks).
Q2. In a read-only environment, where should the SQL*Plus glogin.sql be placed?
A2. Site-specific configuration files like glogin.sql or login.sql should be placed on the writable base directory side. In a read-only home, the lookup target is $ORACLE_BASE_HOME/sqlplus/admin/.
Q3. Does the patch application (OPatch) procedure change compared to the traditional way?
A3. Yes, it changes. When applying a patch directly to a read-only ORACLE_HOME, you must either use a command to temporarily make it writable (roohctl -patch, etc.) or use the recommended “out-of-place patching” method, where you create a patched “Gold Image (New Home)” in a separate directory and switch the reference path of the instance.
Summary
- Core Architecture: Completely separates binaries (static) from configurations and logs (dynamic) into distinct directories.
- Recommended Versions: Introduced in Oracle Database 18c, it has become the standard recommended configuration in 19c and 23ai.
- Key Trick for Construction: Always execute the
roohctl -enablecommand before creating a database. - Operational Benefits: Accelerates patch applications, shares binaries among multiple databases, and has exceptional affinity with Docker/container environments.
This article focuses on Oracle Database 19c (screens or default values may differ in other versions).
[reference]
About Read-Only Oracle Homes

コメント