How to automate Oracle DB installation (like a ‘hands-free’ install)

installationoracleoracle-11g-r2

I installed the Oracle 11g2 'standard' edition using the following zip-files:

linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip

I used the installation guide by Oracle which I found quite tedious, e.g. you need to install/configure an X-Server because the default installer is a GUI which you have to 'babysit' for some time.

Is there a way to automate a default Oracle installation?

I mean something like a script where I can specify: tell me what yum/apt-packages are missing, here are my oracle-zip-install-files, install it under $MY_BASEDIR and for everything else use some sane defaults!

And no GUI.

I know that there is an express-edition which comes as an rpm – this looks convenient on the first glance, but it seems to exclude some stuff the 'standard' edition includes, e.g. Pro*C.

Best Answer

Two solutions:

Install Oracle manually the first time. Then zip all ORACLE_HOME and for future installation simply:

  1. Unzip oracle_home into the new home
  2. Run $ORACLE_HOME/bin/relink all
  3. Run ./runInstaller -silent -attachHome ORACLE_HOME="<Oracle_Home_Location>" ORACLE_HOME_NAME="<Oracle_Home_Name>"

SID is a property of the database/instance and is separate from installation of the software.


Other solution (not my preferred but probably the preferred for mass deployment) is to create a response file. The sample is available in the installation dir:

<11g Disk>/database/response/enterprise.rsp

Copy this file, edit it and replace default values with your ones (mainly the path, install type, etc). Then run:

./runInstaller -silent -responseFile myresponsefile.rsp

You can also install the DB manually the first time and record the response file witht he command:

./runInstaller -record -destinationFile myresponsefile.rsp

The first one is my preferred because you can easily install and patch the database with the last PSU available, then you have a consolidated installation can be moved around. Of course all systems must be already prepared with needed packages.