Script to download Oracle Patch

Downloading Oracle software, patch or patch-set via web browser is handy if you need the software on your client PC or if you just download small patch’s. As soon as you want, however, download a greater volume of patches or a large patch set, it gets cumbersome. After downloading the patch must be copied to the target system. All steps could be quite time consuming depending on your network throughput.

WGET Option

Since a while it is possible to select a WGET Option in the download dialog rather than downloading each file individual (red box in the picture below).

MOS download dialog

In a new dialog box you then my download or copy the wget download script for the selected patch’s.

MOS download wget

Before starting the download via script the MOS credential have to be modified eg. SSO_USERNAME=youraccount


So far so good, but currently it is now working. According to Oracle Support this is a known issue and there is the Bug 12372706: WGET SCRIPTS FROM MOS FAIL IN PRODUCTION.

To workaround each file has to be downloaded manually with wget.

wget --http-user=username --http-password=password --no-check-certificate \
--output-document=filename "paste the above copied address here in quotes"

The URL’s can be copied from the download dialog above. If more than just one patch have to be downloaded wget can be put in a for loop which get’s the URL’s from a text file.

Download URL’s

Text File with Patch URL’s

#Linux x86-64

Download more patch

For loop to download the patch’s:

for i in $(cat download_url.txt|grep -v ^#)
OUTPUT_FILE=$(echo "$i"|cut -d= -f3)
echo "download $OUTPUT_FILE from '$i'" >> $LOGFILE 2>&1
wget --http-user=MOS_USER --http-password=MOS_PASSWORD --no-check-certificate \
-O $OUTPUT_FILE "$i" >> wget_logfile.log 2>&1

MOS Download Script

I’ve put everything in a small script. To download the patch a text with the download URL’s have to be specified -h
INFO : Usage,  [-hv]
INFO :        -h             Usage (this message)
INFO :        -u <user>      MOS user account
INFO :        -p <password>  MOS password
INFO :        -f <file>      Text file with download url
INFO :                       Logfile :

Run the script with nohup on a stage server to download a few patchs.

nohup  -u -p secret -f download_url.txt &

The script can be downloaded in the script section of OraDBA or direct (