Client Management Suite

 View Only

VBScript to Install Oracle 9i Client 

Oct 07, 2008 11:27 AM

The attached script is one I use to automate the install of the Oracle 9i client.

When first trying to automate the 9i install for deployment through Altiris, we found that the Altiris job would show successfully completed before the installation had finished. Following the install, we wanted the job to copy tnsnames.ora and sqlnet.ora files to the client. That task would fail since the appropriate folders hadn't been created.

The issue was that the setup spawned a javaw.exe process to perform the actual installation. The setup.exe called by the Altiris job would complete successfully leaving javaw.exe to finish the work. We needed Altiris to wait for both setup.exe and javaw.exe to complete before moving on to the follow-up tasks.

The attached script, Oracle9iInstall.vbs, will start a silent install, then wait until the setup.exe and javaw.exe processes have ended. The script uses WMI to watch for the processes.

Before using the script, you will need to customize it for your Oracle install location. Change the following line in the script so that sOraPath contains the location of your Oracle installation files:

sOraPath = "\\serverpath\apps\client 92010\"

By default, the Oracle 9i Home will be set to C:\oracle\product\9.2.0\client\. To change the location, change the following line so that sClientPath contains the local path where you want the client installed:

sClientPath = "%SYSTEMDRIVE%\oracle\product\9.2.0\client"

License:AJSL
By clicking the download link below, you agree to the terms and conditions in the Altiris Juice Software License
Support:User-contributed tools on the Juice are not supported by Altiris Technical Support. If you have questions about a tool, please communicate directly with the author by visiting their profile page and clicking the 'contact' tab.

Statistics
0 Favorited
0 Views
1 Files
0 Shares
0 Downloads
Attachment(s)
zip file
Oracle9iInstall.zip   1 KB   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Comments

Nov 04, 2008 05:12 PM

Hi Guys,
This script is great and thanks to dnorris for sharing it.
I have a problem with the Oracle 9i install. I did some search on the net and found that response files have to be used to customize the install. I have been having numerous problems in getting the response files working. I followed the article on Appdeploy which got me started but I am having great difficulties in getting it working properly. The response file gets the installation started but the install only copies files partially and ends the installation.
AppDeploy article: This is very useful.
http://www.appdeploy.com/packages/detail.asp?id=182
Has anyone had the same issues with creating response files? It would be of a great help if someone could share their experience on it.
Cheers, VM

Oct 10, 2008 06:29 PM

Thanks for the input. I like the exit code suggestion, and will definitely use it going forward!

The CheckProcess function of the script is still required, though, even when WshShell.Run waits for setup.exe to complete. The issue is that for this Oracle install, setup.exe was completing and exiting, but was leaving the install running in a javaw.exe process. Setup.exe would exit properly and would no longer show up as a process in Task Manager, but the installation was not finished. A javaw.exe process remained and performed the actual installation of the Oracle client files.

The main purpose of the script is to wait for the secondary process to complete after the primary process called by Exec or Run ends.

Oct 10, 2008 09:22 AM

I've gone through the script and found the reason why Altiris job is showing successfully completed before the installation. The issue is with WshShell.Exec command.
There are 2 ways to execute a command in the commandline
1. WshShell.Exec
2. WshShell.Run
WshShell.Exec will not wait untill the installation compltes. Wherein WshShell.Run will execute the command and wait untill installation finishes.
Look at the following:
WshShell.Run(Chr(34) & sOraPath & "install\win32\setup.exe" & _
Chr(34) & " -waitforcompletion -force -silent " & strOptions & _
" -responseFile " & Chr(34) & sOraPath & sRSPFile & Chr(34) ,1, True)
It is a best practice to have an exit code [0/1/3010] sent to Altiris when you install an App using VBScript.
Try adding below script to your existing script:
----------------------------------------------------
Const vbLogSuccess = 0
Const vbLogError = 1
i = 0
i = WshShell.Run(Chr(34) & sOraPath & "install\win32\setup.exe" & _
Chr(34) & " -waitforcompletion -force -silent " & strOptions & _
" -responseFile " & Chr(34) & sOraPath & sRSPFile & Chr(34) ,1, True)
WScript.Sleep 1000
If (i = 0) Or ( i = 3010 ) Then
WshShell.LogEvent vbLogSuccess, "Oracle 9i installation completed successfully." & VbCrLf & "Exit code: " & i
Else
WshShell.LogEvent vbLogError, "Oracle 9i installation returned failure code: " & VbCrLf & "Exit code: " & i
End If
Set objWMIService = Nothing
WScript.Quit(i)
----------------------------------------------------
Above mentioned script will return not only an "Exit Code" but also write the result to "Event Log".

Oct 09, 2008 11:27 AM

Sorry 'bout that! We've been doing a little house keeping here at the Juice and what you experienced was the result of some of that sweeping up. The download link in the original post is fully functional now!
Ohzone

Oct 09, 2008 10:01 AM

Nice! Thanks for pointing that out. I just tried to reattach the .zip to see if the path would update. I don't seem to have control over the actual link. Hopefully, it will be fixed with the update.

Thanks for the corrected link!

Oct 09, 2008 08:35 AM

I click on the zip file and i get a "Page not found" error...
The correct link is:
http://juice.altiris.com/sites/default/files/Oracle9iInstall.zip

Related Entries and Links

No Related Resource entered.