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. automatic 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 procedure is as follows:
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
# 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
# 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
Bytes -------------------------------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
Email: dvd.dba@gmail.com
Dba1 group: 62697716 (full); dba2 group: 62697977 (full) dba3 group: 62697850 (full)
Super DBA group: 63306533 (full); dba4 group: 83829929 dba5 group: 142216823
Chat group: 40132017 chat 2 group: 69087192
-- Add the group to describe the relationship between Oracle tablespace and data files in the remarks section. Otherwise, the application is rejected.