Operating Systems: Unattended install of Oracle Products

Introduction

In some situations the usage of an unattended or silent installation of Oracle products can be timesaving. Especially in the case that a lot of Oracle database or for example patches must be rolled out, it is good to consider to use an unattended installation. Also in situation in which the X-Windows or emulation software is not available, an unattended install can be used as it doesn’t require some kind of graphic environment.

 

Process of unattended install

The following tasks must be executed in order to prepare and execute an unattended installation:

1.

Running the Oracle Universal Installer to record the values of the parameter into the response file. This step is optional as Oracle ships templates for creating response files.

2.

Create a script (for example KSH) to call the runInstaller with the correct response file and execute the post installation steps.

3.

Test the unattended installation.

 

Below, these steps are detailed:

Step 1: recording the values of the parameters
The easiest way of creating a response file is running the Oracle Universal Installer once without executing the real installation. After entering the values for the necessary parameters, the installation can be cancelled at the Summary page just before the actual products are installed.

To record the entered values into a response file, the Oracle installer must be started with the record flag as shown below:

 

# ${INSTALL_ROOT} : Directory containing the OUI runInstaller binary
# ${RESPONSEFILE} : Fully qualified name to Response file

${INSTALL_ROOT}/runInstaller -record -destinationFile ${RESPONSEFILE}

Code fragment 1: Starting RunInstaller creating the response file

 

As said, the installation can be cancelled at the summary phase:

 

Figure 1: At the summary phase in the OUI, the process can be cancelled; the response file is created

 

The reponse file is a flat ASCII file, which can be edited with vi or notepad. Below an example of a reponse file is listed (showing the Oracle_HOME and ORACLE_HOME_NAME parameters):

 

#-------------------------------------------------------------------------------
#Name       : ORACLE_HOME
#Datatype   : String
#Description: Complete path of the Oracle Home.
#Example    : ORACLE_HOME = "C:\OHOME1"
#-------------------------------------------------------------------------------
ORACLE_HOME="/opt/oracle/product/10.2.0/rdbms"

#-------------------------------------------------------------------------------
#Name       : ORACLE_HOME_NAME
#Datatype   : String
#Description: Oracle Home Name. Used in creating folders and services.
#Example    : ORACLE_HOME_NAME = "OHOME1"
#-------------------------------------------------------------------------------
ORACLE_HOME_NAME="DBHome1"

Code fragment 2: two sections of the response file

 

An alternative for the above procedure is using a template response file shipped by Oracle. To use a shipped response file, the values used in the file must be replaced by values valid for your installation.

 

Step 2: scripting the installation
There can be situations in which the response file should be edited before it can be used. I have created a slient installation for Oracle Clusterware in which I used a KSH-script to retrieve the members (nodes) of the cluster. The original values of the nodes in the response file were replaced by the current values of the actual members. After replacing, the reponse file could be used for a silent installation.

Almost every Oracle installation has 1 or more post installation tasks like running oraInstRoot.sh or root.sh. These steps can be merged into 1 installation script even when a post installation script needs user input. When running root.sh for RDBMS, the script is prompting the user to enter information.

This interaction can be automated by means of a here-file. In the here-block, the values are specified which are needed by the script.

 

# ${ROOTSH} : Fully qualified name to root.sh file

${ROOTSH} << EOF
/usr/local/bin
y
y
y
EOF

 

Usage of response files
Every Oracle product, which can be installed by using Oracle Universal Installer, can be installed in an unattended mode. I have successfully applied this method for:

 

Oracle Cluster Ready Services (Oracle10gR2)

 

"Oracle RDBMS (Oracle10gR2)

 

"Oracle Companion products (Oracle10gR2)

 

"Oracle Patch set 2

 

Stap 3: Testing the installation

The silent installation can be started by the following commando:

 

# ${INSTALL_ROOT} : Directory containing the OUI runInstaller binary
# ${RESPONSEFILE} : Fully qualified name to Response file

${INSTALL_ROOT}/runInstaller -waitForCompletion -silent -responsefile ${RESPONSEFILE}




Auteur: Edwin Kessels (edwin.kessels@keed.nl) Copyright © 2007 Keed