11i Pre Patching Script

Problem: How can I minimize errors occurring while patching on the Windows platform?

Solution: Use a script to ensure that all environment variables are set and all supporting utilities are accessible.

I threw together a Windows command script (see below), which checks that the environment is set properly. It checks for correct directories, third-party executables and context file entries. Before patching, source the environment file (APPSORA.cmd) and then run prepatch.cmd.

Note that this file contains hard-coded entries, which must be modified for your environment.

@echo off

rem +---------------------------------------------------------------------
rem | prepatch.cmd
rem |
rem | Written by Vasudev Seeram
rem | Version 1.03
rem | Last Update - August 6, 2008
rem |   VS - v1.01 - Changed prompt
rem |   VS - v1.02 - Added check for s_adjreopt in context file
rem |   VS - v1.03 - Checked for %TEMP% and %TMP%
rem +---------------------------------------------------------------------

rem FOR %i IN (`hostname`) DO set HOSTNAME=%i
rem echo Generating scripts for node: %HOSTNAME%
rem echo Scripts will be created under: %CD%

echo.
if "%APPL_TOP%" == "" goto envnotsourced

prompt $p $t$g
echo Displaying PATH:
echo %PATH%
echo.
echo Displaying APPL_TOP:
echo %APPL_TOP%
echo.
echo Displaying TEMP and TMP:
echo TEMP: %TEMP%
echo TMP : %TMP%
echo.
echo Displaying location of which:
which which
echo.
echo Displaying location of gnumake:
which gnumake
echo.
echo Displaying location of cc:
which cc
echo.
echo Displaying location of msxml2.lib [D:VC98Lib]:
which D:VC98Libmsxml2.lib
echo.
echo Displaying location of perl [%IAS_ORACLE_HOME%Apacheperl5.00503binMSWin32-x86]:
which perl
echo.
echo Displaying location of notepad [C:WINDOWS]:
which notepad
echo.
echo Displaying location of net [C:WINDOWSSYSTEM32]:
which net
echo.
echo Displaying value of ADJREOPTS in adovars.cmd [-ms128m -mx512m]:
grep ADJREOPTS %APPL_TOP%adminadovars.cmd
echo.
echo Displaying value of ADJVAPRG in adovars.cmd [C:jdk13binjava.exe]:
grep ADJVAPRG= %APPL_TOP%adminadovars.cmd
echo.
echo Displaying value of AFJVAPRG in adovars.cmd [C:jdk13binjava.exe]:
grep AFJVAPRG= %APPL_TOP%adminadovars.cmd
echo.
echo Displaying value of s_adjvaprg in context file [%ORACLE_HOME%jdkbinjava.exe]:
grep s_adjvaprg %CONTEXT_FILE%
echo.
echo Displaying value of s_afjvaprg in context file [C:jdk13binjava.exe]:
grep s_afjvaprg %CONTEXT_FILE%
echo.
echo Displaying value of s_MKSdir in context file [d:mksntmksnt]:
grep s_MKSdir %CONTEXT_FILE%
echo.
echo Verify 8.0.6 tnsping80 working on ppclone1db:
tnsping80 FNDFS_PPCLONE1DB
echo.
echo Verify 8.0.6 tnsping80 working on ppclone1ap:
tnsping80 FNDFS_PPCLONE1AP

goto end

:envnotsourced
echo Source environment file APPSORA.env before running prepatch.cmd
:end
echo.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


This site uses Akismet to reduce spam. Learn how your comment data is processed.