Views

Showing posts with label Scripts. Show all posts
Showing posts with label Scripts. Show all posts

Sunday, September 17, 2017

Oracle - Script to monitor RMAN running backup

Script to monitor RMAN running backup.

col Timestarted format a16
set linesize 160
col opname for a18
select sid,opname,trunc((totalwork*8192)/1024/1024) "Total work(MB)",
trunc((sofar*8192)/1024/1024) "Work Done(MB)", to_char(start_time, 'MM-DD-YYYY HH24:MI:SSAM') "Timestarted", trunc(time_remaining/60) "Time remaining(min)",round(elapsed_seconds/60) "Time Elasped(min)", round(sofar/totalwork*100,2) "% Complete" from v$session_longops
where opname like 'RMAN%'
and totalwork != 0
and sofar != totalwork
order by start_time, totalwork desc
/

SQL> col Timestarted format a16
SQL> set linesize 160
SQL> col opname for a18
SQL> select sid,opname,trunc((totalwork*8192)/1024/1024) "Total work(MB)",
  2  trunc((sofar*8192)/1024/1024) "Work Done(MB)", to_char(start_time, 'MM-DD-YYYY HH24:MI:SSAM') "Timestarted", trunc(time_remaining/60) "Time remaining(min)",round(elapsed_seconds/60) "Time Elasped(min)", round(sofar/totalwork*100,2) "% Complete" from v$session_longops
  3  where opname like 'RMAN%'
  4  and totalwork != 0
  5  and sofar != totalwork
  6  order by start_time, totalwork desc
/
                                       Work Do                  Time rema   Time Elap
SID OPNAME             Total work(MB)  ne(MB)  Timestarted      ining(min)  sed(min) %Complete
--- ------------------ -------------- -------- ---------------- ---------    ------- ----------
522 RMAN: aggregate in       17886759  5031515 09-16-2017 18:00      1436     562      28.13
    put                                        :34PM

609 RMAN: incremental        10518528  2409091 09-16-2017 18:00      1893     562       22.9
    datafile backup                            :35PM

648 RMAN: incremental         3665920   645958 09-16-2017 18:00      2629     562      17.62
    datafile backup                            :35PM

698 RMAN: incremental         1413120   554313 09-16-2017 18:00       871     562      39.23
    datafile backup                            :35PM

739 RMAN: incremental         1402880   568512 09-16-2017 18:00       825     562      40.52
    datafile backup                            :35PM


Oracle - List completed RMAN backup timings

Script to list completed RMAN backup timings.

col STATUS format a24
col min format 99999.99
col START_TIME for a20
col END_TIME for a20
set pages 99 linesize 235
select SESSION_KEY, INPUT_TYPE, STATUS,
to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,
to_char(END_TIME,'mm/dd/yy hh24:mi') end_time,
elapsed_seconds/60 min from V$RMAN_BACKUP_JOB_DETAILS
order by session_key;

SQL> col STATUS format a24
SQL> col min format 99999.99
col START_TIME for a20
SQL> SQL> col END_TIME for a20
SQL> set pages 99 linesize 235
SQL> select SESSION_KEY, INPUT_TYPE, STATUS,
  2  to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,
  3  to_char(END_TIME,'mm/dd/yy hh24:mi') end_time,
  4  elapsed_seconds/60 min from V$RMAN_BACKUP_JOB_DETAILS
  5  order by session_key;

