|
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:
- Go to your machine with https-enabled lynx.
- Make sure that you remove .lynx_cookies first.
rm .lynx_cookies
- 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]
- 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)
- 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
- 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.
- Quit lynx with q y
- 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.
- Log onto the client system
- 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.
- 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.
|