How to configure
Automatic startup/shutdown of Kronos Oracle databases
Running on AIX
You must be able to connect to all databases to be autoshut/start using sqlplus “/ as sysdba” prior to doing the following configuration steps. This is how Oracle will connect to shut down the databases at reboot time. Path to dbstart must be valid !
If you get the following error…
#sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Fri Jan 14 13:12:33 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
…then check to see if $ORACLE_HOME/network/admin/sqlnet.ora has the following entry and comment it out as shown below (must have ‘# ‘ in front of it to be commented out):
#SQLNET.AUTHENTICATION_SERVICES=(NTS)
Go to /etc/inittab file on the AIX UNIX server. Put the following entry at the end of the file as shown below in arial bold red type :to start up the database after server reboot.
: @(#)49
1.28.2.11
src/bos/etc/inittab/inittab, cmdoper, bos52F, f2004_08C0 2/19/04
11:22:58
: IBM_PROLOG_BEGIN_TAG
: This is an automatically generated prolog.
:
: (IBM Header info blah, blah, blah,
copyrights, etc. – omitted for simplicity, your actual file will have all
this).
: Note - initdefault and sysinit should be the
first and second entry.
:
init:2:initdefault:
brc::sysinit:/sbin/rc.boot 3 >/dev/console
2>&1 # Phase 3 of system boot
powerfail::powerfail:/etc/rc.powerfail
2>&1 | alog -tboot > /dev/console # Power Failure Detection
mkatmpvc:2:once:/usr/sbin/mkatmpvc
>/dev/console 2>&1
atmsvcd:2:once:/usr/sbin/atmsvcd
>/dev/console 2>&1
load64bit:2:wait:/etc/methods/cfg64
>/dev/console 2>&1 # Enable 64-bit execs
tunables:23456789:wait:/usr/sbin/tunrestore -R
> /dev/console 2>&1 # Set tunables
rc:23456789:wait:/etc/rc 2>&1 | alog
-tboot > /dev/console # Multi-User checks
fbcheck:23456789:wait:/usr/sbin/fbcheck
2>&1 | alog -tboot > /dev/console # run /etc/firstboot
srcmstr:23456789:respawn:/usr/sbin/srcmstr #
System Resource Controller
rctcpip:23456789:wait:/etc/rc.tcpip >
/dev/console 2>&1 # Start TCP/IP daemons
sniinst:2:wait:/var/adm/sni/sniprei >
/dev/console 2>&1
rcnfs:23456789:wait:/etc/rc.nfs >
/dev/console 2>&1 # Start NFS Daemons
cron:23456789:respawn:/usr/sbin/cron
piobe:2:wait:/usr/lib/lpd/pio/etc/pioinit
>/dev/null 2>&1 # pb cleanup
cons:0123456789:respawn:/usr/sbin/getty
/dev/console
qdaemon:23456789:wait:/usr/bin/startsrc
-sqdaemon
writesrv:23456789:wait:/usr/bin/startsrc
-swritesrv
uprintfd:23456789:respawn:/usr/sbin/uprintfd
shdaemon:2:off:/usr/sbin/shdaemon
>/dev/console 2>&1 # High availability daemon
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
l7:7:wait:/etc/rc.d/rc 7
l8:8:wait:/etc/rc.d/rc 8
l9:9:wait:/etc/rc.d/rc 9
ntbl_reset:2:once:/usr/bin/ntbl_reset_datafiles
rcml:2:once:/usr/sni/aix52/rc.ml >
/dev/console 2>&1
naudio::boot:/usr/sbin/naudio > /dev/null
logsymp:2:once:/usr/lib/ras/logsymptom # for
system dumps
perfstat:2:once:/usr/lib/perf/libperfstat_updt_dictionary
>/dev/console 2>&1
diagd:2:once:/usr/lpp/diagnostics/bin/diagd
>/dev/console 2>&1
ctrmc:2:once:/usr/bin/startsrc -s ctrmc >
/dev/console 2>&1
ha_star:h2:once:/etc/rc.ha_star >/dev/console
2>&1
httpdlite:23456789:once:/usr/IMNSearch/httpdlite/httpdlite
-r /etc/IMNSearch/httpdlite/httpdlite.conf & >/dev/console 2>&1
itess:23456789:once:/usr/IMNSearch/bin/itess
-start search >/dev/null 2>&1
hntr2mon:2:once:/opt/hitachi/HNTRLib2/etc/D002start
dlmmgr:2:once:startsrc -s DLMManager
oracle:2:wait:/bin/su
oracle -c /m02/oracle/app/product/9.2.0/bin/dbstart > /dev/console
2>&1
oracle:2:wait:su -
oracle -c lsnrctl start
Go to /etc/rc.shutdown file on the AIX UNIX server. Install the entire file (or add appropriate entries if there are already commands in an existing /etc/rc.shutdown file) as shown below:
#!/bin/ksh
# Licensed Materials - Property of EHIT
#
# Author:
Gilbert Standen, Oracle Contract DBA, MSXI/Stillman Real Consulting
# 04-11-08
###################################################################
# name: rc.shutdown
# purpose: Script that stops the Oracle
Database & Listener
###################################################################
#!/bin/ksh
/bin/su -
oracle -c "/m02/oracle/app/product/9.2.0/bin/dbshut" # Stop DB's
sleep 10
/bin/su - oracle
-c "/m02/oracle/app/product/9.2.0/bin/lsnrctl stop" # Stop listener
sleep 5
exit
Ensure that the path to dbshut and dbstart as shown above
(e.g. /m02/oracle/app/product/9.2.0/bin/dbstart) is valid and has appropriate
permissions to be read by the oracle software owner !
Also, dbstart should be modified to use “shutdown immediate”
instead of “shutdown”.
Also, if you are using a generic “dbstart” and “dbshut”
script from oracle, you must check to make sure that the following two
workarounds have been implemented in the scripts.
How
to fix the dbstart script when using spfiles only.
------------------------------------------------------
In
Oracle9i the spfile has become the default and an init<SID>.ora file is
no
longer
needed. This has led to a defect in the
dbstart script which is
currently
testing for the old init<SID>.ora file instead of the new spfile.
This
can be fixed in the following way:
- make a backup copy of your existing
dbstart script prior to proceeding
- edit the dbstart script
1.
add the following line:
SPFILE=${ORACLE_HOME}/dbs/spfile${ORACLE_SID}.ora
after this line:
PFILE=${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora
2.
change:
if [ -f $PFILE ] ; then
to:
if [ -f $PFILE -o -f $SPFILE ] ; then
How
to fix the dbshut script.
-----------------------------
Use
“shutdown immediate” instead of “shutdown” in the following piece of code:
connect internal
shutdown immediate
EOF
;;
*) $SQLDBA <<EOF
connect / as sysdba
shutdown immediate
EOF