SE_KEY INPUT_TYPE    STATUS                   START_TIME      END_TIME             MIN
------ ------------- ------------------------ --------------- ------------------------
 10364 ARCHIVELOG    COMPLETED                09/09/17 08:01  09/09/17 09:01     59.52
 10367 ARCHIVELOG    COMPLETED                09/09/17 13:02  09/09/17 13:46     43.73
 10370 ARCHIVELOG    COMPLETED                09/09/17 16:02  09/09/17 16:24     22.18
 10373 DB INCR       COMPLETED                09/09/17 18:00  09/10/17 22:30   1709.50
 10375 ARCHIVELOG    COMPLETED                09/09/17 22:02  09/09/17 23:58    115.65
 10378 ARCHIVELOG    COMPLETED                09/10/17 01:04  09/10/17 01:37     33.20
 10381 ARCHIVELOG    COMPLETED WITH ERRORS    09/10/17 04:02  09/10/17 05:33     91.12
 10384 ARCHIVELOG    COMPLETED                09/10/17 08:02  09/10/17 09:42    100.20
 10387 ARCHIVELOG    COMPLETED                09/10/17 13:02  09/10/17 14:02     59.93
 10390 ARCHIVELOG    COMPLETED                09/10/17 16:01  09/10/17 16:34     32.80
 10393 ARCHIVELOG    COMPLETED                09/10/17 22:01  09/10/17 22:42     40.88
 10398 ARCHIVELOG    COMPLETED                09/11/17 01:02  09/11/17 01:20     18.62
 10410 ARCHIVELOG    COMPLETED                09/11/17 16:01  09/11/17 16:07      6.43
 10413 ARCHIVELOG    COMPLETED                09/11/17 22:02  09/11/17 22:17     15.45
 10416 ARCHIVELOG    COMPLETED                09/12/17 01:01  09/12/17 01:10      8.10
 10419 ARCHIVELOG    COMPLETED                09/12/17 04:01  09/12/17 04:41     39.83
 10431 ARCHIVELOG    COMPLETED                09/12/17 22:02  09/12/17 22:20     18.65
 10434 ARCHIVELOG    COMPLETED                09/13/17 01:01  09/13/17 01:15     13.43
 10437 ARCHIVELOG    COMPLETED                09/13/17 04:01  09/13/17 04:41     39.93
 10440 ARCHIVELOG    COMPLETED                09/13/17 08:01  09/13/17 08:55     53.37
 10452 ARCHIVELOG    COMPLETED                09/14/17 01:02  09/14/17 01:15     13.22
 10455 ARCHIVELOG    COMPLETED                09/14/17 04:01  09/14/17 04:44     42.13
 10458 ARCHIVELOG    COMPLETED WITH ERRORS    09/14/17 08:01  09/14/17 09:03     62.17
 10461 ARCHIVELOG    COMPLETED                09/14/17 13:01  09/14/17 13:27     26.05
 10470 ARCHIVELOG    COMPLETED                09/15/17 01:01  09/15/17 01:08      7.12
 10497 ARCHIVELOG    COMPLETED                09/16/17 13:02  09/16/17 13:47     44.72
 10505 ARCHIVELOG    COMPLETED                09/16/17 22:02  09/16/17 23:43    100.82
 10508 ARCHIVELOG    COMPLETED                09/17/17 01:03  09/17/17 01:31     28.33

Saturday, September 16, 2017

Shell Script to start/stop All or one Oracle Database


Shell Script to start/stop All or One Oracle database on the server.

This is a menu driven program to perform following operations.

1. Stop All Databases.
2. Start All Databases.
3. Stop Database.
4. Start Database.
5. Check Databases.

This script start/stop either All databases on server or the database with specified SID.
Below is the script used.
After the script we can find the sample execution of script.
Please let me know if the script helped you.

#!/bin/bash
## ---------------------------------------------------------------------
## File Name    : /home/oracle/scripts/db_start_stop.sh
## Description  : Script to start / stop All or One database on server
## Call Syntax  : sh /home/oracle/scripts/db_start_stop.sh
## Last Modified: 9/15/2017
## ---------------------------------------------------------------------
## Revision history:

## ---------------------------------------------------------------------
PATH=$PATH:/usr/local/bin
export PATH
export PATH=${PATH}:${ORACLE_HOME}/bin
export SCRIPT_HOME=/home/oracle/scripts
log_dir=$SCRIPT_HOME/logs
LOG_FILE=$log_dir/db_stop_start.txt

####################################################################
# function to log messages
# Along with messages displayed on console, all logs will be recorded in
# a log file created under log directory
# This file is always appended to retain previous execution log
# log will contain the username who has executed and
# date and time when it was executed
####################################################################

logit()
{
   if [ ! -d "$log_dir" ]; then
     if [ ! -f "$LOG_FILE" ]; then
       echo "Log directory $log_dir or Log file $LOG_FILE does not exist. Please create and re-execute."
       exit ;
     fi
   fi
   echo "[${USER}][`date`] - ${*}" >> ${LOG_FILE}
}

