cpu_apply_Mass.sh

#!/usr/bin/ksh
# SCRIPT: cpu_apply_Mass.sh
################################################
# Creator: Yoann Mainguy
# Update: Vincent Fenoll
# Created: 2009/01/01
# Compatible: 10g 11g
################################################
#
# Apply cpu patch on several Oracle databases
# using a for loop
#
################################################

for NO_SID in SID1 SID2 SID3
do
export ORACLE_SID=$NO_SID
export ORAENV_ASK=NO
. oraenv
echo ”
set echo off pages 1000 lines 1000
startup
select instance_name from v\$instance;
@?/rdbms/admin/catbundle cpu apply
@?/rdbms/admin/utlrp
” | sqlplus -s “/ as sysdba” > /tmp/$ORACLE_SID.log &
done

################################################
#
# Recompile views if needed
#
################################################

for NO_SID in SID1 SID2 SID3
do
export ORACLE_SID=$NO_SID
export ORAENV_ASK=NO
. oraenv

#VALUE=`sqlplus -s “/ as sysdba” < /tmp/RECOMP_$ORACLE_SID.log &
#else
# echo “Views already compiled for this database” > /tmp/RECOMP_$ORACLE_SID.log &
#fi
done

Leave a Reply

Your email address will not be published. Required fields are marked *

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