Linux As4单实例Oracle系统启动/关闭脚本
1. 关于脚本的命名
脚本名称:oracle.sh 部署目录:/etc/rc.d/init.d 服务列表:RedHat服务 操作用户:root
启动oracle命令:/etc/init.d/oracle start 关闭oracle命令:/etc/init.d/oracle stop
service oracle start service oracle stop
2. 脚本内容
#!/bin/bash
#
# chkconfig: 2345 99 01
# de.ion: init . to start/stop oracle database 10g, TNS listener, EMS
#
#
# match these values to your environment:
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_TERM=xterm
export PATH=$ORACLE_HOME/bin:$PATH:/usr/sbin:$HOME/bin
#export NLS_LANG='croatian_croatia.ee8iso8859p2'
export ORACLE_SID=oraDBServer1
export DISPLAY=localhost:0
export ORACLE_USER=oracle
# see how we are called:
case $1 in
start)
su - "$ORACLE_USER"