A while ago I created a Bash script called getMOSPatch.sh. It’s purpose was to allow downloading Oracle patches directly from My Oracle Support to your server without having to visit the support site (of course if you know the patch number already). Today, I announce a new version of the tool “getMOSPatch V2”!
I received mostly very good feedback about the first version of the script, and it probably saved few hours I’d spent on MOS site downloading patches for myself too i.e. when I was working on a project where 900+ needed to be downloaded. But there were some issues too, like, sensitivity to different versions of the utilities the script uses (curl, wget, egrep), and let’s be honest, it worked only on Linux (even though one could have bash on other platforms too). So, I really wanted to make it less dependent on utilities’ versions and wanted it to be more portable, which lead me to understanding that there’s no future for the bash script. 3 Billion Devices “Run” Java, so I couldn’t do anything else but use java for the new version of the getMOSPatch. That was actually an easy decision, because 1) I needed portability, and now you can run the tool with good chances on any platform if you have JRE 1.6 or higher, and 2) JRE is normally bundled with most of Oracle’ software (at least software I work with). So, java it was, and that’s why the new name goes without “.sh” at the end.
The new home for getMOSPatch is here on GitHub: https://github.com/MarisElsins/getMOSPatch.
The parameters you can use for getMOSPatch are the same as before, but if you need you’ll find the usage instructions here.
One thing that changed for the new tool is the way how it’s executed. After downloading the getMOSPatch.jar you’ll use “java -jar getMOSPatch.jar” for JRE 1.7 and later, or “java -Dhttps.protocols=TLSv1 -jar getMOSPatch.jar” for most versions of JRE 1.6 (because the support for TLSv1.1 or TLSv1.2 was not added yet).
Let’s take a look at a typical use case of the utility. I’ll be using the JRE bundled in the 12c Oracle Home on Linux x86-64 to download the newest version of OPatch:[sourcecode] [oracle@lab12c ~]$ wget "https://github.com/MarisElsins/getMOSPatch/raw/master/getMOSPatch.jar" -q [oracle@lab12c ~]$ . oraenv
ORACLE_SID = [LAB12c] ? LAB12c
The Oracle base remains unchanged with value /u01/app/oracle [oracle@lab12c ~]$ export PATH=$ORACLE_HOME/jdk/jre/bin:$PATH [oracle@lab12c ~]$ java -version
java version "1.6.0_75"
Java(TM) SE Runtime Environment (build 1.6.0_75-b13)
Java HotSpot(TM) 64-Bit Server VM (build 20.75-b01, mixed mode) [oracle@lab12c ~]$ java -Dhttps.protocols=TLSv1 -jar getMOSPatch.jar patch=6880880 MOSUserfirstname.lastname@example.org
Enter your MOS password:
Platforms and languages need to be reset.
Obtaining the list of platforms and languages:
46P – Linux x86
226P – Linux x86-64
Enter Comma separated platforms to list: 226P
We’re going to download patches for the following Platforms/Languages:
226P – Linux x86-64
Processing patch 6880880 for Linux x86-64 and applying regexp .* to the filenames:
1 – p6880880_112000_Linux-x86-64.zip
2 – p6880880_121010_Linux-x86-64.zip
3 – p6880880_132000_Generic.zip
4 – p6880880_111000_Linux-x86-64.zip
5 – p6880880_131000_Generic.zip
6 – p6880880_101000_Linux-x86-64.zip
7 – p6880880_102000_Linux-x86-64.zip
Enter Comma separated files to download: 2
Downloading all selected files:
Downloading p6880880_121010_Linux-x86-64.zip: 120MB at average speed of 5671KB/s – DONE!
And here’s another example of this tool running in Windows Powershell environmnet:
If you spot any issues or have ideas for improvements, let me know by commenting this post, or submit the issues directly on GitHub here: https://github.com/MarisElsins/getMOSPatch/issues
Interested in working with Maris? Schedule a tech call.