#!/bin/bash # # oraasm Starts Oracle ASM # # chkconfig: 345 31 18 # description: Oracle Autoamtic Storage Management # ### BEGIN INIT INFO # Provides: oraasm # Required-Start: oracleasm ### END INIT INFO # Source function library. . /etc/init.d/functions # Source config if [ -f /etc/sysconfig/oracle ] ; then . /etc/sysconfig/oracle else ASM_SID="+ASM" fi ORACLE_SID="$ASM_SID" ORACLE_HOME=$(/usr/local/bin/dbhome $ORACLE_SID) LOGFILE="/var/log/oracle_asm.log" export ORACLE_SID ORACLE_HOME LOGFILE ASM_SID RETVAL=0 # Wrapper function to run commands inside sqlplus run_sql() { if [ ! -x $ORACLE_HOME/bin/sqlplus ]; then echo "Oracle SQL*Plus not found. Aborting." return 1 fi su ${ORACLE_USER:-oracle} < $LOGFILE $ORACLE_HOME/bin/sqlplus / as sysdba <