Rootop 服务器运维与web架构

redhat5.5_x64 oracle 11g r2 自启动脚本

| 暂无评论

数据库启动关闭脚本:

#!/bin/sh
# chkconfig: 345 61 61
# description: Oracle 11g AutoRun Services
# /etc/init.d/oracle
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface

export ORACLE_BASE=/u01
export ORACLE_HOME=$ORACLE_BASE/oracle
export ORACLE_SID=venus
export PATH=$PATH:$ORACLE_HOME/bin
ORA_OWNR=”oracle”

# if the executables do not exist — display error
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo “Oracle startup: cannot start”
exit 1
fi

# depending on parameter — startup, shutdown, restart
# of the instance and listener or usage display

case “$1” in
start)
# Oracle listener and instance startup
su $ORA_OWNR -lc $ORACLE_HOME/bin/dbstart
echo “Oracle Start Succesful!OK.”
;;
stop)
# Oracle listener and instance shutdown
su $ORA_OWNR -lc $ORACLE_HOME/bin/dbshut
echo “Oracle Stop Succesful!OK.”
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo $”Usage: `basename $0` {start|stop|reload|reload}”
exit 1
esac
exit 0

EM启动关闭脚本(enterprise manager)

#!/bin/sh
# chkconfig: 345 61 61
# description: Oracle 11g AutoRun Services
# /etc/init.d/oraemctl
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface

export ORACLE_BASE=/u01
export ORACLE_HOME=$ORACLE_BASE/oracle
export ORACLE_SID=venus
export PATH=$PATH:$ORACLE_HOME/bin
ORACLE_OWNER=”oracle”

case “$1″ in
start)
echo -n $”Starting Oracle EM DB Console:”
su – $ORACLE_OWNER -c “$ORACLE_HOME/bin/emctl start dbconsole”
echo “OK”
;;
stop)
echo -n $”Stopping Oracle EM DB Console:”
su – $ORACLE_OWNER -c “$ORACLE_HOME/bin/emctl stop dbconsole”
echo “OK”
;;
*)
echo $”Usage: $0 {start|stop}”
esac

以上特别注意红色部分跟实际环境要一致。

redhat5.5_x64 oracle 11g r2_x64 安装文档:

https://www.rootop.org/pages/1075.html

原创文章,转载请注明。本文链接地址: https://www.rootop.org/pages/1347.html

作者:Venus

服务器运维与性能优化

发表回复