What is ORACLE_HOME,MW_HOME,WL_HOME in Weblogic 12c

The Objective

In this post, we are going to see what are the different types of home directories available in weblogic and the various options or methods to find the ORACLE_HOME, MW_HOME and WL_HOME of your weblogic 12c installation. The commands and the methods are mostly given for the LINUX based infrastructure.

 

Definition of these Home Directories as per ORACLE

I know its little too theoretical. I am giving it just to give you the clear big picture. We will anyhow see how to practically find these directories in this post.

  • MW_HOME: This variable and related directory path refers to the location where Oracle Fusion Middleware resides. A MW_HOME has a WL_HOME, an ORACLE_COMMON_HOME and one or more ORACLE_HOMEs.
  • WL_HOME: This variable and related directory path contain installed files necessary to host a WebLogic Server, for example.MW_HOME/wlserver_10.3
  • ORACLE_HOME: This variable points to the location where an Oracle Fusion Middleware product, such as Oracle HTTP Server, Oracle SOA Suite, or Oracle Internet Directory is installed and the binaries of that product are being used in a current procedure. For example: MW_HOME/iam
  • ORACLE_COMMON_HOME: This variable and related directory path refer to the location where the Oracle Fusion Middleware Common Java Required Files (JRF) Libraries and Oracle Fusion Middleware Enterprise Manager Libraries are installed. An example is: MW_HOME/oracle_common

 

Understanding it with Example.

I have weblogic 12c running on my laptop(mac).   This is how I will find my different homes after installation is done.

Being aware of the fact that all the paths are circles around WL_HOME. My First task is to find the WL_HOME.

 

 

Step1: Finding WL_HOME

I propose three methods to find the WL_HOME

If you have a running JVM (Admin Server/Managed Server)

If you have a running JVM , you can just ps -eaf|grep -i <AdminServer/Managed Server> in the resulting classpath of the JVM you can find -Dweblogic.home this is denoted  as $WLS_HOME

 Be advised $WLS_HOME and $WL_HOME are two different directories

aksarav@middlewareinventory:$ ps -eaf|grep -i AdminServer|fmt|grep -i "\-Dweblogic.home" --color 
-Dweblogic.home=/apps/oracle-weblogic/wls12213/wlserver/server

in my case the WLS_HOME is   -Dweblogic.home=/apps/oracle-weblogic/wls12213/wlserver/server

One level out to the WLS_HOME is our WL_HOME

WL_HOME = $WLS_HOME/..

So my WL_HOME is apps/oracle-weblogic/wls12213/wlserver

Using find command and the location of the weblogic.jar file

Using the weblogic.jar file location also you could find your oracle_home. Consider the following trick done with find and awk commands.

aksarav@middlewareinventory:/apps/oracle-weblogic/wls12213$ find /apps -name "weblogic.jar"
/apps/oracle-weblogic/wls12213/wlserver/server/lib/weblogic.jar

aksarav@middlewareinventory:/apps/oracle-weblogic/wls12213$ find /apps -name "weblogic.jar"|sed 's/\// \//g'|awk '{print $1$2$3$4}'
/apps/oracle-weblogic/wls12213/wlserver

 

Using SetDomainEnv.cmd script

Go into your domain/bin directory and execute setDomainEnv.sh script

After executing the setDomainEnv script. you can just echo out the MW_HOME and WL_HOME variables just shown in the following snapshot.

 

Step2: Finding MW_HOME

Having found that the WL_HOME directory is /apps/oracle-weblogic/wls12213/wlserver now let us derive other home directories

MW_HOME = $WLS_HOME/../..
MW_HOME = $WL_HOME/..

The preceding snippet shows the easy way to find my MW_HOME.  It basically indicates that one level out to WL_HOME is my MW_HOME

Therefore my MW_HOME is /apps/oracle-weblogic/wls12213

 

Step3: Finding ORACLE_COMMON_HOME

ORACLE_COMMON_HOME represents the location of oracle_common directory which resides in the MW_HOME therefore

ORACLE_COMMON_HOME = $MW_HOME/oracle_common

 

Step4: Finding ORACLE_HOME

As stated by Oracle. There can be one or many oracle homes present under the same MW_HOME. which means, ORACLE_HOME represents the product  installation location in the ERA of Fusion Middleware Infrastructure ( where we install various oracle products like Http server, weblogic, Identity manager together)

So the basic formula to find ORACLE_HOME is that

ORACLE_HOME = MW_HOME/<product home directory>

i.e
ORACLE_HOME = $MWHOME/iam
ORACLE_HOME = $MWHOME/weblogic12.2.1
ORACLE_HOME = $MWHOME/ohs

To find the list of Oracle home available in your server the best and easy way is to use the OraInventory (oracle inventory)

 

Finding ORACLE_HOME directories Through OraInventory

In general, the Orainventory or Oracle inventory will be created in the weblogic user's home directory.  (unless you choose different path during the installation using oraInst.loc file)

If that's the case. You can simply use the inventory.xml file to get the oracle_home

cat ~/oraInventory/ContentsXML/inventory.xml

 

Enough of these HOMES.  But eagerly waiting for the  HOLMES (Sherlock Holmes 3)  🙂

Hope this helps

Thanks,
SaravAK

Follow me on Linkedin My Profile
Follow DevopsJunction onFacebook orTwitter
For more practical videos and tutorials. Subscribe to our channel

Buy Me a Coffee at ko-fi.com

Signup for Exclusive "Subscriber-only" Content

Loading