HOEKSTRA.CO.UK

To download an Oracle install package from the otn.oracle.com website, you need to supply a log-in Id and a password and perform the whole operation via a browser that supports JavaScript. But, how does one download Oracle install packages onto a headless server, i.e. without using a browser?

Possible Approaches

Double-up: Download it using your personal machine via a browser and push it to the target server using SCP. Hmmm... the 11gR2 or Oracle RDBMS package clocks in a 2.4GByte: Do you really want to double up the network consumption and time? Where is your personal machine - in a bandwidth-scarce office environment?

X-Windows: Run a browser from the server over X-Windows on an SSH tunnel. But wait! When you download the file, it stores it on your own machine, not on the server.

Sneaker-Net: Download and burn the package to a DVD (or order it from Mr. Oracle himself) and walk it over to the server. Most seriously-minded companies keep their servers under lock and key and restrict access to only essential infrastructure staff. My servers happen to be on another continent. Where are yours?

The Best and Simplest Approach:

WGET on an remote SSH session on the server

Using the browser on your personal machine, go to otn.oracle.com and find the download page of the packages you want to download.

Click on the Accept Licence Agreement radio button. If you do not do this, the following step will not work. If you have done this correctly, then the radio buttons should disappear.

Right-click on the file that you want to download and copy the file's Link Location. For example, the 11gR2 install package for Linux 64-bit X86, consists of 2 files located at:

http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_1of2.zip

and

http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_2of2.zip

These links, your OTN user Id and password is all the information you need. If you do not yet have an OTN user Id, then now is a good time to get from the OTN website before proceeding.

SSH to the remote server

Connect to the remote headless server:

$ ssh user@remote-server

user@remote-server's password:

Using the WGET command to download

Set up the WGET command with these changes:

  • Add your OTN User Id and password
  • Modify the URL. Change "download" to "download-llnw".

 - to make up the command on your headless server:

$ wget -c --http-user=[User Id] --http-passwd=[password] http://download-llnw.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip

  Connecting to download.oracle.com|87.248.210.254|:80... connected.

HTTP request sent, awaiting response... 206 Partial Content
Length: 1239269270 (1.2G), 1239266129 (1.2G) remaining [application/zip]
Saving to: `linux.x64_11gR2_database_1of2.zip'

6% [=>                              ] 76,091,502   111K/s  eta 3h 43m

 

If you also happen to be downloading the 11gR2 package that consists of two files, run this command again but change it according to the second link:

$ wget -c --http-user=[User Id] --http-passwd=[password] http://download-llnw.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip

Further Improvements

If your headless server looses the session to the Oracle OTN website, then you can resume the download by re-issuing the same command. The "-c" parameter of wget allows you to resume the download from where it was then the session broke.

However, if you loose the connection to your headless server, then the download session to the OTN website also breaks. To prevent this from happening, run this command as an uninterruptable background job, by preceding it with a "nohup" command and appending a "&":

$ nohup wget -c ... &

You can now log off the headless server and come back later to check on progress, by looking at the nohup.out file:

$ tail -f nohup.out

The "-f" parameter gives you a running status report of the download's progress, and you'll see something like this:

103000K .......... .......... .......... .......... ..........  9%  156K 4h10m
103050K .......... .......... .......... .......... ..........  9% 27.5K 4h10m
103100K .......... .......... .......... .......... ..........  9% 36.5K 4h10m
103150K .......... .......... .......... .......... ..........  9%  739K 4h10m
103200K .......... .......... .......... .......... ..........  9% 9.51K 4h11m
103250K .......... .......... .......... .......... ..........  9% 94.9K 4h11m
103300K .......... .......... .......... .......... ..........  9%  106M 4h11m
103350K .......... .......... .......... .......... ..........  9% 70.8K 4h11m
103400K .......... .......... .......... .......... ..........  9% 77.0K 4h11m
103450K .......... ..........

Hit Ctrl-C to stop when this get boring to watch.