As you may know from my previous post, I am fund of automating Oracle EPM installation and configuration tasks. However automating some documentation tasks is also very much appreciated ;-)
Below a small old school Windows NT Shell script that produces a computername_epmservices.txt file containing all patches installed for each Oracle EPM Oracle home. Please note that this script requires another script which is a wrapper for opatch. Please copy hpatch.cmd to "
\Oracle\Middleware\EPMSystem11R1\OPatch" and then execute getPatchList.cmd from anywhere.
hpatch.cmd@ECHO OFF
TITLE OPatch Wrapper (EPMSystem) www.infratects.com copyright 2000-2011
COLOR f0
REM ###########################################################################
REM # Auteur : C.A. Hoekstra Yuzbashian
REM # Company : Infratects B.V.
REM # Version : 1.1
REM # Creation Date : 18th August 2010
REM # Last Changed : 28th December 2011
REM # Purpose : Simplify OPatch usage
REM ###########################################################################
setlocal
if "%EPM_ORACLE_HOME%" == "" (
echo "Environment variable EPM_ORACLE_HOME not defined"
goto end
)
set CONFIGTOOL_HOME=%EPM_ORACLE_HOME%\common\config\11.1.2.0
REM Get JRE or JDK
call "%CONFIGTOOL_HOME%\setJavaRuntime.bat"
if "%JAVA_HOME%" == "" (
echo "JAVA_HOME is not set"
echo "Exiting"
goto end
)
REM Make call to Opatch
%EPM_ORACLE_HOME%\OPatch\opatch.bat %* -oh %EPM_ORACLE_HOME% -jre %JAVA_HOME%
exit
:end
Endlocal
|
getPatchList.cmd@ECHO OFF
TITLE Oracle EPM - Get Oracle EPM Windows Service Names
CLS
REM Set variables
SET count=0
REM Create a new empty file while overwriting existing
TYPE NUL > %~dp0%COMPUTERNAME%_epmservices.txt
REM Create header
ECHO.
ECHO Oracle EPM Windows Services:
ECHO.
REM Query EPM home
::FOR /f "tokens=2 delims=:" %%i IN ('sc query type^= service ^| findstr /i "display_name.*oracle display_name.*hyperion"') DO (
FOR /f "tokens=2 delims=:" %%i IN ('sc query type^= service state^= all ^| findstr /i "display_name.*oracle display_name.*hyperion display_name.*bifoundation"') DO (
SET /a count+=1
FOR /f "tokens=*" %%j IN ("%%i") do ECHO.%%j && ECHO.%%j >> %~dp0%COMPUTERNAME%_epmservices.txt
)
ECHO. >> %~dp0%COMPUTERNAME%_epmservices.txt
ECHO Found a total of %COUNT% services...
ECHO.
ECHO Saved to %~dp0%COMPUTERNAME%_epmservices.txt
Pause
|
No comments :
Post a Comment