Wednesday, 25 October 2017

How to upgrade java/jdk used by Weblogic server 12.2.1.3 to different version

==============================================================================
Environment Details:
Weblogic : 12.2.1.3
OS : Linux
==============================================================================
In this case we are going to install new java/jdk to different location and change JAVA_HOME variable in all scripts using it.
So let's get started.

Have installed jdk1.8.0._151 in the directory /u02/oracle12213/custom/java/ and provided permissions 775 to it.

[oracle@demomachine ~]$ cd /u02/downloads/
[oracle@demomachine downloads]$ ll
total 1186004
-rwxrwxr-x. 1 oracle oracle 839208313 Aug 21 12:39 fmw_12.2.1.3.0_wls.jar
-rwxrwxr-x. 1 oracle oracle 185516505 Jul 25 21:06 jdk-8u141-linux-x64.tar.gz
-rw-rw-r--. 1 oracle oracle 189736377 Oct 24 01:35 jdk-8u151-linux-x64.tar.gz
[oracle@demomachine downloads]$ chmod -R 775 *
[oracle@demomachine downloads]$ ll
total 1186004
-rwxrwxr-x. 1 oracle oracle 839208313 Aug 21 12:39 fmw_12.2.1.3.0_wls.jar
-rwxrwxr-x. 1 oracle oracle 185516505 Jul 25 21:06 jdk-8u141-linux-x64.tar.gz
-rwxrwxr-x. 1 oracle oracle 189736377 Oct 24 01:35 jdk-8u151-linux-x64.tar.gz
[oracle@demomachine downloads]$ tar -xzf jdk-8u151-linux-x64.tar.gz -C /u02/oracle12213/custom/java/
[oracle@demomachine downloads]$ cd /u02/oracle12213/custom/java/
[oracle@demomachine java]$ ll
total 0
drwxrwxr-x. 8 oracle oracle 255 Jul 12 17:11 jdk1.8.0_141
drwxr-xr-x. 8 oracle oracle 255 Sep  6 08:02 jdk1.8.0_151
[oracle@demomachine java]$ chmod -R 775 jdk1.8.0_151/
[oracle@demomachine java]$

Oracle home and domain home is under /u02 so going to find out the files which are having jdk1.8.0_141 configred in it using below linux command,
grep -iworI 'jdk1.8.0_141' . | uniq | egrep -v "/logs/|/adr/|\.log|\.out|/.patch_storage|/inventory" | tr ':' ' ' |awk '{print $1}'

[oracle@demomachine u02]$ grep -iworI 'jdk1.8.0_141' . | uniq | egrep -v "/logs/|/adr/|\.log|\.out|/.patch_storage|/inventory" | tr ':' ' ' |awk '{print $1}'
./oracle12213/oracle_home/middleware/oui/bin/launch.sh
./oracle12213/oracle_home/middleware/oui/bin/viewInventory.sh
./oracle12213/oracle_home/middleware/oui/bin/compareInventory.sh
./oracle12213/oracle_home/middleware/oui/bin/setProperty.sh
./oracle12213/oracle_home/middleware/oui/.globalEnv.properties
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/bin/setDomainEnv.sh
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/bin/setNMJavaHome.sh
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/domain-info.xml
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/startscript.xml
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/tokenValue.properties
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/nodemanager-properties.xml
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/nodemanager/nodemanager.properties


There are few files which need not to be changed,
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/domain-info.xml
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/startscript.xml
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/tokenValue.properties
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/nodemanager-properties.xml

Files which need to changed are,
./oracle12213/oracle_home/middleware/oui/bin/launch.sh
./oracle12213/oracle_home/middleware/oui/bin/viewInventory.sh
./oracle12213/oracle_home/middleware/oui/bin/compareInventory.sh
./oracle12213/oracle_home/middleware/oui/bin/setProperty.sh
./oracle12213/oracle_home/middleware/oui/.globalEnv.properties
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/bin/setDomainEnv.sh
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/bin/setNMJavaHome.sh
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/nodemanager/nodemanager.properties

Shutdown all servers and nodemanager.
Take backup of domain and oracle home direcotries.

Edit all the below files and change JAVA_HOME location from /u02/oracle12213/custom/java/jdk1.8.0_141 to /u02/oracle12213/custom/java/jdk1.8.0_151
-----------------------------------------------------------
$oracle_home/oui/bin/launch.sh

# pre-install env: JAVA_HOME_LOCATION not stringsubbed
# post-install env: JAVA_HOME_LOCATION is stringsubbed
#JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_141"
JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_151"
------------------------------------------------------------
$oracle_home/oui/bin/viewInventory.sh

# OUI platform name used at install time
PLATFORM_NAME="Linux_AMD64"

#JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_141"
JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_151"
-----------------------------------------------------------------
$oracle_home/oui/bin/compareInventory.sh

# pre-install env: JAVA_HOME_LOCATION not stringsubbed
# post-install env: JAVA_HOME_LOCATION is stringsubbed
#JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_141"
JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_151"
----------------------------------------------------------------------
$oracle_home/oui/bin/setProperty.sh

#JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_141"
JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_151"
----------------------------------------------------------------------
$oracle_home/oui/.globalEnv.properties

#Sat Oct 21 17:55:26 IST 2017
#JAVA_HOME=/u02/oracle12213/custom/java/jdk1.8.0_141
#JAVA_HOME_1_8=/u02/oracle12213/custom/java/jdk1.8.0_141
JAVA_HOME=/u02/oracle12213/custom/java/jdk1.8.0_151
JAVA_HOME_1_8=/u02/oracle12213/custom/java/jdk1.8.0_151
---------------------------------------------------------------------
$domain_home/bin/setDomainEnv.sh

#SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_141"
SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_151"
export SUN_JAVA_HOME

#DEFAULT_SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_141"
DEFAULT_SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_151"
export DEFAULT_SUN_JAVA_HOME

else
                JAVA_VENDOR="Oracle"
                export JAVA_VENDOR
                #JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_141"
                JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_151"
                export JAVA_HOME

----------------------------------------------------------------------
$domain_home/bin/setNMJavaHome.sh

#SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_141"
SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_151"
export SUN_JAVA_HOME

#DEFAULT_SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_141"
DEFAULT_SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_151"
export DEFAULT_SUN_JAVA_HOME

 else
                JAVA_VENDOR="Oracle"
                export JAVA_VENDOR
                #JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_141"
                JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_151"
                VM_TYPE="HotSpot"

----------------------------------------------------------------------------
$domain_home/nodemanager/nodemanager.properties

#JavaHome=/u02/oracle12213/custom/java/jdk1.8.0_141
JavaHome=/u02/oracle12213/custom/java/jdk1.8.0_151

----------------------------------------------------------------------------
Restart nodemanager and servers.
Login to admin console. Click on Environment -> servers -> monitoring and verify the java version.

WebLogic Home:
/u02/oracle12213/oracle_home/middleware/wlserver
Middleware Home:
/u02/oracle12213/oracle_home/middleware
Java Vendor:
Oracle Corporation
Java Version:
1.8.0_151
OS Name:
Linux
OS Version:
3.10.0-693.el7.x86_64

1 comment: