How to run Opatch in non interactive form




We must have feel the pain when you have apply multiple patches and each time you have give Y to the prompt in opatch. There is solution available to this problem

How to run Opatch in non interactive form

We can run the opatch apply, napply, rollback and nrollback commands in non-interactive mode using the opatch argument ‘-silent’.

opatch <option> -silent

Option :

The following command can be used to apply a patch (777777 in this example) in silent mode:

$ cd 777777
$ opatch apply -silent

‘opatch <option> -silent’ does the following
– suppresses any user-interaction i.e does not show any opatch prompts for the user input
– automatically answers all the opatch prompts by taking the default options as input and continues

For example:
During one-off patch installations, opatch prompts you with the following message and waits for user response/input:
“Is the Local system ready for patching: [Y]/N ”
In silent mode, opatch automatically takes the default option of ‘Y’ as input for the prompt above and then continues.

So when u need to apply multiple patches,then you can create a script and silent option in the script.
PROD_appl_TEST$ opatch apply -silent

Oracle Interim Patch Installer version
Copyright (c) 2009 Oracle Corporation. All Rights Reserved..

Oracle recommends you to use the latest OPatch version
and read the OPatch documentation available in the OPatch/docs
directory for usage. For information about the latest OPatch and
other support-related issues, refer to document ID 293369.1
available on My Oracle Support (

Oracle Home : /abc/oracle/TEST/apps/tech_st/10.1.2
Oracle Home Inventory : /abc/oracle/TEST/apps/tech_st/10.1.2/inventory
Central Inventory : /var/opt/oracle/oraInventory
from : /var/opt/oracle/oraInst.loc
OUI location : /abc/oracle/TEST/apps/tech_st/10.1.2/oui
OUI shared library : /abc/oracle/TEST/apps/tech_st/10.1.2/oui/lib/solaris/
Java location : /abc/oracle/TEST/apps/tech_st/10.1.2/jre/1.4.2/bin/java
Log file location : /abc/oracle/TEST/apps/tech_st/10.1.2/.patch_storage/<patch ID>/*.log

Creating log file “/abc/oracle/TEST/apps/tech_st/10.1.2/.patch_storage/77777777/Apply_77777777_09-17-2015_08-39-22.log”

Invoking fuser to check for active processes.

Backing up comps.xml …

OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.
Please shut down Oracle instances running out of this ORACLE_HOME
(Oracle Home = /abc/oracle/TEST/apps/tech_st/10.1.2)
Is this system ready for updating?
Please respond Y|N >
Y (auto-answered by -silent)

Applying patch 77777777…

Patching archive files…

Running make for target install.

Inventory is good and does not have any dangling patches.
Updating inventory…

Verifying patch…
Backing up comps.xml …
OPatch succeeded.