How To Automate ASM Startup and Shutdown on AIX 5L [ID 580133.1]

 

       Oracle recommends that you configure your system to automatically to start Oracle ASM instances and Database Instances when the system starts up, and to automatically shut them down when the system shuts down. Automating ASM/Database startup and shutdown guards against incorrect database shutdown.

       The present document described how to Automate ASM Startup and Shutdown on AIX 5L.

 

 

步骤如下:

The first step is to create the dbora shell script and place it in the /etc/init.d directory:

1)  Log in as the root user.

2)  Edit the oratab file:

# vi /etc/oratab

3)  Update the oratab with the next entry:

+ASM:<ASM Oracle Home>:Y

Example:

+ASM:/u02/app/oracle/11g:Y

 

4)  Change to the /etc directory for AIX:

# cd /etc

 

5)  Create a file called dbora:

# touch /etc/dbora

 

6)  Copy the following lines into this file:

# Note: Change the value of the ORACLE_HOME environment variable to your ASM 
# Oracle home directory for the installation. Change the value of the ORACLE 
# environment variable to the user name of the owner of the database installed in the 
# Oracle home directory (typically, oracle).


#! /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/10.2.0/db_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
      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

 

7)  Change the group of the dbora file to the OSDBA group (typically dba), and set the permissions to 750:

# chgrp dba dbora
# chmod 750 dbora

 

8)  For ASM instances, the /etc/dbora script cannot be used inside an rc*.d directory and it needs to be invoked from rc.local only. Otherwise, the CSS service may not be available yet, and this script will block init from completing the boot cycle. Therefore please perform the next steps to create the /etc/rc.local file:

# mkitab -i rcnfs "rclocal:2:wait:/etc/rc.local >/dev/console 2>&1"
# touch /etc/rc.local
# chmod 700 /etc/rc.local

 

9)  Then update the /etc/rc.local file with the next line:

/etc/dbora &

 

 

 

 

From Oracle

-------------------------------------------------------------------------------------------------------

Blog http://blog.csdn.net/tianlesoftware

Email: [email protected]

DBA1 群:62697716();   DBA2 群:62697977()   DBA3 群:62697850()  

DBA 超级群:63306533();  DBA4 群: 83829929  DBA5群: 142216823   

聊天 群:40132017   聊天2群:69087192

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

你可能感兴趣的:(How To Automate ASM Startup and Shutdown on AIX 5L [ID 580133.1])