db shutdown script

I am going to create shutdown database script. We have dabase shutdown script.

But i need take dabase which online and make it down.

I got user id which needs to dabase to down

ID=`ps -ef | grep -i pmon | grep -v grep | awk '{print $1}'` (

got orace side

DB=`ps -ef | grep -i pmon | grep -v grep | awk -F_ '{print $3}'`

need run script like below

su - <ID> -c "/home/db_shutdown.ksh <DB>" 

so that i will down all db's which is online.

better write a SQL script which will have all steps to shutdown DB. Pass your necessary information as argument to script and execute it from ksh file in silent mode.
like -

inside ksh file
sqlplus -s $DBUSER @sql_script.sql {parameters} <$PASSWORD >>output_file

inside sql_script.sql
receive values in variable
steps to shutdown DB 
1 Like