Edit D:\app\Administrator\product\11.2.0\dbhome_1\ccr\lib\emocmutl.vbs
' $Header: emll/lib/emocmutl.vbs /main/3 2008/11/19 10:41:34 ndutko Exp $ ' ' Copyright Oracle 2006, 2008. All Rights Reserved ' ' NAME ' ocmutl.vbs - utility commands ' ' DESCRIPTION ' This script is used to invoke named utility functions that ' return information or state to a wrapping shell script. ' ' EXIT VALUES ' 0 - Success ' 1 - Prerequisite failure ' 2 - Invalid argument specified ' ' MODIFIED ' ndutko 11/16/08 - Add interface to return the hostname ' ndutko 05/08/08 - XbranchMerge ndutko_bug-7028658 from st_emll_10.3.0 ' ndutko 05/08/08 - Support of getting JAVA_HOME in the great ' grandparent if the grandparent doesn't contain a ' jdk. Note, this is in support of opatch deployment. ' ndutko 03/17/08 - initial ' Option Explicit Dim WshShell,WshEnv Dim oExec,oStdErr,oStdOut Dim FSO Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 Const TempFolder = 2 ' Constants to be used in exit codes. Const SUCCESS = 0 Const ERR_PREREQ_FAILURE = 1 Const ERR_INVALID_ARG = 2 ' Function constants Const ORACLE_HOME_PARENT_LEVEL = 2 Dim JavaHome ' Set banner info Const VersionInfo = "Oracle Configuration Manager - Release: %version-num%.%build.number% - %version-release%" Const CopyrightInfo = "%copyright-info%" ' Processing begins here Set WshShell = WScript.CreateObject("WScript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") Set WshEnv = WshShell.Environment("PROCESS") ' Include core utility IncludeCoreUtils ' Get the path variable settings given the script execution Dim CCR_HOME, CCR_BIN, ORACLE_HOME, CCR_LIB, CCR_TEMP, CCR_CONFIG_HOME Call GetPaths(CCR_HOME, CCR_BIN, ORACLE_HOME, CCR_CONFIG_HOME) Dim args, argVal Set args = WScript.Arguments If args.Count <= 0 Then WScript.Echo "Command options are: check_java_prereqs | get_env" WScript.Quit (ERR_INVALID_ARG) End If For Each argVal In args Select Case argVal Case "get_env" Call get_env Case "check_java_prereqs" WScript.Quit(check_java_prereqs()) Case "get_hostname" WScript.Echo getNonDHCPHostname Case Else WScript.Echo "Unknown Command argument" WScript.Quit(ERR_INVALID_ARG) End Select Next ' Determine if we meet the minimum for java requirements. ' Function check_java_prereqs() check_java_prereqs=SUCCESS Dim JavaHome ' Search for the java home to the great grandparent directory. OPatch install ' scenario. If (NOT getNLevelJavaHome(JavaHome, ORACLE_HOME_PARENT_LEVEL)) Then check_java_prereqs=ERR_PREREQ_FAILURE End If End Function ' Return the ORACLE_HOME, OCM_HOME, CCR_CONFIG_HOME, and JAVA_HOME Sub get_env() Dim javaHome ' Search for the java home to the great grandparent directory. OPatch install ' scenario Call getNLevelJavaHome(javaHome, ORACLE_HOME_PARENT_LEVEL) printDebug "* emocmutl JavaHome = " & javaHome WScript.Echo ORACLE_HOME & "," & CCR_HOME & "," & CCR_CONFIG_HOME & "," & javaHome End Sub ' Includes a file in the global namespace of the current script. ' The file can contain any VBScript source code. ' The path of the file name must be specified absolute (or ' relative to the current directory). Private Sub IncludeFileAbs (ByVal FileName) Dim f: set f = FSO.OpenTextFile(FileName,ForReading) Dim s: s = f.ReadAll() ExecuteGlobal s End Sub ' Includes the core utility file. Private Sub IncludeCoreUtils Dim CoreUtils, tmpCCRRootObj Dim FSO : Set FSO = WScript.CreateObject("Scripting.FileSystemObject") ' Derive the location of the temporary CCR_HOME from the script ' name. Its the parent directory of the parent directory. Set tmpCCRRootObj = FSO.GetFolder( _ FSO.GetParentFolderName( _ FSO.GetParentFolderName(WScript.ScriptFullName))) CoreUtils = FSO.BuildPath( _ FSO.BuildPath( tmpCCRRootObj.ShortPath, "lib" ), _ "coreutil.vbs" ) IncludeFileAbs CoreUtils End Sub
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de