-bash-3.2$ more shutdown.sh
sqlplus '/as sysdba'<<EOF
shutdown immediate
exit
EOF
proccnt=`ps -ef|grep ora_|grep -v ora|wc -l`
if [ ${proccnt} = 0 ]
then
echo 'oracle have stopped'
fi
-bash-3.2$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 24 23:22:07 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 313860096 bytes
Fixed Size 1336232 bytes
Variable Size 167775320 bytes
Database Buffers 138412032 bytes
Redo Buffers 6336512 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
-bash-3.2$ . ./shutdown.sh
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 24 23:22:27 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle have stopped
-bash-3.2$
--转自