Quantcast
Channel: Gokhan Atil’s Technology Blog
Viewing all articles
Browse latest Browse all 163

How to Download EM12c R5 Installation Files Using Wget

$
0
0

Although EM12c R5 (12.1.0.5) was released about 2.5 months ago, I couldn’t find time to upgrade our EM12c system until now. I have decided to dedicate my day for upgrading our EM12c. I’m not planning to write a step by step document because it’s already documented well by other bloggers. I’ll just share my notes if I encounter any problem.

I have probably told several times that EM12c should have some internet access, at least, it should be able to reach My Oracle Support website. Luckily, our server has direct-access to the internet (not accepting any incoming connection requests), so I’ll download the installation files directly to the server. Because I like tricky things, I’ll use “wget” instead of an internet browser. I got a sample wget script from Oracle Support Website to download patches, and then modified it to download EM12c files. The script may be helpful if you’re planning to install EM12c to a remote server which you do not have X windows access.

As I said, the script is based on Oracle’s own wget script. I made only a few modifications. First, I needed to modify “–secure-protocol=auto” to “–secure-protocol=TLSv1”. Somehow, secure-protocol=auto didn’t work on our server. Then, I examined the download page of EM12c to find the URLs of installation zips (which belongs to Linux x86-64), and the cookie value which shows that we accept the license agreement (you know you should accept the license agreement to be able to download these files). I modified the script to use the cookie and fetch the correct files. Here’s the script:

#!/bin/sh

# SSO username and password
SSO_USERNAME=YOUREMAIL@YOURDOMAIN.COM
SSO_PASSWORD=YOURPASSWORD

# Path + options to wget command
WGET="/usr/bin/wget --secure-protocol=TLSv1"

# Location of cookie file
COOKIE_FILE=/tmp/$$.cookies

# Log file
LOGFILE=downloadem12c.log

# Contact updates site so that we can get SSO Params for logging in
SSO_RESPONSE=`$WGET --user-agent="Mozilla/5.0" "https://updates.oracle.com/Orion/Services/download" 2>&1|grep Location`

rm -f download

# Extract request parameters for SSO
SSO_TOKEN=`echo $SSO_RESPONSE| cut -d '=' -f 2|cut -d ' ' -f 1`
SSO_SERVER=`echo $SSO_RESPONSE| cut -d ' ' -f 2|cut -d 'p' -f 1,2`
SSO_AUTH_URL=sso/auth
AUTH_DATA="ssousername=$SSO_USERNAME&password=$SSO_PASSWORD&site2pstoretoken=$SSO_TOKEN"

# Login to Oracle Using SSO
$WGET --user-agent="Mozilla/5.0" --post-data $AUTH_DATA --save-cookies=$COOKIE_FILE --keep-session-cookies $SSO_SERVER$SSO_AUTH_URL -O sso.out >> $LOGFILE 2>&1

# Set Cookie to Accept License Agreement
echo ".oracle.com       TRUE    /       FALSE   0       oraclelicense   accept-gridcontrol_linx8664-cookie"     >> $COOKIE_FILE

rm -f sso.out

echo "Downloading em12105_linux64_disk1.zip"
$WGET --user-agent="Mozilla/5.0" --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "http://download.oracle.com/otn/linux/oem/12105/em12105_linux64_disk1.zip" >> $LOGFILE 2>&1
echo "Downloading em12105_linux64_disk2.zip"
$WGET --user-agent="Mozilla/5.0" --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "http://download.oracle.com/otn/linux/oem/12105/em12105_linux64_disk2.zip" >> $LOGFILE 2>&1
echo "Downloading em12105_linux64_disk3.zip"
$WGET --user-agent="Mozilla/5.0" --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "http://download.oracle.com/otn/linux/oem/12105/em12105_linux64_disk3.zip" >> $LOGFILE 2>&1

gitHub-download-button

Let me know if it works for you! By the way, you should enter your SSO login and password to be able to download the installation files.


Viewing all articles
Browse latest Browse all 163

Trending Articles