How to Restart Your Oracle Database Using Shell Script

                    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

Related posts:

  1. How to Connect Oracle from UNIX
  2. Steps to Install/Uninstall MySQL Database in Linux

Comments are closed.