####################################################################
# check if log directory exist
# if log directory does not exist, exit the code with message
# displayed on console
####################################################################

logit "Checking log directory"
if [ ! -d "$log_dir" ]; then
logit "Log directory $log_dir does not exist. Please create and re-execute"
echo "Log directory $log_dir does not exist. Please create and re-execute"
exit ;
fi

####################################################################
# Script usage check
# check if script has been executed with proper parameters
# If not, exit the code
####################################################################

if [ "$#" -ne 0 ]; then
  echo "Usage: sh db_start_stop.sh"
  exit 1
fi

####################################################################
# check if logged on with oracle user
# If not, exit the code
####################################################################

if [ `whoami` != "oracle" ]; then
  echo "Must be logged on as oracle to run this script."
  exit 1
fi

####################################################################
# check if ORATAB exist
# If not, exit the code
####################################################################

logit "Checking ORATAB"
ORATAB=/etc/oratab
if [ ! $ORATAB ] ; then
  echo "$ORATAB not found"
  exit ;
fi

####################################################################
# Create start.sh, stop.sh, asmstart.sh and asmstop.sh
#
####################################################################

if [ -f "$SCRIPT_HOME/dbstart.sh" ]; then
  rm $SCRIPT_HOME/dbstart.sh
fi
if [ -f "$SCRIPT_HOME/dbstop.sh" ]; then
  rm $SCRIPT_HOME/dbstop.sh
fi

if [ ! -f "$SCRIPT_HOME/dbstart.sh" ]; then
logit "Creating dbstart.sh"
cat > $SCRIPT_HOME/dbstart.sh << EOF1
sqlplus '/as sysdba'<<!
startup
show parameter db_name
select open_mode from v\$database ;
exit
!
EOF1
chmod 755 $SCRIPT_HOME/dbstart.sh
fi


if [ ! -f "$SCRIPT_HOME/dbstop.sh" ]; then
logit "Creating dbstop.sh"
cat > $SCRIPT_HOME/dbstop.sh << EOF2
sqlplus '/as sysdba'<<!
select name, open_mode from v\$database ;
show parameter db_name
shut immediate
exit
!
EOF2
chmod 755 $SCRIPT_HOME/dbstop.sh
fi

####################################################################
# Fuction stopalldb
# Function to stop All databases residing on server
####################################################################

stopalldb (){

echo "stopalldb";

  logit "Entering: Stop All Databases"
  run_list=`ps -ef | grep pmon | grep -v grep | grep -v +ASM | awk -F_ '{ print $3 }'`
  for DB in $run_list
  do
     export ORACLE_SID=$DB
     export ORACLE_HOME=`grep "^${DB}:" /etc/oratab|cut -d: -f2 -s`
     export PATH=$ORACLE_HOME/bin:$PATH

     echo "Shutting down database \"$ORACLE_SID\""
     logit "Shutting down database \"$ORACLE_SID\""
     nohup sh $SCRIPT_HOME/dbstop.sh &
     COUNT=0
     running=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep | awk -F_ '{ print $3 }'|wc -l`

     while [ "$running" != 0 ];
     do
       COUNT=`expr $COUNT + 1`
       if [ $COUNT = 30 ] ; then
         # 30 tries with 10 sec interval => 5 minutes timeout
         logit "Timed out waiting to stop db instance $ORACLE_SID"
         logit "  DB not able to stop."
         exit $COUNT
       fi
       logit "Waiting for Oracle database to be stopped"
       logit " DB instance $ORACLE_SID. Wait $COUNT."
       echo "Oracle database $ORACLE_SID stopping. Please wait...."
       sleep 10
       running=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep | awk -F_ '{ print $3 }'|wc -l`
     done
     running=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep | awk -F_ '{ print $3 }'|wc -l`
     if [ "$running" = 0 ] ; then
       logit "\"${ORACLE_SID}\" database successfully stopped."
       echo "\"${ORACLE_SID}\" database successfully stopped."
     fi
  done

}

####################################################################
# Fuction startalldb
# Function to start All databases residing on server
####################################################################

startalldb (){
echo "startalldb";
  logit "Entering: Start All Databases"
  db_list=`cat /etc/oratab|grep -v "^#"|grep -v "N$"|grep -v +ASM|cut -f1 -d: -s`
  for DB in $db_list
  do
     export ORACLE_SID=$DB
     export ORACLE_HOME=`grep "^${DB}:" /etc/oratab|cut -d: -f2 -s`
     export PATH=$ORACLE_HOME/bin:$PATH

     echo "Starting up database \"$ORACLE_SID\""
     logit "Starting up database \"$ORACLE_SID\""
     nohup sh $SCRIPT_HOME/dbstart.sh &
     COUNT=0
     running=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep | awk -F_ '{ print $3 }'|wc -l`

     while [ "$running" = 0 ];
     do
       COUNT=`expr $COUNT + 1`
       if [ $COUNT = 30 ] ; then
         # 30 tries with 10 sec interval => 5 minutes timeout
         logit "Timed out waiting to start db instance $ORACLE_SID"
         logit "  DB not able to start."
         exit $COUNT
       fi
       logit "Waiting for Oracle database to be Started"
       logit " DB instance $ORACLE_SID. Wait $COUNT."
       echo "Oracle database $ORACLE_SID Starting. Please wait...."
       sleep 10
       running=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep | awk -F_ '{ print $3 }'|wc -l`
     done
     running=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep | awk -F_ '{ print $3 }'|wc -l`
     if [ "$running" != 0 ] ; then
       logit "\"${ORACLE_SID}\" database successfully Started."
       echo "\"${ORACLE_SID}\" database successfully Started."
     fi
  done
}

