opatchauto returns with error code = 2 error during patching in Oracle

opatchauto returns with error code = 2 error during patching in Oracle

Error

[root@RAC1 patches]# $ORACLE_HOME/OPatch/opatchauto apply /u01/patches/28183653


opatchauto must run from Grid Home with current arguments. Please retry it inside Grid Home
opatchauto returns with error code = 2

Cause
Specified Oracle Home is not set or wrong set.

Solutions
1. Check the value of Oracle Home.

-- Linux Environment
echo $ORACLE_HOME
or
-- Windows Environment
C:\Users\Oracle>echo %ORACLE_HOME%

2. Then Set the Oracle Home of Database if it set of Grid home or its set wrong value or may its unset.

-- Set the Oracle Home in Linux environment
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/12.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=sales1


-- Set the Oracle Home in Windows Environment
set ORACLE_BASE=C:\oracle
set ORACLE_HOME=C:\Oracle\12.2.0\dbhome_1
set PATH=%ORACLE_HOME%\bin;%PATH%
set ORACLE_SID=sales1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.