Installing an Oracle Client on a Linux host is a rather easy and straightforward task but when you have to do this on a lot of hosts with different Linux distributions you probably will think about how to automate the process and not use the GUI at all.
A simple script for installing an Oracle 12c client with the April 2016 PSU (12.1.0.2.160419) can be found here: http://balazsberki.com/downloads/
What it does:
- Installs the Oracle client to a default folder (ORACLE_BASE)
- Checks for relink errors
- Installs newest OPatch
- Patches the Oracle Client with the April 2016 PSU
- Installs Oracle Net
- Sets the environment variables for the user
- Checks whether the orainstRoot.sh was executed
The script needs the following files to be in the same directory:
$ ls -ltr total 1196452 drwxr-xr-x. 5 oracle dba 85 Jul 7 2014 client drwxr-x---. 13 oracle dba 4096 May 13 15:32 OPatch -rw-r--r--. 1 oracle dba 8487 Jun 13 13:56 custom_install_client.rsp drwxr-xr-x. 2 oracle dba 57 Jun 14 08:26 NetAdm -rw-r--r--. 1 oracle dba 623 Jun 15 09:58 ocm.rsp drwxr-xr-x. 8 oracle dba 4096 Jun 15 09:58 22291127 -rwxr--r--. 1 oracle dba 2333 Jun 22 17:45 install_client.sh
As you can see you will need two response files for the script to function properly.
custom_install_client.rsp is needed for the client installer as the script uses the -responseFile parameter when launching the runInstaller.
ocm.rsp is needed for the opatch utility. This file tells the patch installer your Oracle Support Email address or username therefore you will have to create this file manually before starting the installation with the script. The ocm.rsp file is generated with the emocmrsp tool:
$ $ORACLE_HOME/OPatch/ocm/bin/emocmrsp -output ocm.rsp OCM Installation Response Generator 10.3.7.0.0 - Production Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Provide your email address to be informed of security issues, install and initiate Oracle Configuration Manager. Easier for you if you use your My Oracle Support Email address/User Name. Visit http://www.oracle.com/support/policies.html for details. Email address/User Name: You have not provided an email address for notification of security issues. Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: Y The OCM configuration response file (ocm_opatch.rsp) was successfully created.
My script is calling opatch with the -ocmrf parameter and the response file created above. You can use the ocmrf parameter to specify a response file so opatch can run in non interactive mode:
$ORACLE_HOME/OPatch/opatch apply -silent -ocmrf ocm.rsp
This way the opatch utility will not ask for Oracle Support information as it will read it from the response file.