####################################################################
# Fuction stopdb
# Function to stop a database SID entered by user
####################################################################

stopdb (){
echo "Currently running Oracle databases on this server:"
echo `ps -ef | grep pmon | grep -v grep | grep -v +ASM | awk -F_ '{ print $3 }'`
logit "Entering: Stop selected database"
echo " "
echo "Enter Oracle SID to stop: "
read sid

db_chk=0;
for DB in $db_list
do
   if [ $DB = ${sid,,} ]; then
     db_chk=1;
   fi
done

if [ "$db_chk" = 0 ] ; then
  logit "\"${sid}\" database does not exist on this server."
  echo "\"${sid}\" database does not exist on this server."
  exit 1;
fi

running=`ps -ef | grep -i pmon_$sid | grep -v grep | awk -F_ '{ print $3 }'|wc -l`
if [ "$running" = 0 ] ; then
  logit "\"${sid}\" database is not running."
  echo "\"${sid}\" database is not running."
  exit;
fi
DB=`ps -ef | grep -i pmon_$sid | grep -v grep | awk -F_ '{ print $3 }'`
export ORACLE_SID=$DB
export ORACLE_HOME=`grep "^${DB}:" /etc/oratab|cut -d: -f2 -s`
export PATH=$ORACLE_HOME/bin:$PATH

echo "Stopping database \"$ORACLE_SID\""
logit "Stopping database \"$ORACLE_SID\""
nohup sh $SCRIPT_HOME/dbstop.sh &
COUNT=0
running=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep | awk -F_ '{ print $3 }'|wc -l`

while [ "$running" != 0 ];
do
  COUNT=`expr $COUNT + 1`
  if [ $COUNT = 30 ] ; then
    # 30 tries with 10 sec interval => 5 minutes timeout
    logit "Timed out waiting to stop db instance $ORACLE_SID"
    logit "  DB not able to stop."
    exit $COUNT
  fi
  logit "Waiting for Oracle database to be stopped"
  logit " DB instance $ORACLE_SID. Wait $COUNT."
  echo "Oracle database $ORACLE_SID stopping. Please wait...."
  sleep 10
  running=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep | awk -F_ '{ print $3 }'|wc -l`
done
running=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep | awk -F_ '{ print $3 }'|wc -l`
if [ "$running" = 0 ] ; then
  logit "\"${ORACLE_SID}\" database successfully Stopped."
  echo "\"${ORACLE_SID}\" database successfully Stopped."
fi


}

####################################################################
# Fuction startdb
# Function to start a database SID entered by user
####################################################################

startdb (){
logit "Entering: Start selected database"
db_list=`cat /etc/oratab|grep -v "^#"|grep -v "N$"|cut -f1 -d: -s`

echo "Databases on this server:"
for DB in $db_list
do
   export ORACLE_SID=$DB
   export ORACLE_HOME=`grep "^${DB}:" /etc/oratab|cut -d: -f2 -s`
   export PATH=$ORACLE_HOME/bin:$PATH
   echo "ORACLE_SID:$ORACLE_SID | ORACLE_HOME:$ORACLE_HOME"
done

echo " "
echo "Enter Oracle SID to start: "
read sid
db_chk=0;
for DB in $db_list
do
   if [ $DB = ${sid,,} ]; then
     db_chk=1;
   fi
done

if [ "$db_chk" = 0 ] ; then
  logit "\"${sid}\" database does not exist on this server."
  echo "\"${sid}\" database does not exist on this server."
  exit 1;
fi

running=`ps -ef | grep -i pmon_$sid | grep -v grep | awk -F_ '{ print $3 }'|wc -l`
if [ "$running" != 0 ] ; then
  logit "\"${sid}\" database is already started."
  echo "\"${sid}\" database is already started."
  exit 1;
fi
DB=`cat /etc/oratab|grep -v "^#"|grep -v "N$"|grep -i $sid|cut -f1 -d: -s`

export ORACLE_SID=$DB
export ORACLE_HOME=`grep "^${DB}:" /etc/oratab|cut -d: -f2 -s`
export PATH=$ORACLE_HOME/bin:$PATH

echo "Starting database \"$ORACLE_SID\""
logit "Starting database \"$ORACLE_SID\""
nohup sh $SCRIPT_HOME/dbstart.sh &
COUNT=0
running=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep | awk -F_ '{ print $3 }'|wc -l`

while [ "$running" = 0 ];
do
  COUNT=`expr $COUNT + 1`
  if [ $COUNT = 30 ] ; then
    # 30 tries with 10 sec interval => 5 minutes timeout
    logit "Timed out waiting to start db instance $ORACLE_SID"
    logit "  DB not able to start."
    exit $COUNT
  fi
  logit "Waiting for Oracle database to be started"
  logit " DB instance $ORACLE_SID. Wait $COUNT."
  echo "Oracle database $ORACLE_SID starting. Please wait...."
  sleep 10
  running=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep | awk -F_ '{ print $3 }'|wc -l`
done
running=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep | awk -F_ '{ print $3 }'|wc -l`
if [ "$running" != 0 ] ; then
  logit "\"${ORACLE_SID}\" database successfully Started."
  echo "\"${ORACLE_SID}\" database successfully Started."
fi
}

####################################################################
# Check database status
# This function will display all databases residing on server
# And will also display currently running databases
####################################################################

checkdb (){
db_list=`cat /etc/oratab|grep -v "^#"|grep -v "N$"|cut -f1 -d: -s`
for DB in $db_list
do
   export ORACLE_SID=$DB
   export ORACLE_HOME=`grep "^${DB}:" /etc/oratab|cut -d: -f2 -s`
   export PATH=$ORACLE_HOME/bin:$PATH
   echo "Databases on this server"
   echo "ORACLE_SID:$ORACLE_SID | ORACLE_HOME:$ORACLE_HOME"
done
   echo " "
   echo "Running Databases:"
   n=`ps -ef | grep pmon | grep -v grep | grep -v +ASM | awk -F_ '{ print $3 }'|wc -l`
   if [ $n = 0 ]; then
     echo "No databases running"
   else
     echo `ps -ef | grep pmon | grep -v grep | grep -v +ASM | awk -F_ '{ print $3 }'`
  fi
}


####################################################################
# Drawing menu function
# This function will draw memu on console to select option either
# to start/stop db instance
####################################################################

draw_menu(){
    NORMAL=`echo "\033[m"`
    MENU=`echo "\033[36m"` #Blue
    NUMBER=`echo "\033[33m"` #yellow
    FGRED=`echo "\033[41m"`
    RED_TEXT=`echo "\033[31m"`
    ENTER_LINE=`echo "\033[33m"`
    echo -e "${MENU}*********************************************${NORMAL}"
    echo -e "${MENU}     Database Resources Start / Stop ${NORMAL}"
    echo -e "${MENU}*********************************************${NORMAL}"
    echo -e "${MENU}**${NUMBER} 1)${MENU} Stop All Database ${NORMAL}"
    echo -e "${MENU}**${NUMBER} 2)${MENU} Start All Database ${NORMAL}"
    echo -e "${MENU}**${NUMBER} 3)${MENU} Stop Database ${NORMAL}"
    echo -e "${MENU}**${NUMBER} 4)${MENU} Start Database ${NORMAL}"
    echo -e "${MENU}**${NUMBER} 5)${MENU} Check Databases ${NORMAL}"
    echo -e "${MENU}*********************************************${NORMAL}"
    echo -e "${ENTER_LINE}Please enter a menu option and enter or ${RED_TEXT}enter to exit. ${NORMAL}"
    read Choice
}
function choice_select() {
    COLOR='\033[01;31m' # bold red
    RESET='\033[00;00m' # normal white
    MESSAGE=${@:-"${RESET}Error: No message passed"}
    echo -e "${COLOR}${MESSAGE}${RESET}"
}

