1818IP-服务器技术教程,云服务器评测推荐,服务器系统排错处理,环境搭建,攻击防护等

当前位置:首页 - 数据库 - 正文

君子好学,自强不息!

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

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

  直接在rc.local里面添加

<codeclass="hljscs">[root@localhost~]#vim/etc/rc.local
touch/var/lock/subsys/local
su-oracle<lsnrctlstart
sqlplus/assysdba
startup
quit
EOF
su-oracle<exportORACLE_SID=pddev1
sqlplus/assysdba
startup
quit
EOF</code>

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

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

  2.1,测试

<codeclass="hljscs">[oracle@localhost~]$/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart
ORACLE_HOME_LISTNERisnotSET,unabletoauto-startOracleNetListener
Usage:/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstartORACLE_HOME
[oracle@localhost~]$
</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里面设置开机自启动

<codeclass="hljscs"><codeclass="hljsbash">[root@localhostbin]#vim/etc/rc.local

#!/bin/sh
#
#Thisscriptwillbeexecuted*after*alltheotherinitscripts.
#Youcanputyourowninitializationstuffinhereifyoudon't
#wanttodothefullSysVstyleinitstuff.
touch/var/lock/subsys/local
su-oracle-lc"/oracle/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctlstart"
su-oracle-c"/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart"</code></code>

  db服务器重启生效。

本文来源:1818IP

本文地址:https://www.1818ip.com/post/10783.html

免责声明:本文由用户上传,如有侵权请联系删除!

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。