whenever our office require to do some maintenance work, they ask us to take databases down, mostly it is on weekend and it turns to become a headache...we found that this thing is happening only or mostly with developer's environment database servers...so we decided to configure all developer's environment databases on autostart !
here is a small howto:
step 1: Modify oratab
at the end of oratab file, you will see following lines :
replace above with:
step 2: Creating dbora.sh script
write following content in it:
if [ ! -f $ORACLE_HOME/bin/dbstart ]
echo "Oracle startup: cannot start"
case "$1" in
'start') # Start the Oracle databases and listeners
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
'stop') # Stop the Oracle databases and listeners
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut"
step 3: configure O.S to run dbora.sh on bootup/shutdown
Link the dbora.sh to /etc/rc directories:
ln -s /etc/init.d/dbora.sh /etc/rc0.d/K10dbora
ln -s /etc/init.d/dbora.sh /etc/rc2.d/S99dbora
cp /etc/init.d/dbora.sh /etc/rc0.d/K10dbora
cp /etc/init.d/dbora.sh /etc/rc2.d/S99dbora
Note:we did cp on solaris 9. not sure but ln was not working.
$chkconfig --level 345 dbora.sh on
step 4: create pfile under $ORACLE_HOME/dbs --- OPTIONAL
if your database do not have pfile under $ORACLE_HOME/dbs you need to create by following command.
connect as "sysdba"
SQL> create pfile='$ORACLE_HOME/dba/initSID.ora' from spfile;