Downloading from OTN Directly to your Database Server

by: Marc Fielding

It often comes up that you need to download Oracle software directly to your database server from OTN. Unfortunately, technet.oracle.com is hostile to non-GUI downloads. GNU wget would be the ideal tool for this and binary versions are available many places (AIX binaries for instance are available here). Sadly, OTN does not allow you to authenticate yourself using a command-line download manager such as wget.

Here we present a tremendously useful workaround.

Requirements:

  • wget 1.8+ installed on the database server machine (run wget -h to check, download a pre-compiled binary into a non-root non-Oracle account if you don't have it already.)
  • the database server machine must be able to ping download.oracle.com
  • a machine with an https-enabled lynx - most linuxes have this.

Steps:

  1. Go to your machine with https-enabled lynx.


  2. Make sure that you remove .lynx_cookies first.
    rm .lynx_cookies
  3. Set up a custom lynx configuration file
    cat > lynx.cfg
    SET_COOKIES:TRUE
    PERSISTENT_COOKIES:TRUE
    ACCEPT_ALL_COOKIES:TRUE
    COOKIE_FILE:~/.lynx_cookies
    INCLUDE:/etc/lynx.cfg
    [Control+D]
  4. Copy the URL of the OTN download page you need to the clipboard (the URL should probably end in .gz, for example http://download.oracle.com/otn/aix/oracle9i/9201/server_9201_AIX5L_Disk1.cpio.gz)


  5. Load the web site
    lynx -cfg=./lynx.cfg [URL copied in last step]
    example: lynx -cfg=./lynx.cfg http://download.oracle.com/otn/aix/oracle9i/9201/server_9201_AIX5L_Disk1.cpio.gz


  6. Get an OTN cookie
    You should see a page marked "Please sign in". Use the down-arrow key to navigate to the Username field. Type in your OTN username, press the down arrow key, and type in the the password. Type the down arrow yet again to navigate to the "Continue" button, and press the right arrow key.

    After a number of status messages, you will see a message saying application/x-gzip D)ownload, or C)ancel. Press C to cancel since we're not downloading to this server.


  7. Quit lynx with q y


  8. Verify that the cookies are ok
    cat ~/.lynx_cookies
    You should see three lines starting with ".oracle.com". These are the OTN cookies you need to download the software.


  9. Log onto the client system


  10. Bring over the cookies from your linux or whatnot server to your database server. Use your favorite file transfer utility, such as scp to achieve this file.


  11. And now do the actual download
    wget --load-cookies=.lynx_cookies (OTN download URL) 
    example:
    wget --load-cookies=.lynx_cookies 
    http://download.oracle.com/otn/aix/oracle9i/
    9201/server_9201_AIX5L_Disk1.cpio.gz
    To download additional files from OTN, you can use the same cookie and just re-run the wget command with the new URL.