Oracle Oui Silent Installs

I’ve been working on this all week and I finally made a breakthrough for this today. The task at hand was to automate the install of the Oracle Data Access Components for OLE DB for 10g. At my work we prefer to script everything so if anyone gets knocked down by a bus, someone else should be able to just run the script (good best practice in my opinion). We also want scripted uninstalls, so that if it all goes wrong, we just run the backout script.

The Oracle Universal Installer is a java based application and when invoked in the right way, it can record what’s called a response file. It basically contains everything that you tick, configure and puts it into a text file. The Oracle documentation describe the process very easily…see this link

(By the way this is a Windows tutorial, I haven’t messed about with the unix side).

To summarise the docs, you download whatever Oracle software involved, in my case, ODAC for OLE 10g. Decompress it into a directory on a test server and run the setup with the following switches:

1setup.exe -record -responsefile <complete path and name of file>

OUI seems to be quite “fussy” over how you call it, so make sure you include the .exe file extension and the full path of the response file you want to create.

Now when you want to run this as an unattended batch script , its best to call the setup.exe from the same directory you run your script in. The command to run is:

1setup.exe -silent <complete path and name of file>

Easy you say. Well yes that was the easy bit. The response file can be customised to do all sorts of things, like reduce the amount of text coming out on screen etc…(you’ll have to go back to Oracle for what to do there, I’m no Oracle expert).

What wasn’t so easy was trying to do the reverse in script. Running the setup.exe with the -deinstall script launches the OUI, and appears to get so far then sits and waits for user intervention. Not good for automated installations.

The trick here was to amend the response file…..it took me about two weeks to figure this out.

Find the bit in the response file that says:

1SHOW_DEINSTALL_CONFIRMATION = true

and set it to false. This means the install won’t ask you if it’s ok to remove it’ll just do it. That in conjuction with the following commandline:

1setup.exe -deinstall -silent -responsefile <full path and name of file>

Get’s the job done.

The only other problem to solve (which got sorted out fairly early on in this piece of work was the annoying way the java.exe process stays open because the install waits for a user to press [enter] at the end of it. I played around with the response files but never got a solid answer. I used a batch script loop to look through the installation logs (in c:\program files\oracle\inventory\logs) and find the installed successfully message. When the loop found it, it killed off the java.exe process. Nice.

So that was my success for the week. Hope it helps.

Silent Install of Oracle 11G R2

Addition: 2012-04-05

When I first started this site, the first article I wrote about was installing Oracle Client drivers on to Windows 2003. Nearly four years on, I got my hands on the latest version of Oracle with the latest version of Windows….

Oracle 11G R2 Client relies on the same Java based installation mechanism as its predecessors and I was trying to create a silent install for Windows 2008 R2 64-bit. So on launching the application manually the system would crash out complaining about pre-requisites. Specifically the memory; path and Architecture tests failed. Manually the installer gives you the option to ignore but that failed too and didn’t give much clue.

Going to google didn’t really help much either, lots of people complaining about similar issues but no real solutions. Was it Java being the wrong version, did it need the new JDK’s/JRE’s or was it some other software conflict…?

Turns out it was simple. RTFM.

One of the first lines in the readme/installation instructions noted that for Vista OSes and up (so that would include 7, 2008 and 2008 R2), the security improvement of removing the Admin C$ share stops the installer from working.

Do a simple:

1net share c$=c:\ /grant:administrator,full

on the command line prior to the setup and then it’ll run manually. Fortunately then when you get through the installer, there is a button to save off the response file which you can call in a batch file like this:

1setup.exe -silent -nowelcome -responsefile <filename>