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:<ASMOracleHome>: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:ChangethevalueoftheORACLE_HOMEenvironmentvariabletoyourASM
#Oraclehomedirectoryfortheinstallation.ChangethevalueoftheORACLE
#environmentvariabletotheusernameoftheownerofthedatabaseinstalledinthe
#Oraclehomedirectory(typically,oracle).


#!/bin/sh-x
#
#ChangethevalueofORACLE_HOMEtospecifythecorrectOraclehome
#directoryforyourinstallation.

ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
#
#ChangethevalueofORACLEtotheloginnameofthe
#oracleowneratyoursite.
#
ORACLE=oracle

PATH=${PATH}:$ORACLE_HOME/bin
HOST=`hostname`
PLATFORM=`uname`
exportORACLE_HOMEPATH
#
if[!"$2"="ORA_DB"];then
if["$PLATFORM"="HP-UX"];then
remsh$HOST-l$ORACLE-n"$0$1ORA_DB"
exit
else
rsh$HOST-l$ORACLE$0$1ORA_DB
exit
fi
fi
#
case$1in
'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:

#chgrpdbadbora
#chmod750dbora

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-ircnfs"rclocal:2:wait:/etc/rc.local>/dev/console2>&1"
#touch/etc/rc.local
#chmod700/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表空间和数据文件的关系,否则拒绝申请

你可能感兴趣的:(shutdown)