Files
bin/ora_start.sh

17 lines
603 B
Bash
Executable File

#!/bin/sh
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH
/u01/app/oracle/product/11.2.0/xe/bin/lsnrctl start
# check if oracle is already running
lPID=`pgrep -f xe_pmon_XE`
if [ "$?" = "1" ]; then
/bin/su -s /bin/bash oracle -c 'ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe /u01/app/oracle/product/11.2.0/xe/bin/sqlplus -s /nolog @/u01/app/oracle/product/11.2.0/xe/config/scripts/startdb.sql'
fi