Some scenarios like tuning oracle parameters or some other scenarios you want to restart your oracle database using shell scripts. Below script will help you to do the same.
#! /bin/bash
#set -x
#
# Your title here
#
su – oracle -c “
export ORACLE_SID=SNM
#create spfile from pfile
sqlplus / as sysdba <<- EOF
// Your SQL Statement here
disconnect
exit
EOF
echo ‘Starting database restart procedure…’
sleep 10
dbshut
dbstart
“
