Before You Begin
This 15-minute tutorial shows you how to configure a read-only Oracle Home.
Background
Oracle Database contains various demo directories that include a variety of examples and product demonstrations that you can use to learn about the products, options, and features of Oracle Database. In a read-only mode ORACLE_HOME, you cannot use these demo directories in ORACLE_HOME because writes are performed to these demo directories when they are used.
Many of the demo directories are not available by default. You must install Oracle Database Examples to view and use the examples and product demonstrations.
What Do You Need?
- A Linux machine with version 6 or later of Oracle Linux or Red Hat Enterprise Linux.
- Completion of previous tutorials so that you have:
Installed Oracle Database Software 18c:
Perform a Software-Only Installation of Oracle Database
Enabled a read-only Oracle home and created a database:
Enable a Read-Only Oracle Home and Create a Database
Installed Oracle Database Examples:
Copying
demo
Directories
Copy the respective demo directory to the corresponding
location in ORACLE_BASE_HOME. The following example shows how to
copy the rdbms/demo
directory from ORACLE_HOME to
ORACLE_BASE_HOME:
- Log in to your computer as the Oracle software owner user (
oracle
). - Set the ORACLE_BASE_HOME environment variable:
- Check if the
rdbms/demo
directory is copied to ORACLE_BASE_HOME:$ ls -l -d $ORACLE_BASE_HOME/rdbms/demo
- If the
rdbms/demo
directory has not been copied, then create it and copy it:$ mkdir -p $ORACLE_BASE_HOME/rdbms $ cp -r $ORACLE_HOME/rdbms/demo $ORACLE_BASE_HOME/rdbms/demo
export ORACLE_BASE_HOME=/u01/app/oracle/homes/OraDB18Home1
You must copy the following demo
directories
from ORACLE_HOME to ORACLE_BASE_HOME:
-
jdbc/demo
-
odbc/demo
-
ord/http/demo
-
sqlj/demo
-
sqlplus/demo
-
plsql/demo
-
xdk/demo
Creating
Symbolic Links
You must create symbolic links for all the demo directories.
For rdbms/demo
, replace $ORACLE_HOME/rdbms/demo
with a symbolic link to the copy.
- Ensure that the symbolic link does not already exist.
$ ls -l -d $ORACLE_HOME/rdbms/demo
- If
$ORACLE_HOME/rdbms/demo
is still the original demo directory, rename it and replace it with the symbolic link.$ cd $ORACLE_HOME/rdbms $ mv demo demo.installed $ ln -s $ORACLE_BASE_HOME/rdbms/demo $ORACLE_HOME/rdbms/demo
Similarly, create the symbolic links for all the demo directories.
The xdk/demo
directory requires a symbolic link
at $ORACLE_HOME/xdk/include
pointing to $ORACLE_BASE_HOME/xdk/include
after you copy the xdk/demo
directory.
- Ensure that the symbolic link does not already exist:
$ ls -l -d $ORACLE_HOME/xdk/include
- If the symbolic link does not exist, then, run the following
command:
$ ln -s $ORACLE_HOME/xdk/include $ORACLE_BASE_HOME/xdk/include
Note: In the plsql/demo
directory, ncmpdemo.sql
is unusable in read-only mode.
Copying
the init.ora
File
Copy the init.ora
file from ORACLE_HOME/dbs
directory to ORACLE_BASE_HOME/dbs
directory.
- Log in to your computer as the Oracle software owner user (
oracle
). - Check if the
init.ora
file exists in ORACLE_BASE_HOME/dbs directory.$ ls $ORACLE_BASE_HOME/dbs/init.ora
If an
init.ora
file exists inORACLE_BASE_HOME/dbs
directory, then update thisinit.ora
file to be in-sync with the$ORACLE_HOME/dbs/init.ora
file. - If the
init.ora
file does not exist inORACLE_BASE_HOME/dbs
directory, then copy it from$ORACLE_HOME/dbs
directory.cp $ORACLE_HOME/dbs/init.ora $ORACLE_BASE_HOME/dbs/init.ora