Saturday 28 October 2017

OEM 13c installer failed to start becuase of Failed prerequisite Checking monitor: must be configured to display at least 256 colors. Actual unknown. Failed

========================================================================
Environment Details:
OEM : 13c (13.2.0.0)
OS : Linux6

========================================================================
Problem Summary:
Am trying to invoke OEM installer for OEM installation but it's getting failed becuase of prerequisite failure.

Error:
-bash-4.1$ /u01/OEM13c_Soft/em13200_linux64.bin
0%.........................................................................100%
Launcher log file is /tmp/OraInstall2017-10-27_02-42-25AM/launcher2017-10-27_02-42-25AM.log.
Starting Oracle Universal Installer

Checking if CPU speed is above 300 MHz.   Actual 2295.051 MHz    Passed
Checking monitor: must be configured to display at least 256 colors.  Actual unknown.   Failed <<<<
Checking swap space: must be greater than 512 MB.   Actual 34287 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)

Some system prerequisite checks failed.
You must fulfill these requirements before continuing.

Continue? (yes [y] / no [n]) [n]
n
You have confirmed that the product cannot be installed on this platform.
Quitting the installation.
The log is located here: /tmp/OraInstall2017-10-27_02-42-25AM/launcher2017-10-27_02-42-25AM.log.

========================================================================
Root Cause:
Was using root/superuser user to trigger installer instead of oracle which holds ownership of OEM installer.

========================================================================
Resolution:
1. Close the session which you have logged in with root user.
2. Login to the host as oracle user.
Kindly note if you login to host using root and then switch to oracle might not work and you may end up in same error so you have to start a new session and directly login as oracle user.
4. Go to OEM13c installer directory and invoke installer.

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

Friday 20 October 2017

WLST to decrypt Weblogic, jdbc and java keystore passwords offline

We can decrypt weblogic, jdbc and java keystore passwords offline using WLST.

Kindly follow below steps to decrypt them offline using WLST ( No Script/Online dependency ):
1.      Login to admin server host
2.      Go to $ORACLE_HOME/oracle_common/common/bin
3.      Invoke wlst.sh OR wlst.cmd
4.      wls:/offline> domain = "<$domain_home_path>"
5.      wls:/offline> service = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domain)
6.      wls:/offline> encryption = weblogic.security.internal.encryption.ClearOrEncryptedService(service)
7.      wls:/offline> print encryption.decrypt("<encrypted password>")
Please note, in encrypted string we have to remove backward slash symbol.

Examples:
For Linux:
[oracle@demomachine ~]$ cd /u02/oracle12213/osb/oracle_home/oracle_common/common/bin
[oracle@demomachine u02]$./wlst.sh

wls:/offline> domain = "/u02/Oracle12213/osb/domain/dev_domain "
wls:/offline> service = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domain)
wls:/offline> encryption = weblogic.security.internal.encryption.ClearOrEncryptedService(service)
wls:/offline> print encryption.decrypt("{AES}577uW8U1WXvE9Ep+9gw7V3ZfJiyjD5TDT3id5X9LtdE= ")
weblogic


For Windows:
C:\windows\system32>cd C:\Oracle12213\Middleware\Oracle_Home\oracle_common\common\bin
C:\Oracle12213\Middleware\Oracle_Home\oracle_common\common\bin>wlst.cmd

Initializing WebLogic Scripting Tool (WLST) ...

Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> domain = "C:\\Oracle12213\\Middleware\\Oracle_Home\\user_projects\\domains\\dev_domain"
wls:/offline> service = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domain)
wls:/offline> encryption = weblogic.security.internal.encryption.ClearOrEncryptedService(service)
wls:/offline> print encryption.decrypt("{AES}Rx9/lKeFMhllwNMYXWtC+DryFL9zU3MypEPLNtJ+W4w=")
weblogic123

=========================================================================================
Issues Faced:
You may face below issue while decrypting passwords if you don’t remove backward slash symbol.

Error:
wls:/offline> print encryption.decrypt("{AES}Rx9/lKeFMhllwNMYXWtC+DryFL9zU3MypEPLNtJ+W4w\=")
Traceback (innermost last):
  File "<console>", line 1, in ?
        at weblogic.security.internal.encryption.JSafeEncryptionServiceImpl.decryptBytes(JSafeEncryptionServiceImpl.java:144)
        at weblogic.security.internal.encryption.JSafeEncryptionServiceImpl.decryptString(JSafeEncryptionServiceImpl.java:192)
        at weblogic.security.internal.encryption.ClearOrEncryptedService.decrypt(ClearOrEncryptedService.java:99)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)

weblogic.security.internal.encryption.EncryptionServiceException: weblogic.security.internal.encryption.EncryptionServiceException: com.rsa.jsafe.JSAFE_InputException: Invalid input.

Resolution:
If you are facing above error, kindly delete backward slash symbols from the encrypted string and retry.
e.g. From {AES}Rx9/lKeFMhllwNMYXWtC+DryFL9zU3MypEPLNtJ+W4w\=
To {AES}Rx9/lKeFMhllwNMYXWtC+DryFL9zU3MypEPLNtJ+W4w=

Managed server failed to start becuase of Failed to invoke startup class "JRF Startup Class", java.lang.ClassNotFoundException: oracle.jrf.wls.JRFStartup

========================================================================
Environment Details:
Weblogic : 10.3.6
OSB : 11.1.1.7.0
OS : Windows 10

========================================================================
Problem Summary:
Am using weblogic admin console to start managed server but unable to start managed server because of Failed to invoke startup class "JRF Startup Class", java.lang.ClassNotFoundException: oracle.jrf.wls.JRFStartup

Error:
<Oct 16, 2017 8:10:24 PM IST> <Notice> <Log Management> <BEA-170019> <The server log file C:\OraclePS6\Middleware\user_projects\domains\osb_domain\servers\osb_server1\logs\osb_server1.log is opened. All server side log events will be written to this file.>
<Oct 16, 2017 8:10:28 PM IST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<Oct 16, 2017 8:10:30 PM IST> <Critical> <WebLogicServer> <BEA-000286> <Failed to invoke startup class "JRF Startup Class", java.lang.ClassNotFoundException: oracle.jrf.wls.JRFStartup
java.lang.ClassNotFoundException: oracle.jrf.wls.JRFStartup
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
Truncated. see log file for complete stacktrace
>

========================================================================
Root Cause:
StartScriptEnabled is set to false in nodemanager.properties.

========================================================================
Resolution:
1. Open C:\OraclePS6\Middleware\wlserver_10.3\common\nodemanager\nodemanager.properties on the managed server machine.
2. Set StartScriptEnabled=true.
3. Restart the node manager.
4. Stop the managed server.
5. Start the managed server from Admin console.