when is issue export ORACLE_SID=orclrew sqlplus / syslog <<EOF shutdown immediate; exit EOF nothing is happening only cursor is blinging or orpracle $ prompt
i have not used sysdba as my dba person told me shutdown command shoulb be triggered by sqlplus / --- On Fri, 26/6/09, Nadeem M. Khan <[email protected]> wrote: From: Nadeem M. Khan <[email protected]> Subject: Re: [LinuxVadaPav] oracle shutdown startup script To: [email protected] Date: Friday, 26 June, 2009, 6:20 PM On Fri, Jun 26, 2009 at 2:51 PM, ashok abraham<ashok...@yahoo. com> wrote: > > > > 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 It is extremely unsafe to kill oracle processes like you are doing. That too on a production database. Why can't you use something as simple as this: #!/bin/bash su - oracle export ORACLE_SID=orcl sqlplus / as sysdba <<EOF shutdown immediate; exit EOF export ORACLE_SID=orclrew sqlplus / as sysdba <<EOF shutdown immediate; exit EOF exit 0 This is assuming both your instance are in the same oracle home. Or, you can just use oracle's dbstop command, which reads the oracle sids from /etc/oratab. You also might need to stop the listener. (lsnrctl stop) Regards, NMK. ICC World Twenty20 England '09 exclusively on YAHOO! CRICKET http://cricket.yahoo.com [Non-text portions of this message have been removed]
