Home » Oracle » Oracle Database » How to run Opatch in non interactive form

How to run Opatch in non interactive form

How to run Opatch in non interactive form

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

How to run Opatch in a non-interactive form

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

SYNTAX:
opatch <option> -silent

Option :
apply
napply
rollback
nrollback

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.

The script will be like this

for i in `patch1 patch2 patch3`
do
cd $PATCH_TOP/$i
$ORACLE_HOME/OPatch/opatch apply -silent
done
PROD_appl_TEST$ opatch apply -silent

Oracle Interim Patch Installer version 1.0.0.0.61
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 (https://myoraclesupport.oracle.com)
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/liboraInstaller.so
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.

I hope this helps in working with opatch for several patches

See also  TDE encryption in Oracle 12c step by step

Related Articles
rollback the Oracle patch: check out this on how to rollback the Oracle patch like database patch, application patch, and Application server patch with detailed steps
download Patch from Oracle using Wget: Downloading Oracle patches from the Oracle website is time consuming. We download Patch from Oracle using Wget directly to the server to save time and energy
check patches applied in WebLogic: This page contains details on how to check patches applied in weblogic in version 10.3.6,12.1.1,12.1.1 above with commands
How to check oracle version: check out how to find the version of Oracle database. what is the latest Oracle Version, what is innovation and long-term release
opatch version command: check out this post on How to check the opatch version or opatch version command, apply the patch(opatch apply), Upgrade, opatch lsinventory

Leave a Comment

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

Scroll to Top