Oracle11g在linux系统下开机自启动设置

数据库 Oracle
oracle服务器一般来说最好是手动启动,这样碰到问题的话,可以现场解决,但是也担心有时候机器故障,自动重启后,为了快速恢复应用,需要自动开机启动oracle,而且发现在不同的os下,启动的设置都不太一样

  oracle服务器一般来说***是手动启动,这样碰到问题的话,可以现场解决,但是也担心有时候机器故障,自动重启后,为了快速恢复应用,需要自动开机启动oracle,而且发现在不同的os下,启动的设置都不太一样

  1,centos操作系统下,可以这样设置

  直接在rc.local里面添加

 

  1. <code class="hljs cs">[root@localhost ~]# vim /etc/rc.local 
  2. touch /var/lock/subsys/local 
  3. su - oracle < lsnrctl start  
  4. sqlplus / as sysdba 
  5. startup 
  6. quit 
  7. EOF 
  8. su - oracle < export ORACLE_SID=pddev1 
  9. sqlplus / as sysdba 
  10. startup 
  11. quit 
  12. EOF</code> 

 

  重启后生效,PS:但是在redhat系统下失效

  2,redhat操作系统下面,用dbstart的方式

  2.1,测试

  1. <code class="hljs cs">[oracle@localhost ~]$ /oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart 
  2. ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener 
  3. Usage: /oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart ORACLE_HOME 
  4. [oracle@localhost ~]$  
  5. </code> 

 

  

  有报错信息,提示ORACLE_HOME不识别,如下解决方案,修改dbstart和dbstut,有的版本dbstut找不到不存在,可以忽略。

  vim /oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart

  vim /oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstut

  将

  ORACLE_HOME_LISTNER =$1

  改成

  ORACLE_HOME_LISTNER=$ORACLE_HOME

  2.2,[root@localhost ~]# vim /etc/oratab

  powerdes:/oracle/app/oracle/product/11.2.0/dbhome_1:Y

  2.3 在rc.local里面设置开机自启动

  1. <code class="hljs cs"><code class="hljs bash">[root@localhost bin]# vim /etc/rc.local 
  2.   
  3. #!/bin/sh 
  4. # This script will be executed *afterall the other init scripts. 
  5. # You can put your own initialization stuff in here if you don't 
  6. # want to do the full Sys V style init stuff. 
  7. touch /var/lock/subsys/local 
  8. su - oracle -lc "/oracle/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start" 
  9. su - oracle -c "/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart"</code></code> 

 

  db服务器重启生效。

责任编辑:honglu 来源: 红黑联盟
相关推荐

2009-10-10 09:01:50

RHEL5启动与关闭

2011-08-01 12:50:18

LinuxOracle10GOracle11G

2010-01-04 10:05:18

linux挂载windows

2010-04-01 15:41:26

Oracle11g

2009-11-11 10:26:02

LinuxOracle监听自启动

2010-04-12 13:56:44

Oracle11g

2013-01-18 17:30:32

Linux系统

2023-09-21 22:03:30

oracle11g数据库

2010-04-15 15:59:31

Oracle11g

2010-04-15 13:14:18

linux下Oracl

2010-04-12 10:07:03

Oracle数据库11

2022-11-14 16:56:43

项目开发WiFi程序

2023-03-02 23:45:23

linux开机启动Windows

2009-11-24 10:06:21

SUSE enterp

2011-07-26 10:47:38

Oracle 11g客Linux系统

2018-03-02 13:28:19

Linux开机自启动

2010-02-03 09:47:34

Linux smb服务

2016-09-23 15:50:25

Windows 7VirtualBox虚拟机

2011-05-13 11:21:51

linuxoracle 10g安装

2010-03-31 10:52:09

Oracle11g r
点赞
收藏

51CTO技术栈公众号