Oracle 10 在 Linux 下设置系统启动时自动启动

[复制链接]
查看11 | 回复6 | 2010-3-1 11:20:04 | 显示全部楼层 |阅读模式
编辑/etc/oratab文件,将orcl:/opt/oracle/product/10.2.0/db_1:N改为orcl:/opt/oracle/product/10.2.0/db_1:Y
在/etc/rc.d/init.d目录下配置oracle服务文件,执行下列命令:
touch oracle //创建文件
chmod a+x oracle //设置可执行权限
添加以下内容:
#!/bin/bash
#description:starts the oracle database deamons

ORA_HOME="/opt/oracle/product/10.2.0/db_1"
ORA_OWNER="oracle"

case $1 in
'start')
echo -n "***Starting Oracle***"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart"
;;

'stop')
echo -n "***Stopping Oracle***"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut"
;;

'restart')
echo -n "***Restarting Oracle***"
$0 stop
$0 start
;;

'isqlstart')
echo "***Starting Oracle iSQL PLus***"
su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl start"
echo "*** Note:You can access service at url:http://$(hostname):5560/isqlplus"
;;

'isqlstop')
echo "***Stopping Oracle iSQL Plus***"
su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl stop"
;;

'emstart')
echo "***Starting Oracle Enterprise Manager 10g Database control***"
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"
echo "Note:You can access service as url:http://$(hostname):1158/em"
;;

'emstop')
echo "***Stopping Oracle Enterprise Manager 10g Database control***"
su - $ORA_OWNER -c "ORA_HOME/bin/emctl stop dbconsole"
;;

'*')
echo "Usage:$0 {start|stop|isqlstart|isqlstop|emstart|emstop}"
exit 1

esac
exit 0

执行下列命令测试:
/etc/rc.d/init.d/oracle start
/etc/rc.d/init.d/oracle stop
测试成功后,执行下列命令添加到系统服务中:
chkconfig –add oracle
chkconfig –list oracle
重新启动服务器。
回复

使用道具 举报

千问 | 2010-3-1 11:20:04 | 显示全部楼层
我一般手工起动!
回复

使用道具 举报

千问 | 2010-3-1 11:20:04 | 显示全部楼层
不错。支持一下。
回复

使用道具 举报

千问 | 2010-3-1 11:20:04 | 显示全部楼层
顶一下。
回复

使用道具 举报

千问 | 2010-3-1 11:20:04 | 显示全部楼层
按照你的方法,我没有成功。
我的环境:RHEL4update5 64位,oracle10.2.0.1 两个节点的RAC。
回复

使用道具 举报

千问 | 2010-3-1 11:20:04 | 显示全部楼层
按照你的方法,我没有成功。
我的环境:RHEL4update5 64位,oracle10.2.0.1 两个节点的RAC。
回复

使用道具 举报

千问 | 2010-3-1 11:20:04 | 显示全部楼层
顶一下
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行