Linux中在Oracle安装完毕以后,如果重新启动Linux ,Oracle是不会自动启动的,你可以通过手动调用dbstart命令来进行启动,不过这样似乎也很繁琐.我们可以通过配置Oracle的自动启动脚本,然后利用Linux的Service来启动Oracle服务器.
首先在/etc/init.d/目录下配置Oracle的服务文件.
touch oracle10g
chmod a+x oracle10g
然后编辑此oracle10g文件.内容如下.
下载: oracle10g
# !/bin/bash
# whoami
# root
# chkconfig: 345 51 49
# /etc/init.d/oracle10g
# description: starts the oracle dabase deamons
#
ORA_HOME=/oracle/product/10.2.0/db_1/
ORA_OWNER=oracle
case "$1" in
start)
echo -n "Starting oracle10g: "
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart" &
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
touch /var/lock/subsys/oracle10g
echo
;;
stop)
echo -n "shutting down oracle10g: "
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut" &
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
rm -f /var/lock/subsys/oracle10g
echo
;;
restart)
echo -n "restarting oracle10g: "
$0 stop
$0 start
echo
;;
*)
echo "Usage: `basename $0` start|stop|restart"
exit 1
esac
exit 0
保存文件,退出以后,添加并启动察看服务.
/sbin/chkconfig --add oracle10g
/sbin/chkconfig --list oracle10g
重新启动Linux的时候,如果看到启动项Oracle出现OK,代表Oracle成功随Linux启动了.
注意:
这样的脚本启动一般不会启动实例,如果想让实例也随脚本一起启动的话,就需要修改文件:/etc/oratab
如果这个文件不存在,那么就得运行脚本文件产生它.ex:
sh /oracle/product/10.2.0/db_1/root.sh
比如我的oratab代码如下:
#
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
orcl:/oracle/product/10.2.0/db_1:N
xok:/oracle/product/10.2.0/db_1:Y
看设置,可以看出实例 xok 是自动启动的(表识是Y),而orcl的表识是N,则不启动.只要在这里设置好后,在配合上面的脚本,即可实现开机自动启动oracle以及实例了.
本文来自: E点废墟(www.xok.la) 详细出处参考:http://xok.la/2008/11/linux_oracle_10g_instance_auto_start.html
分享到:
相关推荐
Linux 下设置oracle 10g 自动启动服务 Linux 下设置oracle 10g 自动启动服务
linux中安装了数据库之后机器重启之后,会提示数据库无法使用的问题,主要是一些环境参数没有设置的原因,设置好环境参数之后以后oracle数据实例就会随着linux系统启动而自动启动。
linux启动oracle方法linux启动oracle方法linux启动oracle方法linux启动oracle方法linux启动oracle方法linux启动oracle方法linux启动oracle方法linux启动oracle方法linux启动oracle方法linux启动oracle方法linux启动...
在redhat环境下设置oracle10g开机自动启动
Linux下安装oracle 10g
个人实施的日记,记述了配置oracle10g在linux中自启动工作的全部过程
Linux下Oracle 10g安装 有不少网友需要,学习在Linux上从头安装 Oracle 数据库 10g 的基础知识(仅用于评估)。
在linux下安装oracle10G,附加jdk的安装。
在linux手动新建oracle实例,或多个实例。基本步骤: 1) 指定一个SID 2) 创建所需的文件目录 3) 创建初始化参数文件pfile 4) 确定数据库认证方式,如果给予口令认证,创建口令文件 5) 编写创建数据库脚本 6) ...
linux环境下oracle10g安装 1.连接putty 2.用root登录后建立用户和组 新增oinstall、dba用户组,oracle用户 [root@oracle10g /]# groupadd oinstall [root@oracle10g /]# groupadd dba [root@oracle10g /]# useradd ...
手把手教你用VMware在Linux下安装Oracle 10g RAC
Oracle10g-linux安装包
教你在linux系统上安装oracle10g
修改数据库最大连接数以及linux系统下ORACLE数据库启动多实例参照.pdf
linux下创建oracle10实例及启动方法.docx
linux中安装ORACLE10g数据库详细步骤
参考网上资料整理的RedHat EnterPrise5 下oracle10g的安装。
oracle 版本 10.2.0 再linux下创建新实例