免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1594 | 回复: 0
打印 上一主题 下一主题

Oracle自动启动问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-01-25 09:41 |只看该作者 |倒序浏览
环境:redhat enterprise linux server 3 update3,oracle9ir6(9.2.0.6)

根据oracle的文档,建立如下启动文档dbora放在/etc/init.d下面
#!/bin/sh
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/opt/ora9/product/9.2
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi

case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart &
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut &
;;
Esac

发现oracle无论如何不能开机时自动启动。但是登录后运行相应脚本又能够启动数据库,不管是以root登录运行 /etc/rc.d/init.d/dbora start还是直接以oracle登录运行dbstart都可以。后来加了无数的echo语句发现开机启动执行dbstart脚本到如下命令时不再运行:
                        *)  $SQLDBA << EOF
connect / as sysdba
startup
EOF
百思不得其解。然后修改dbora脚本,把su - $ORA_OWNER -c $ORA_HOME/bin/dbstart &改为su - $ORA_OWNER -c $ORA_HOME/bin/dbstart ,即不让其在后台执行,系统顺利的实现在开机时自动启动oracle。虽然达到了目的,但是仍然不知道为什么。为什么在后台就不能顺利执行dbstart脚本呢?请shell高手指教。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP