风之语

posts(201) comments(182) trackbacks(1)
  • BlogJava
  • 联系
  • RSS 2.0 Feed 聚合
  • 管理

常用链接

  • 我的随笔
  • 我的评论
  • 我的参与
  • 最新评论

留言簿

  • 给我留言
  • 查看公开留言
  • 查看私人留言

随笔分类

  • ajax(1)
  • android(1)
  • apache(1)
  • AppFuse(1)
  • BIRT(1)
  • iText(1)
  • JSF(8)
  • kettle(1)
  • linux(5)
  • mac(1)
  • maven(1)
  • MSTR(3)
  • Open XML(1)
  • Oracle(21)
  • RCP
  • Struts(2)
  • Struts2(2)
  • SybaseIQ(6)
  • tapestry
  • tomcat(2)
  • weblogic(1)
  • webservice(1)
  • weka(1)
  • 云计算(1)
  • 收藏(31)
  • 数据仓库(11)
  • 架构设计(3)
  • 生活(2)
  • 集群(1)
  • 项目管理(6)

随笔档案

  • 2012年12月 (4)
  • 2012年11月 (1)
  • 2012年7月 (2)
  • 2011年8月 (1)
  • 2011年7月 (1)
  • 2011年3月 (1)
  • 2010年12月 (2)
  • 2010年11月 (4)
  • 2010年10月 (3)
  • 2010年9月 (5)
  • 2010年8月 (1)
  • 2010年7月 (4)
  • 2010年3月 (1)
  • 2010年2月 (3)
  • 2009年12月 (3)
  • 2009年11月 (4)
  • 2009年9月 (3)
  • 2009年6月 (5)
  • 2009年5月 (3)
  • 2009年4月 (2)
  • 2009年3月 (5)
  • 2009年2月 (4)
  • 2009年1月 (2)
  • 2008年11月 (2)
  • 2008年9月 (1)
  • 2008年7月 (2)
  • 2008年6月 (4)
  • 2008年5月 (6)
  • 2008年4月 (1)
  • 2008年3月 (1)
  • 2007年12月 (2)
  • 2007年11月 (5)
  • 2007年10月 (2)
  • 2007年9月 (3)
  • 2007年8月 (3)
  • 2007年4月 (1)
  • 2007年3月 (2)
  • 2007年2月 (2)
  • 2007年1月 (2)
  • 2006年12月 (3)
  • 2006年8月 (2)
  • 2006年7月 (2)
  • 2006年6月 (2)
  • 2006年4月 (2)
  • 2006年3月 (1)
  • 2006年2月 (3)
  • 2006年1月 (6)
  • 2005年12月 (6)
  • 2005年11月 (4)
  • 2005年10月 (17)
  • 2005年9月 (25)
  • 2005年8月 (16)
  • 2005年7月 (8)

相册

  • 技术图片

收藏夹

  • java

link

My wife

  • My wife's blog

最新随笔

  • 1. apache修改最大连接并用ab网站压力测试
  • 2. Vm虚拟机访问本地硬盘文件
  • 3. NFS文件无法写入的权限问题
  • 4. weblogic设置上传文件访问权限
  • 5. 在android上动态实现ichartjs的3D柱形图
  • 6. 使用Oracle trunc 来指定精确的年月日时分秒
  • 7. Quartz 2.1.5 web应用配置
  • 8. LoginAny 使用笔记
  • 9. MyEclipse 无响应的几种解决办法
  • 10. java.sql.SQLException: No more data to read from socket

搜索

  •  

积分与排名

  • 积分 - 402120
  • 排名 - 139

