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

This entry was posted in Oracle on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply