[prev in list] [next in list] [prev in thread] [next in thread] 

List:       aix-l
Subject:    Re: shutdown script
From:       Leonard Salika <lsalika () CSC ! COM>
Date:       1998-02-27 5:01:28
[Download RAW message or body]


Gregory T. Norris (gnorris@MAIL.STATE.MO.US) wrote:
: I'm trying to create a shutdown script (/etc/rc.shutdown) for an AIX 4.2
: node, and need to find out what user-context this script will execute under
: (root, sys, etc.).  It's purpose is to ensure that our Oracle database is
: cleanly closed and unmounted prior to the system being shutdown, as we have
: had several incidents with our Tech. Support section rebooting the node
: without giving us the opportunity to take care of this first (fortunately,
: the system is not yet production).  The database shutdown may only be
: performed by a member of the "dba" group, so we need to either force it to
: execute under an appropriate userid, or add whichever system userid it
: would execute under to that group.

: Unfortunately, we have had absolutely NO luck trying to convince our
: management that we need to purchase one or more copies of the various
: manuals (no one here has significant knowledge of any Unix variant, much
: less AIX specifically).  How they expect us to administer the system is
: anybody's guess.

: I'd really appreciate any information you can give me.

: -----
: Gregory T. Norris - gnorris@mail.state.mo.us

: My employers like me, but not enough to let me speak for them.

We use the following for oracle V8.0.3:

- - - - - - - - - - - - - - - - - - - -
#!/bin/ksh

####################################################################
# SHUTDOWN Local Processes, for example ...
#   (1)  oracle
####################################################################

 echo Shutting down local processes:

#    Stop Oracle
  if [ -x /var/opt/oracle/dbshut ]
  then
     echo "Shutting down oracle"
#    /var/opt/oracle/dbshut does "shutdown immediate"; do NOT use
#    "su - oracle -c ..." because /etc/profile asks for keyboard entry
#    after displaying /etc/motd and ~oracle/.profile starts X and Motif.
     su oracle -c /var/opt/oracle/dbshut
  fi

  # Stop Oracle listener
  if [ -z "$ORACLE_HOME" ]
  then
     export ORACLE_HOME
     ORACLE_HOME=~oracle
  fi
  if [ -x $ORACLE_HOME/bin/lsnrctl ]
  then
     echo "Shutting down oracle listener"
     export TNS_ADMIN
     TNS_ADMIN=/var/opt/oracle
     $ORACLE_HOME/bin/lsnrctl stop
  fi
- - - - - - - - - - - - - - - - - - - -
The "su oracle -c" had to be added to the dbshut line sometime after oracle
7.1.6; I don't remember whether it was with 7.2.3, 7.3.3, or 8.0.3.  NOTE
THE COMMENTS BEFORE THE DBSHUT LINE!  Our /var/opt/oracle/dbshut is a copy
of the one in $ORACLE_HOME/bin with the word "immediate" appended to the
ends of the two lines with "shutdown" commands.  Without this, an open
database connection (even one from another machine if you use the listener)
can stop your machine from shutting down.  The comment about not letting
yourself get hung up in the oracle account's .profile or .login is also
important.  Test your shutdown procedure under at least the following four
conditions: (1) from a window on the CDE desktop, (2) from the "green" lft
screen (command line login), (3) from a telnet login, and (4) from an "at"
or "cron" environment.  Our oracle account is local (i.e. non-NIS) on the
oracle server, so that a mess-up on the NIS server won't prevent our data
base server from shutting down.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic