Tuesday 16 May 2017

Apply weblogic patches in bulk using unix script.

If you apply more than one weblogic patches, then you have to either run the bsu.sh (located at $ORACLE_HOME/utils/bsu) in GUI mode or 1 by 1 in console mode. You can use the below script to install all the patches in one run.


follow the below steps:


1. Create a directory named /tmp/WLS_Patch
2. Put all the patches zip in the above directory
3. Create a sh file name run.sh and copy the below text into the file and save it.


echo "*********************"
echo Upgrade WLS
echo "*********************"
mkdir $ORACLE_HOME/utils/bsu/cache_dir
cd $ORACLE_HOME/utils/bsu/cache_dir
yes | find /tmp/WLS_Patch -name \*.zip -exec unzip  {} \;

cd ..
for i in 56MM CM69 FSG4 IMWL VRGR XA6W YVDZ ZARV
do

 ./bsu.sh -prod_dir=$WL_HOME -patchlist=$i -verbose -install | tee $i.out
 grep "Result: Success" $i.out
 if [ $? -ne 0 ]
 then
  echo "Unexpected issue applying patch $i. Check file $i.out"
  exit 1
 fi
done

echo "*********************"
echo WLS Upgraded
echo "*********************"



4. Replace the ORACLE_HOME and WL_HOME with the appropriate value as per your environment.
5. Add the patch alias name in the for loop list (highlighted in bold)
6. Save the file and run the script.
7. if any error occurred check the i.out file generated where the script is located.







No comments:

Post a Comment

Followers

OIM API for adding process task and retry failed task

 In this blog you can find how to add new process task and retry any failed/rejected tasks using API. Adding new process task: /************...