最新评论

  • 1. re: 使用Oracle trunc 来指定精确的年月日时分秒[未登录]
  • 政治
  • --张三
  • 2. re: 干掉流氓软件vrvrf_c.exe,vrvedp_m.exe[未登录]
  • `
  • --1
  • 3. re: 无需刻录DMG光盘,教你在VMWare下安装MAC OS X Snow Leopard 10.6
  • 我走到了换DMG映像的时候,然后就没有反应了,这个是什么情况,是不是我的映像文件有问题,还是。。。。
  • --玉竹常青
  • 4. re: LoginAny 使用笔记
  • 怎么没一个人留言,现在来是不是在挖坟啊
  • --ellipse
  • 5. MSTR web应用的部署[未登录]
  • 请问,如何用oracle Application Server服务器部署mstr web应用?
  • --rocky

阅读排行榜

评论排行榜

View Post

Redhat Linux AS4(AS5)下oracle10g自启动脚本设置

以redhat as4和oracle 10g为例。单机在安装过程依照oracle官方的文档一步步下来,只要设置好 参数、安装好必要的包,一般不会出什么问题。安装好了以后系统重启,oracle重启服务,网上很多人建议自己写脚本(其实脚本也很简单),这里讲的是用 oracle本身的脚本实现,当然不可避免最后还要写一点点的。

1、配置dbstart和dbshut

在$ORACLE_HOME/bin 中,有dbstart和dbshut这两个脚本,more dbstart看一下可以看到:

#
# $Id: dbstart.sh.pp 11-may-2005.18:18:07 vikrkuma Exp $
# Copyright (c) 1991, 2005, Oracle. All rights reserved.
#

###################################
#
# usage: dbstart
#
# This script. is used to start ORACLE from /etc/rc(.local).
# It should ONLY be executed as part of the system boot procedure.
#
# This script. will start all databases listed in the oratab file
# whose third field is a "Y". If the third field is set to "Y" and
# there is no ORACLE_SID for an entry (the first field is a *),
# then this script. will ignore that entry.
#
# This script. requires that ASM ORACLE_SID's start with a +, and
# that non-ASM instance ORACLE_SID's do not start with a +.
#
# If ASM instances are to be started with this script, it cannot
# be used inside an rc*.d directory, and should be invoked from
# rc.local only. Otherwise, the CSS service may not be available
# yet, and this script. will block init from completing the boot
# cycle.
#
# Note:
# Use ORACLE_TRACE=T for tracing this script.
#
# The progress log for each instance bringup plus Error and Warning message[s]
# are logged in file $ORACLE_HOME/startup.log. The error messages related to
# instance bringup are also logged to syslog (system log module).
# The Listener log is located at $ORACLE_HOME_LISTNER/listener.log
......

可以看出这个脚本是用来启动oracle服务的,包括listener、instance、asm instances,并且可以放到/etc/rc(.local).,同样dbshut也是起到关闭服务的作用。

配置系统使这个脚本起作 用:

1)、以root编辑/etc/oratab,类似 orcl:/u01/product/10.2.0/db_1:N 这种格式,其中orcl是你的ORACLE_SID,/u01/product/10.2.0/db_1是ORACLE_HOME,这里需要把N改为Y, 即orcl:/u01/product/10.2.0/db_1:Y这样。

2)、以oracle编辑$ORACLE_HOME/bin /dbstart,找到其中第78行:ORACLE_HOME_LISTNER=改为你自己的路径,或者可以改成 ORACLE_HOME_LISTNER=$ORACLE_HOME

保存脚本,以oracle用户运行dbshut和dbstart看是 否能关闭、启动数据库。如 果不能,一般是参数设置,根据报错找到对应位置更改。

2、 把dbstart和dbshut加到redhat启动服务中

经过上一步的配置,可以直接用 dbstart命令启动数据listener、instance、asm instances,但是还没有启动oracle10g的EM,ORACLE利用web页 面管理数据库相当方便,也 是10g的一个特色,所以应该一并启动起该服务来。

$ORACLE_HOME/bin/emctl start dbconsole

因此我们可以用rc.local或者redhat服务都可以实现要求的开机启动。下面分别说一下:

1)、利用 rc.local。直接把dbstart加到rc.local中,实现开机自动启动。这里需要注意的是必须以oracle启动该脚本。

用 root编辑/etc/rc.local,添加下面一行:

su - oracle -c "/u01/product/10.2.0/db_1/bin/dbstart"
su - oracle -c "/u01/product/10.2.0/db_1/bin/emctl start dbconsole"

这里/u01/product/10.2.0/db_1需要替换成实际的ORACLE_HOME

保存并退出后,reboot服务器测试一下,可以看到,当系统启动以后oracle监听、实例 和em都已经起来了

2)、如果我们不用rc.local,也可以加到redhat服务中。在/etc/rc.d /init.d中添加如下脚本文件,命名为oracle:

#!/bin/sh
#chkconfig: 2345 99 01
#description: ORACLE 10g Server

ORACLE_HOME=/u01/product/10.2.0/db_1

if [ ! -f $ORACLE_HOME/bin/dbstart ]
then
echo "ORACLE cannot start"
exit
fi

case "$1" in
'start')
echo "Starting Oracle Database..."
su - oracle -c "$ORACLE_HOME/bin/dbstart"
su - oracle -c "$ORACLE_HOME/bin/emctl start dbconsole"
;;
'stop')
echo "Stoping Oracle Database"
su - oracle -c "$ORACLE_HOME/bin/emctl stop dbconsole"
su - oracle -c "$ORACLE_HOME/bin/dbshut"
;;
esac

注意其中两行注释,网上很多脚本因为少了这两行不能使服务自启动:

#chkconfig: 2345 99 01
#description: ORACLE 10g Server

其中chkconfig:2345 99 01 是指脚本将为运行级2、3、4、5启动oracle 10g服务,启动优先级为99,关闭优先级为01。

然后以root权限:

# cd /etc/rc2.d
# ln -s /etc/rc.d/init.d/oracle S99oracle
# chkconfig --list oracle
# chkconfig --level 2345 oracle on

重启系统,就可以在启动的过程中看到 Starting oracle,因为我们设置的优先级为99,一般是最后启动。[OK]以后就可以了。因为要启动emctl,可能有点慢,等待的时间要稍微长一点。

启 动以后可以以root执行oracle start或者oracle stop来启动或停止服务。


 

posted on 2010-10-27 19:46 风 阅读(529) 评论(0)  编辑  收藏 所属分类: Oracle

新用户注册  刷新评论列表  

只有注册用户登录后才能发表评论。


网站导航:
博客园   IT新闻   Chat2DB   C++博客   博问   管理
相关文章:
  • 使用Oracle trunc 来指定精确的年月日时分秒
  • Oracle进程导致CPU 100%的具体解决步骤
  • Redhat Linux AS4(AS5)下oracle10g自启动脚本设置
  • 深刻理解Oracle数据库的启动和关闭
  • oracle查询命中率调优的一个方法(有用呦)
  • Oracle内存参数调优技术详解
  • win7下安装Oracle10g
  • Oracle10g卸载后再次安装,设置的SID相同出现“指定的SID在本机上已经存在。。。解决方法
  • Oracle 10g 可以自动共享内存管理
  • ORA-02095: 无法修改指定的初始化参数
 
 
Powered by:
BlogJava
Copyright © 风