Dear all
iam facing some problem with oracle database statup/shutdown script
my oracle database server has to ORACLE_SID
ist ORACLE_SID=orcl
2nd ORACLE_SID=orclrew
the server is on a production environment and will shutdown once or twice in a
year currently id shutdown it
assigning ORACLE_SID manually
then i login to the server as user oracle
issue the following command
sqlplus /nolog
shutdown immediate
again assign the ORACLE_SID other value repeat the above process
i wan to automate the shutdown process
i create a script like the following
#!/bin/bash
clear
echo "Shutting Down Oracle Server Please Be Patient "
sleep 1
echo "Kiling All Oracle Process"
ps -ef | grep oracleorcl |cut -c 8-16 | sed -e '1,$s/^/kill -9 /g'>
/tmp/killtmp.sh
chmod +x /tmp/killtmp.sh
sh +x /tmp/killtmp.sh
echo "AL Oracle Related Process Killed"
clear
echo "Checking what is Current ORACLE_SID "
echo $ORACLE_SID
echo "Shutting Down Databes for ORACLE_SID = $ORACLE_SID"
echo "Switching to SQL Prompt "
echo "Database Shutdown for ORACLE_SID = $ORACLE_SID"
echo quit | su - oracle -c sqlplus /nolog shutdown immediate
clear
sllep 1
1f [ "$ORACLE_SID" = "orcl" ]
then
or_v=orclrew
else
or_v=orcl
fi
echo "Assigning $or_v as ORACLE_SID "
ORACLE_SID=orclrew
echo "Checking whether ORACLE_SID is Set as $or_v
echo $ORACLE_SID
echo "Shutting Down Databes for ORACLE_SID = $ORACLE_SID"
echo "Switching to SQL Prompt "
echo "Database Shutdown for ORACLE_SID = $ORACLE_SID"
echo quit | su - oracle -c sqlplus /nolog shutdown immediate
sleep 1
echo "All Process Completed Go Ahead with System Shutdown Y/N "
read wish
wish=`echo $wish | tr a-z A-Z`
if [ "$wish" = "Y" ]
then
shutdown -h now
else
echo "System Shutdown Postponed"
fi
clear
i want execute shutdown immeiate as a oracle user so i give
echo quit | su - oracle -c sqlplus /nolog shutdown immediate
but the same is not working the controll is not properly transfered and is not
coming
can y any one help me for the same
Cricket on your mind? Visit the ultimate cricket website. Enter
http://cricket.yahoo.com