Oracle automatic stop, start, restart
Automatic start/stop
$ORACLE_HOME/bin/dbstart or dbstop
oratab :
SID:oracle_home:{y|n|w}
y|n : for automatic start/stop of the database, or not
n|w : w specifies that the db starts up only after ASM is up.
cd /etc/init.d (/sbin/init.d for HP-UX)
create a file dbora with the following:
#===============
#! /bin/sh -x
#
# Change the value of ORACLE_HOME to specify the correct Oracle home
# directory for your installation.
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
#
# Change the value of ORACLE to the login name of the
# oracle owner at your site.
#
ORACLE=oracle
PATH=${PATH}:$ORACLE_HOME/bin
HOST=`hostname`
PLATFORM=`uname`
export ORACLE_HOME PATH
#
if [ ! “$2” = “ORA_DB” ] ; then
if [ “$PLATFORM” = “HP-UX” ] ; then
remsh $HOST -l $ORACLE -n “$0 $1 ORA_DB”
exit
else
rsh $HOST -l $ORACLE $0 $1 ORA_DB
if [ “$PLATFORM” = “Linux” ] ; then
touch /var/lock/subsys/dbora
fi
exit
fi
fi
#
case $1 in
‘start’)
$ORACLE_HOME/bin/dbstart $ORACLE_HOME &
;;
‘stop’)
$ORACLE_HOME/bin/dbshut $ORACLE_HOME &
;;
*)
echo “usage: $0 {start|stop}”
exit
;;
esac
#
exit
#==============
Then
# chgrp dba dbora
# chmod 750 dbora
Create symbolic links to the dbora script in the appropriate run-level script directories as follows.
HP-UX # ln -s /sbin/init.d/dbora /sbin/rc3.d/S990dbora
# ln -s /sbin/init.d/dbora /sbin/rc0.d/K001dbora
Linux # ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora
ORACLE RESTART
===========
crsctl start/stop has
has = High Availability Service
Oracle Restart improves the availability of your Oracle database. When you install Oracle Restart, various Oracle components can be automatically restarted after a hardware or software failure or whenever your database host computer restarts.
Database instance :Â
Oracle Restart can accommodate multiple databases on a single host computer.
Oracle Net listener:
Database services :
Does not include the default service created upon installation because it is automatically managed by Oracle Database, and does not include any default services created during database creation.
Oracle Automatic Storage Management (Oracle ASM) instance:
Oracle ASM disk groups:
Restarting a disk group means mounting it.
Oracle Notification Services (ONS/eONS):
In a standalone server environment, ONS/eONS can be used in Oracle Data Guard installations for automating failover of connections between primary and standby database through Fast Application Notification (FAN). ONS/eONS is a service for sending FAN events to integrated clients upon failover.
Oracle Restart runs periodic check operations to monitor the health of these components. If a check operation fails for a component, the component is shut down and restarted.
Oracle Restart is used in standalone server (non-clustered) environments only.
For Oracle Real Application Clusters (Oracle RAC) environments, the functionality to automatically restart components is provided by Oracle Clusterware.
Oracle Restart runs out of the Oracle Grid Infrastructure home, which you install separately from Oracle Database homes. See the Oracle Database Installation Guide for your platform for information about installing the Oracle Grid Infrastructure home.
Created Component      Create Operation
Automatically
Added to Oracle
Restart Configuration?
YESÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Create a database with OUI or DBCA
NOÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Create a database with the CREATE DATABASE SQL statement
YESÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Create an Oracle ASM instance with OUI, DBCA, or ASMCA
YESÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Create a disk group (any method)
YESÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Add a listener with NETCA
YESÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Create a database service with SRVCTL
NOÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Create a database service by modifying the SERVICE_NAMES initialization parameter1 No
NOÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Create a database service with DBMS_SERVICE.CREATE_SERVICE
NOÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Create a standby database
Deleted Component      Delete Operation
Automatically
Added to Oracle
Restart Configuration?
YESÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Delete a database with DBCA Yes
YESÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Delete a listener with NETCA Yes
YESÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Drop an Oracle ASM disk group (any method) Yes
YESÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Delete a database service with SRVCTL Yes
NOÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Delete a database service by any other means No
NOÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Delete a database by removing database files with operating system commands
Discussion ¬