Tuesday, June 2, 2020

// // Leave a Comment

Shell Command/Script to extract Oracle EPM/Hyperion already applied patches in Linux/Unix server

Hi Friends,

Topic: How to extract Oracle Hyperion patches currently applied in your Hyperion environment using shell/bash script

In this post, we will see how you can extract all the Oracle Hyperion patches currently applied in your Hyperion environment Linux servers. I am sure you would have seen Oracle Hyperion Essbase application installed and configured on Linux/Unix server in many Hyperion setups. 

When you plan to apply any newly released Oracle patches to upgrade your Hyperion applications patch level, you may need to first know the currently applied Oracle patches for that particular Hyperion application. 

For the Windows Servers, to know how to extract Oracle Hyperion patches currently applied in your Hyperion environment using a batch script, you may like to read this post: Batch script to extract Oracle Hyperion patches currently applied

Note: 
  • This post has been written and associated activities have been demonstrated on Oracle Hyperion version 11.1.2.4.
  • The demonstrating Hyperion Essbase application server has the 'Red Hat Enterprise Linux Server release 6.10' operating system.
Concept:

As you know, we all use ./opatch lsinventory command in order to see details of all the patches that are currently installed on a Hyperion Linux/Unix server.

The lsinventory command reports what has been installed on the system for a particular Oracle home directory, or for all installations. 

The following syntax is used for this command (on Linux/Unix machine):

./opatch lsinventory -oh /apps/OracleEPM/Middleware/EPMSystem11R1

where -oh option is your Oracle Home location. 


Shell script to extract Oracle Hyperion patches currently applied

The result of ./opatch lsinventory command contains a lot of data like various versions, paths, bugs fixed, overlaying patch details, etc as shown in the below image. So in order to list out only the Oracle patch numbers and when they were applied you need to go through all the details generated as a result of ./opatch lsinventory command then extract the required details manually.

Shell script to extract Oracle Hyperion patches currently applied

The below-mentioned shell/bash script does all these things for you automatically by extracting out only the Oracle patch numbers with the date when they were applied. It saves the output into a log file for your record along with saving your manual effort. 

On Command prompt:

If you want to see all the applied patch list directly on your EPM/Hyperion Linux/Unix server's command prompt, run the below commands:

To see all installed patches:
----------------------------------------
cd /apps/oracle/epm/Middleware/EPMSystem11R1/OPatch

For EPMSystem11R1 patches:
./opatch lsinventory -oh /apps/oracle/epm/Middleware/EPMSystem11R1 -jdk /apps/oracle/epm/Middleware/jdk160_35 -invPtrLoc /apps/oracle/epm/Middleware/EPMSystem11R1/oraInst.loc | grep -i applied

For oracle_common patches:
./opatch lsinventory -oh /apps/oracle/epm/Middleware/oracle_common -jdk /apps/oracle/epm/Middleware/jdk160_35 -invPtrLoc /apps/oracle/epm/Middleware/oracle_common/oraInst.loc | grep -i applied

How to extract Oracle EPM/Hyperion already applied patches in Linux/Unix server

To see a particular installed patch:
---------------------------------------------
cd /apps/oracle/epm/Middleware/EPMSystem11R1/OPatch

For EPMSystem11R1 patches:
./opatch lsinventory -oh /apps/oracle/epm/Middleware/EPMSystem11R1 -jdk /apps/oracle/epm/Middleware/jdk160_35 -invPtrLoc /apps/oracle/epm/Middleware/EPMSystem11R1/oraInst.loc | grep -i "applied" | grep -i "28314691"

For oracle_common patches:
./opatch lsinventory -oh /apps/oracle/epm/Middleware/oracle_common -jdk /apps/oracle/epm/Middleware/jdk160_35 -invPtrLoc /apps/oracle/epm/Middleware/oracle_common/oraInst.loc | grep -i "applied" | grep -i "18514458"

Shell/Bash Script:

Create a folder (/apps/Admin) in the Hyperion Linux/Unix server where you want to extract the installed Oracle patch list and then create a shell/bash script (/apps/Admin/test.shwith the below codes under that folder.

#!/bin/bash

cd /apps/OracleEPM/Middleware/EPMSystem11R1/OPatch

./opatch lsinventory -oh /apps/OracleEPM/Middleware/EPMSystem11R1 > /apps/Admin/Patch_History.txt

cd /apps/Admin

truncate -s 0 /apps/Admin/Installed_Patches_$HOSTNAME.txt

grep -w "Interim patches" /apps/Admin/Patch_History.txt >>/apps/Admin/Installed_Patches_$HOSTNAME.txt

grep -w "applied" /apps/Admin/Patch_History.txt >>/apps/Admin/Installed_Patches_$HOSTNAME.txt

When you run this test.sh script via bash command line, it will extract out the following things for you:
  1. Total number of Oracle patches
  2. Patch numbers of all the currently applied Oracle Hyperion patches
  3. Date of applying these patches
It will also save the output in a log file with your Linux/Unix server HOSTNAME appended in the log file name.

Below is the directory structure and the output format of the above-given script:

Shell script to extract Oracle Hyperion patches currently applied

You can run this script across all the Linux/Unix servers of your Hyperion environment to extract the list of applied Oracle Hyperion patches. 

In order to see which Oracle Hyperion applications your extracted patch numbers belong to, simply do the following:  
  • Go to https://support.oracle.com.
  • Select the Patches & Updates tab.
  • In Patch Search, enter the patch number. 
  • Make sure you are searching for a Patch Name or Number and select Search.
The corresponding Hyperion application name with patch details will be displayed. 

That's all for this post.

I hope this article has helped you. 
Your suggestions/feedback are most welcome.
Keep learning and Have a great day!!!

0 comments:

Post a Comment