- 浏览: 293441 次
- 性别:
- 来自: 郑州
文章分类
- 全部博客 (121)
- mysql数据库 (11)
- oracle数据库 (20)
- struts+hibernate+srping (5)
- Jquery (0)
- 编程常见问题 (11)
- java理论知识 (11)
- 编程知识 (17)
- JavaScript (2)
- 技巧积累 (32)
- SCJP考试 (2)
- 操作系统 (17)
- Linux(ubuntu) (7)
- Linux (23)
- extjs4 (0)
- jdk7 (3)
- dhtmlxGrid (3)
- sqlserver (1)
- log4j2 (2)
- Maven (5)
- c# (1)
- spring boot (8)
- vue (1)
- docker (1)
最新评论
-
jdnull:
你这只考虑查询啊。并发插入呢?
mysql5.5 uuid做主键与int做主键的性能实测 -
ajian0051:
缺少一个无参的构造方法!谢谢博主
REST web Services 的问题 “does not have a no-arg default constructor” -
bastengao:
可加上 limit 用例试试效果
mysql5.5 uuid做主键与int做主键的性能实测 -
xezhe:
您好,我更换CVS服务器遇到了同样的问题,现在还未解决。
我在 ...
windows vista/win7/2008 CVSNT打不开的问题 -
fch7120mn:
不错,解决了我一个问题
REST web Services 的问题 “does not have a no-arg default constructor”
本文引用来至于:http://dbajun.iteye.com/blog/247891
原文章的标题“Redhat as4 下oracle10g自启动脚本设置 ” 经过我的验证,此文的步骤在AS5.1 oracle11g下同样适用。
2011年12月22日 经验证在“Redflag AS 5.5”同样适用。
以redhat as4和oracle
10g为例。单机在安装过程依照oracle官方的文档一步步下来,只要设置好参数、安装好必要的包,一般不会出什么问题。安装好了以后系统重
启,oracle重启服务,网上很多人建议自己写脚本(其实脚本也很简单),这里讲的是用oracle本身的脚本实现,当然不可避免最后还要写一点点的。
1、配置dbstart和dbshut
在$ORACLE_HOME/bin中,有dbstart和dbshut这两个脚本,more dbstart看一下可以看到:
QUOTE: |
# # $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的一个特色,所以应该一并启动起该服务来。
QUOTE: |
$ORACLE_HOME/bin/emctl start dbconsole |
因此我们可以用rc.local或者redhat服务都可以实现要求的开机启动。下面分别说一下:
1)、利用rc.local。直接把dbstart加到rc.local中,实现开机自动启动。这里需要注意的是必须以oracle启动该脚本。
用root编辑/etc/rc.local,添加下面一行:
QUOTE: |
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:(以root用户)
QUOTE: |
#!/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 |
注意其中两行注释,网上很多脚本因为少了这两行不能使服务自启动:
QUOTE: |
#chkconfig: 2345 99 01 #description: ORACLE 10g Server |
其中chkconfig:2345 99 01 是指脚本将为运行级2、3、4、5启动oracle 10g服务,启动优先级为99,关闭优先级为01。
然后以root权限:(要给刚才创建的oracle赋予755权限,否则服务启动不起来。)
QUOTE: |
# chmod 755 /etc/rc.d/init.d/oracle # cd /etc/rc2.d |
重启系统,就可以在启动的过程中看到 Starting oracle,因为我们设置的优先级为99,一般是最后启动。[OK]以后就可以了。因为要启动emctl,可能有点慢,等待的时间要稍微长一点。
启动以后可以以root执行oracle start或者oracle stop来启动或停止服务。
发表评论
-
在CentOS 7 中使用Vmware提供的共享文件夹
2019-10-23 16:05 369安装vm tool (vm15版本,默认都会安装这个,所 ... -
Centos7关机和重启前执行自定义脚本
2019-05-23 16:29 13700. 前言 如果你在linux系统上启动了很多自 ... -
CentOS7忘记root密码
2019-05-17 13:57 542转载来源:https://www.cnblogs.com/c ... -
myeclipse、eclipse linux下 手动安装lombok
2018-04-20 10:48 1672前提 linux Ubuntu 使用MyEclipse,手动 ... -
CentOS 下挂载NTFS文件系统并实行开机自动挂载
2015-12-29 18:34 1621来源:http://www.linuxidc.com/Li ... -
Linux启动/关机时执行脚本
2015-11-11 10:44 1449来源:http://blog.chinaunix.net/u ... -
linux 系统优化tcp连接
2015-03-02 13:31 895最近几天 系统不太稳定, tcp/ip 连接超级多,估计应用 ... -
linux系统,虚拟机上短信~猫的配置
2015-01-27 14:30 754我的环境:linux(redhat 6.4),然后安装虚拟机 ... -
解决windows oracle安装失败的方法
2015-01-27 10:57 1531转载:http://blog.chinaunix ... -
linux下VMWare 端口映射与转发的例子
2015-01-26 18:35 1875首先,保证是NAT方式虚拟机和主机连接,并且想把虚拟机的某 ... -
RedHat6.5 搭建VNC服务
2015-01-26 15:21 893RedHat安装时默认没有VNC服务,需要自己安装。1.首先 ... -
OJDBC版本区别 [ojdbc14.jar,ojdbc5.jar和ojdbc6.jar的区别]
2014-06-05 09:53 562在使用Oracle JDBC驱动时,有些问题你是不是通过替换 ... -
druid 配置教程
2013-12-03 11:12 1656java程序很大一部分要操作数据库,为了提高性能操作数据库的 ... -
处理百万级以上数据的注意事项
2013-07-03 19:18 1274处理百万级以上的数据提高查询速度的方法: 1.应尽量避免 ... -
linux下更改机器名后oracle 如何配置
2013-04-14 21:05 1501理论上支持10g 11g。8i 9 ... -
linux 如果更改机器名和IP
2013-04-14 20:49 1344第一种方法,使用linux自带的“网络”管理工具 第 ... -
oracle EM的访问方式由https换成http 反之依然
2013-04-14 20:47 1796https 变成 http 执行 $ emctl u ... -
oracle 11g 登录连接非常慢 解决方法
2013-04-13 20:24 1647首先注意,在装linux的时候 DNS 不写 解决 ... -
Linux rpm 命令参数使用详解
2013-04-13 20:14 869常用命令组合: -ivh:安装显示安装进度--ins ... -
redhat as5.5 安装64位oracle11g 安装手册
2013-04-13 19:19 2468先说遇到的纠结问题,操作系统redhat as5.5 ...
相关推荐
RedHat AS4 下安装oracle10g.txt
RedHat AS4下安装oracle 10g
RedHat AS4上安装oracle10g并创建使用oracle数据库RedHat AS4上安装oracle10g并创建使用oracle数据库
Redhat AS4或AS5下oracle10g安装的便捷脚本,可以完成oracle10g图形界面安装前解压缩安装包、创建用户、修改内核参数、修改环境变量等操作,以及安装后设置oracle自启动等操作。
这是最新的redhat5.1配置centos yum的教程,将redhat的收费yum替换成centos免费yum,里面的软件下载地址是最新的(2014-02-28),大家可以直接wget使用,如果提示不可用可能是格式问题,建议先复制到记事本然后在粘贴...
在redhat环境下设置oracle10g开机自动启动
RedHat+Linux+5.1下安装oracle9i
一. OS环境准备 二. 安装ORACLE之环境准备 三. 手动安装Oracle11gR2 四. Rehat 设置Oracle数据库开机自动启动
RedHat AS4.0 Tomcat Apache Oracle10g
一、 RedHat AS4系统安装 二、 Oracle的安装前准备 三、 Oracle10g的安装 四、 测试Oracle10g 数据库 五、 设置oracle自动启动与关闭
Redhat AS 4 up 4下配置ORACLE 10G文档
Linux下安装Oracle 11g 设置开机自启动,使用chkconfig --add来进行配置才是规范的做法,这个文档是我按规范配置的生产系统。 我的Linux版本是Redhat Linux Enterprise 6.3 x64。
Redhat AS3安装Oracle9i Redhat AS3安装Oracle9i
redhat+as4.0下oracle+10g+r2安装手册.doc redhat+as4.0下oracle+10g+r2安装手册.doc
RedHat AS4 下安装oracle10.2.0
由于自己在找这些rpm的时候花费了挺多时间的,在此作个资源,为大家节省一些时间。redhat6.6安装oracle11g所需全部rpm
RedHat_Linux6.3下Oracle_11g安装图解教程
redhat AS5上安装oracle10g笔记:祝你好运。 送上一条建议:用ORACLE正版关盘实在安装不上去的话,在oracle网站上下载一个相同的版本再安装试试
在RedHat AS5上安装oracle10G详细过程!配图完整
用于指导在在redhat as5上安装oracle 10g的操作,并说明如如何对现有库进行升级。