Wednesday, August 10, 2016

Downloading Oracle 11g XE on headless machines

To download Oracle products like Oracle XE or JDK, we need to visit Oracle site and accept a license and also may have to log into OTN from a browser in order to download. On headless machines, you can still download using "curl" or "wget" by setting appropriate cookies. In order to get the correct cookie, you will have to open the "download.oracle.com" site from a machine with a browser and then copy the cookie value for "Host:edelivery.oracle.com" using Chrome->Developer Tools and pass it to curl on the headless machine. E.g.


curl -v -j -k -L -H "Cookie: _ga=GA1.2.281280113.1444226476; s_fid=4F07C7A4FC8D19B8-3F875E44865B80E4; ORA_WWW_MRKT=v:1~g:1510B7015351B4A1E050E60A8D7F2297~t:EMPLOYEE~c:MP05; ORA_WWW_PERSONALIZE=v:1~i:NOT_FOUND~r:NOT_FOUND~g:NOT_FOUND~l:NOT_FOUND~cs:NOT_FOUND~cn:NOT_FOUND; s_nr=1469210337690; atgRecVisitorId=131Dsnb..A16; oraclelicense=accept-sqldev-cookie; gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fdatabase%2Fdatabase-technologies%2Fexpress-edition%2Fdownloads%2Findex.html; s_sq=%5B%5BB%5D%5D; ORASSO_AUTH_HINT=v1.0~20160811010208; ORA_UCM_INFO=3~1510B7015351B4A1E050E60A8D7F2297~<OTN Login>; OHS-edelivery.oracle.com-443=539...B4~" http://download.oracle.com/otn/linux/oracle11g/xe/oracle-xe-11.2.0-1.0.x86_64.rpm.zip -o oracle-xe-11.2.0-1.0.x86_64.rpm.zip