Cannot find the file specified - Oracle Opatch
I've done a script to install Oracle 11g runtime then apply a patch at the end. It works up until the patching when I get a "The system cannot find the file specified" error at Line 45 Char 1.
Applying the patch with the same lines of code in a separate vbs doesn't produce this problem?
My script is:
Can anyone point out what's wrong here?
Thanks
Applying the patch with the same lines of code in a separate vbs doesn't produce this problem?
My script is:
Dim oShell, fso, sCurPath, i, varPath, oShell1
Dim objWSH, objUserVariables, objSystemVariables
'On Error Resume Next
Set fso = WScript.Createobject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")
' Install Oracle Client 11g Release 2
sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
sCmdLine = sCurPath + "\Client\setup.exe -waitforcompletion -noconsole -silent -force -responseFile " + sCurPath + "\client\response\Oracle_11g_Release_2_Client_P1.0.rsp"
i = oShell.Run(sCmdLine, 1 ,True)
' Copy the updated Opatch to the installation
fso.CopyFolder sCurPath & "\OPatch", "C:\oracle\product\11.2.0\client_1\", True
' Copy the patch to ORACLE_HOME
fso.CopyFolder sCurPath & "\12429528", "C:\oracle\product\11.2.0\client_1\", True
' Create Opatch log folder
fso.CreateFolder "C:\oracle\product\11.2.0\client_1\cfgtoollogs\opatch"
' Rename oci.dll to allow for patch application
fso.MoveFile "C:\oracle\product\11.2.0\client_1\BIN\oci.dll" , "C:\oracle\product\11.2.0\client_1\BIN\oci.old"
' Set required Environment Variables
Set objWSH = CreateObject("WScript.Shell")
Set objSystemVariables = objWSH.Environment("SYSTEM")
varPath = objSystemVariables("PATH")
objSystemVariables("PATH") = varPath & ";C:\oracle\product\11.2.0\client_1\OPatch"
objSystemVariables("ORACLE_HOME") = "C:\oracle\product\11.2.0\client_1"
objSystemVariables("ORACLE_BASE") = "C:\oracle"
' Apply patch
'WScript.sleep 10000
Set oShell1 = CreateObject("WScript.Shell")
oShell1.CurrentDirectory="C:\oracle\product\11.2.0\client_1\12429528"
oShell1.Run "opatch apply -silent -force -ocmrf C:\oracle\product\11.2.0\client_1\OPatch\ocm.rsp",1,True
WScript.Quit(i)
Can anyone point out what's wrong here?
Thanks
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
Matias M Andersen
13 years ago
"opatch apply -silent -force -ocmrf C:\oracle\product\11.2.0\client_1\OPatch\ocm.rsp"
This is the name of the file you are about to run.
An easy way to spot these kinds of errors are to store your command line in a variable and run your script with a "MSGBOX variableName" instead of Run, to check if the commandline looks as intended.
/Matias
Posted by:
tmpamlrs
13 years ago
Hi Matias,
when I run a script with just these lines of code:
it works fine. These have just been copied and pasted from my original script which gives the error?
when I run a script with just these lines of code:
' Apply patch
'WScript.sleep 10000
Set oShell1 = CreateObject("WScript.Shell")
oShell1.CurrentDirectory="C:\oracle\product\11.2.0\client_1\12429528"
oShell1.Run "opatch apply -silent -force -ocmrf C:\oracle\product\11.2.0\client_1\OPatch\ocm.rsp",1,True
it works fine. These have just been copied and pasted from my original script which gives the error?
Posted by:
tmpamlrs
13 years ago
Posted by:
anonymous_9363
13 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.