Wednesday, July 23, 2008

Oracle auto start Script for Solaris x86 / Solaris 10

We have 10+ oracle 10g instances on Solaris different versions, I have worked alot with linux(EL, AS, Fedora4-9), but now days I am working with Solaris......
task is to configure oracle autostartup.

i made a file at /etc/rc3.d/S98oradbstart

-------------------------------------------------------------------------------------
#!/bin/sh
#
#echo "Starting Oracle Database" > /dev/consoleORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATHexport ORACLE_HOME LD_LIBRARY_PATH
su oracle -c "${ORACLE_HOME}/bin/dbstart" < /dev/nullexit 0
-------------------------------------------------------------------------------------
now either you will run level 3 or 5 your oracle plus listener will be started automatically.
Here was some error that i faced.
1.
/u01/app/oracle/product/10.2.0/db_1/bin/dbstart: VER10LIST=10: is not an identifier
i looked into file /u01/app/oracle/product/10.2.0/db_1/bin/dbstart
and changed
this export VER10LIST=`$ORACLE_HOME_LISTNER/bin/lsnrctl version grep "LSNRCTL for " cut -d' ' -f5 cut -d'.' -f1`
to

VER10LIST=`$ORACLE_HOME_LISTNER/bin/lsnrctl version grep "LSNRCTL for " cut -d' ' -f5 cut -d'.' -f1`; export VER10LIST

then faced
2. “`COUNT=$’ unexpected” at or near line 259
i changed in dbstart scropt
from
COUNT=$((COUNT+1))toCOUNT=`expr $COUNT + 1`

Now life is good.