oracle 10g 自动启动,oracle10G随Linux系统启动而自动启动

本文介绍了如何配置Linux系统使得Oracle数据库和Tomcat服务器在系统启动时自动运行。主要步骤包括编辑/etc/oratab文件,将Oracle数据库实例设置为自启动,然后在/etc/rc.d/rc.local文件中添加启动脚本,分别启动数据库监听、数据库实例和Tomcat服务器。重启系统后,这两个服务将自动启动。
摘要由CSDN通过智能技术生成

1、查看/etc/oratab这个文件:

[oracle@readhatAS53 etc]$ cat /etc/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::

#

# 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:/u01/oracle/product/ora10g:Y

当$ORACLE_SID:$ORACLE_HOME: 设置为Y时,允许实例自启动,当设置为N时,则不允许自启动。 这个文件里的配置仅仅起一个开关的作用,其并不会具体的执行启动和关闭,具体的操作由$ORACLE_HOME/bin/dbstart和dbshut 脚本来实现。 这2个脚本在执行时会检查/etc/oratab 文件里的配置,为Y时才能继续执行。因此只要将ORCL:/u01/oracle/product/ora10g:N修改为Y就行了。

2、使用root用户在/etc/rc.d/rc.local这个文件中添加如下内容:

#!/bin/sh

#

# This script will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

su - oracle -c'lsnrctl start'//启动oracle数据库监听

su - oracle -c'/u01/oracle/product/ora10g/bin/dbstart start'//启动oracle数据库实例

su - oracle -c'/opt/tomcat/apache-tomcat-6.0.20/bin/startup.sh'//启动tomcat服务器的配置。

3、reboot系统,oracle数据库与tomcat服务器就可以自动启动了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值