####################################################################
# Main function to execute the code to select the appropriate option
####################################################################

clear
draw_menu
while [ Choice != '' ]
do
if [[ $Choice = "" ]]; then
        exit;
else
    case $Choice in
       1) choice_select "Stopping all Databases";
          stopalldb;
          draw_menu;
         ;;
       2) choice_select "Starting all Databases";
          startalldb;
          draw_menu;
         ;;
       3) choice_select "Stop Database";
          stopdb;
          draw_menu;
         ;;
       4) choice_select "Start Database";
          startdb;
          draw_menu;
         ;;
       5) choice_select "Show Databases";
          checkdb;
          draw_menu;
         ;;
        x)exit;
        ;;
        \n)exit;
        ;;
        *)clear;
        choice_select "Pick an option from the menu";
        draw_menu;
        ;;
    esac
fi

done

SAMPLE EXECUTION:

[oracle@dclnpratedb8-old scripts]$ sh db_start_stop.sh
*********************************************
     Database Resources Start / Stop
*********************************************
** 1) Stop All Database
** 2) Start All Database
** 3) Stop Database
** 4) Start Database
** 5) Check Databases
*********************************************
Please enter a menu option and enter or enter to exit.
5
Show Databases
Databases on this server
ORACLE_SID:oraprod | ORACLE_HOME:/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_SID:oradb1 | ORACLE_HOME:/u01/app/oracle/product/11.2.0/dbhome_1

Running Databases:
oraprod
oradb1
*********************************************
     Database Resources Start / Stop
*********************************************
** 1) Stop All Database
** 2) Start All Database
** 3) Stop Database
** 4) Start Database
** 5) Check Databases
*********************************************
Please enter a menu option and enter or enter to exit.
1
Stopping all Databases
stopalldb
Shutting down database "oraprod"
nohup: appending output to `nohup.out'
Oracle database oraprod stopping. Please wait....
Oracle database oraprod stopping. Please wait....
Oracle database oraprod stopping. Please wait....
Oracle database oraprod stopping. Please wait....
"oraprod" database successfully stopped.
Shutting down database "oradb1"
nohup: appending output to `nohup.out'
Oracle database oradb1 stopping. Please wait....
Oracle database oradb1 stopping. Please wait....
Oracle database oradb1 stopping. Please wait....
Oracle database oradb1 stopping. Please wait....
"oradb1" database successfully stopped.
*********************************************
     Database Resources Start / Stop
*********************************************
** 1) Stop All Database
** 2) Start All Database
** 3) Stop Database
** 4) Start Database
** 5) Check Databases
*********************************************
Please enter a menu option and enter or enter to exit.
2
Starting all Databases
startalldb
Starting up database "oraprod"
nohup: appending output to `nohup.out'
Oracle database oraprod Starting. Please wait....
Oracle database oraprod Starting. Please wait....
Oracle database oraprod Starting. Please wait....
Oracle database oraprod Starting. Please wait....
Oracle database oraprod Starting. Please wait....
Oracle database oraprod Starting. Please wait....
Oracle database oraprod Starting. Please wait....
Oracle database oraprod Starting. Please wait....
"oraprod" database successfully Started.
Starting up database "oradb1"
nohup: appending output to `nohup.out'
Oracle database oradb1 Starting. Please wait....
Oracle database oradb1 Starting. Please wait....
Oracle database oradb1 Starting. Please wait....
Oracle database oradb1 Starting. Please wait....
Oracle database oradb1 Starting. Please wait....
"oradb1" database successfully Started.
*********************************************
     Database Resources Start / Stop
