Automating Oracle 11.2 installation on RHEL 7

I’ve seen a few guides out there about how to install Oracle 11.2 on RHEL 7, but none that will run silently, end to end, with no clicking.

Currently, if Oracle is required, we download a script in the kickstart and add it to /etc/rc.d/rc.local , so it executes when the machine comes up. This works fine on RHEL5 and RHEL6, but hits a few issues on RHEL7. I’ll just go through the things I had to change to make this work on RHEL7.

1. Change cvu_config file, to assume redhat 6 at least. Funnily enough, you don’t have to do this on redhat 6! :

sed -i -e 's/^CV_ASSUME_DISTID=.*/CV_ASSUME_DISTID=OEL6/g'  <UNZIPPED_DB_FILES>/database/stage/cvu/cv/admin/cvu_config

2. Ok, this one is a bit ugly! Many sites describe how you have to edit a linker file to make it work (like here , or here).

The fix is adding “-lnnz11” to the end of the ins_emagent.mk file *AFTER* the linking step of the install has failed.

To make it work without rerunning the install, we have to edit the linker file inside the product files before it installs:

i) Install a JVM to get the jar utility (yum -y install java-1.7.0-openjdk-devel)
ii) Unzip the file containing the ins_emagent.mk file

cd <UNZIPPED_DB_FILES>/database/stage/Components
unzip ./oracle.sysman.agent/10.2.0.4.5/1/DataFiles/filegroup38.jar  sysman/lib/ins_emagent.mk

iii) Add the -lnnz11 flag

sed -i -e 's/\$(MK_EMAGENT_NMECTL)/\$(MK_EMAGENT_NMECTL) -lnnz11/g' sysman/lib/ins_emagent.mk

iv) Jar the file back up again

jar -uvf  ./oracle.sysman.agent/10.2.0.4.5/1/DataFiles/filegroup38.jar sysman/lib/ins_emagent.mk

Now the linker won’t fail during the install.

3. RHEL 7 has a nifty /etc/sysctl.d/ facility, where you could isolate different kernel parameters for different applications, keeping everything nice and clean. Well, with Oracle 11.2, forget about using it. Not only does having the correct kernel parameters set at runtime, but they also have to be inside the actual /etc/sysctl.conf file. So the way to do this is to append the standard group of oracle kernel params to /etc/sysctl.conf , which you can get here.

4. Now for the trickiest one that caught me out the most. Here’s the error:

INFO: Run Level: This is a prerequisite condition to test whether the system is running with proper run level.
INFO: Severity:CRITICAL
INFO: OverallStatus:OPERATION_FAILED
INFO: -----------------End of failed Tasks List----------------
INFO: Adding ExitStatus PREREQUISITES_NOT_MET to the exit status set
SEVERE: [FATAL] [INS-13013] Target environment do not meet some mandatory requirements.
   CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /tmp/OraInstall2014-10-16_10-52-41AM/installActions2014-10-16_10-52-41AM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2014-10-16_10-52-41AM/installActions2014-10-16_10-52-41AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
INFO: Advice is ABORT

So I get that with the move to systemd, RHEL7 removes the concept of runlevels, but the runlevel command remains for backwards compatibility. It looks like the runlevel set when you’re running something from /etc/rc.d/rc.local (itself also a deprecated concept with systemd) is undefined. I know this because when I run the runlevel command after restarting the machine from a script called by rc.local, I get back ‘unknown’. Running runlevel again from a shell returns the more familiar ‘N 3’

So setting the runlevel by hand before running the oracle installer didn’t seem to work, although if called, the runlevel command returned ‘N 3’ anyway.

su - oracle -c "export RUNLEVEL=3 ; ./runInstaller -executePrereqs -silent -waitforcompletion -responseFile orainstall.rsp"

Appending lines to /etc/inittab didn’t work either. The -ignoreSysPrereqs flag for ./runInstaller didn’t appear to do anything. So what to do? Reduce the severity of the error, of course! . I would’ve liked to have figured out how the installer really determines that the runlevel is wrong, since it clearly isn’t using the runlevel command, but after many, many, many attempts, I just wanted to have it install already!!!!
So it turns out, that the severity of the prereq checks are defined in this file, and running this makes the runlevel check not fail the install

sed -i -e 's/<RUNLEVEL>/<RUNLEVEL SEVERITY="IGNORABLE">/g' <UNZIPPED_DB_FILES>/database/stage/cvu/cvu_prereq.xml

After all this, you get this in the installActions.log

INFO: *********************************************
INFO: Run Level: This is a prerequisite condition to test whether the system is running with proper run level.
INFO: Severity:IGNORABLE
INFO: OverallStatus:OPERATION_FAILED
INFO: -----------------End of failed Tasks List----------------
WARNING: [WARNING] [INS-13014] Target environment do not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. /tmp/OraInstall2014-10-16_12-12-55PM/installActions2014-10-16_12-12-55PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2014-10-16_12-12-55PM/installActions2014-10-16_12-12-55PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
INFO: Advice is CONTINUE

Advice is continue!!! So the install finally keeps going. I haven’t actually put anything in the database I’ve made yet, so there might be a follow up post!

Just one postscript to this. The biggest problem in debugging this is that the Oracle installer was always very keen to delete the log files from the install. So it would fail and I would have no idea what was wrong.

Backgrounding this little shell script before running runInstaller, would tail the contents to /opt where I could actually read them, before the installer deleted them.

#!/bin/bash

FOLDER=false
while [[ $FOLDER == "false"  ]] ; do
  echo "not found"
  sleep 3
  find /tmp -name "Ora*" | grep -q Ora
  if [[ $? == "0" ]] ; then
    FOLDER=true
  else
    FOLDER=false
  fi
done

cd /tmp/Ora*
sleep 5
tail -f /tmp/Ora*/installActions* > /opt/installActions.log &
tail -f /tmp/Ora*/oraInstall*.err > /opt/oraInstall.err &
tail -f /tmp/Ora*/oraInstall*.out > /opt/oraInstall.out
This entry was posted in howto, script and tagged , , . Bookmark the permalink.

One Response to Automating Oracle 11.2 installation on RHEL 7

  1. Vladimir D. says:

    Thanks a lot Graham!
    It turns out that this page is much more useful than whole MOS repository 🙂
    We spent a lot of time the find out that systemd is culprit. (runInstall -debug option was necessary, because of there is no oraInstall logs 🙂 ) before noticed this page,
    but your “sed -i -e ‘s///g’ /home/oracle/11.2.0.2/stage/cvu/cvu_prereq.xml” surely save us 1-2 man days.
    Of course, it is very logical.

    Kind Regards,
    Vladimir

Leave a Reply

Your email address will not be published. Required fields are marked *