*********************************************
** 1) Stop All Database
** 2) Start All Database
** 3) Stop Database
** 4) Start Database
** 5) Check Databases
*********************************************
Please enter a menu option and enter or enter to exit.
5
Show Databases
Databases on this server
ORACLE_SID:oraprod | ORACLE_HOME:/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_SID:oradb1 | ORACLE_HOME:/u01/app/oracle/product/11.2.0/dbhome_1

Running Databases:
oraprod
oradb1
*********************************************
     Database Resources Start / Stop
*********************************************
** 1) Stop All Database
** 2) Start All Database
** 3) Stop Database
** 4) Start Database
** 5) Check Databases
*********************************************
Please enter a menu option and enter or enter to exit.
3
Stop Database
Currently running Oracle databases on this server:
oraprod

Enter Oracle SID to stop:
oradb
"oradb" database does not exist on this server.
*********************************************
     Database Resources Start / Stop
*********************************************
** 1) Stop All Database
** 2) Start All Database
** 3) Stop Database
** 4) Start Database
** 5) Check Databases
*********************************************
Please enter a menu option and enter or enter to exit.
3
Stop Database
Currently running Oracle databases on this server:
oraprod

Enter Oracle SID to stop:
oraprod
Stopping database "oraprod"
nohup: appending output to `nohup.out'
Oracle database oraprod stopping. Please wait....
Oracle database oraprod stopping. Please wait....
Oracle database oraprod stopping. Please wait....
Oracle database oraprod stopping. Please wait....
"oraprod" database successfully Stopped.
*********************************************
     Database Resources Start / Stop
*********************************************
** 1) Stop All Database
** 2) Start All Database
** 3) Stop Database
** 4) Start Database
** 5) Check Databases
*********************************************
Please enter a menu option and enter or enter to exit.
4
Start Database
Databases on this server:
ORACLE_SID:oraprod | ORACLE_HOME:/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_SID:oradb1 | ORACLE_HOME:/u01/app/oracle/product/11.2.0/dbhome_1

Enter Oracle SID to start:
abhi1
"abhi1" database does not exist on this server.
[oracle@dclnpratedb8-old scripts]$ sh db_start_stop.sh
*********************************************
     Database Resources Start / Stop
*********************************************
** 1) Stop All Database
** 2) Start All Database
** 3) Stop Database
** 4) Start Database
** 5) Check Databases
*********************************************
Please enter a menu option and enter or enter to exit.
4
Start Database
Databases on this server:
ORACLE_SID:oraprod | ORACLE_HOME:/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_SID:oradb1 | ORACLE_HOME:/u01/app/oracle/product/11.2.0/dbhome_1

Enter Oracle SID to start:
oraprod
Starting database "oraprod"
nohup: appending output to `nohup.out'
Oracle database oraprod starting. Please wait....
Oracle database oraprod starting. Please wait....
Oracle database oraprod starting. Please wait....
Oracle database oraprod starting. Please wait....
Oracle database oraprod starting. Please wait....
Oracle database oraprod starting. Please wait....
Oracle database oraprod starting. Please wait....
Oracle database oraprod starting. Please wait....
"oraprod" database successfully Started.
*********************************************
     Database Resources Start / Stop
*********************************************
** 1) Stop All Database
** 2) Start All Database
** 3) Stop Database
** 4) Start Database
** 5) Check Databases
*********************************************
Please enter a menu option and enter or enter to exit.
4
Start Database
Databases on this server:
ORACLE_SID:oraprod | ORACLE_HOME:/u01/app/oracle/product/11.2.0/dbhome_1

Enter Oracle SID to start:
oraprod
"oraprod" database is already started.