在Linux上自动启动和关闭Oracle数据库(9i/10g/11g)_Oracle数据库_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

在Linux上自动启动和关闭Oracle数据库(9i/10g/11g)

作者:黑客防线网安Oracle维护基地 来源:黑客防线网安Oracle维护基地 浏览次数:0

黑客防线网安网讯:  在Oracle 1gR2或更高版本下使用RAC或ASM时,Oracle Clusterware会自动启动和停止Oracle数据库实例,因此下面的过程不是必需的,对于其他情况,你就可以使用下面描述的方法了。  ◆su命...

  在Oracle 1gR2或更高版本下使用RAC或ASM时Oracle Clusterware会自动启动和停止Oracle数据库实例因此下面的过程不是必需的,对于其他情况,你就可以使用下面描述的方法了

  ◆su命令

  下面的描述是Oracle建议采用的自动启动和关闭Oracle 9i实例的方法

  一旦实例创建好后,标记/etc/oratab文件设置每个实例的重启标志为“Y”:

  TSH1:/u01/app/oracle/product/9.2.0:Y

  接下来,作为root用户登陆创建一个叫做/etc/init.d/dbora的文件,包括下面的内容:

  #!/bin/sh
  #chkconfig:3459910
  #description:Oracleautostart-stopscript.
  #
  #SetORA_HOMEtobeequivalenttothe$ORACLE_HOME
  #fromwhichyouwishtoexecutedbstartanddbshut;
  #
  #SetORA_OWNERtotheuseridoftheownerofthe 
  #OracledatabaseinORA_HOME.
  ORA_HOME=/u01/app/oracle/product/9.2.0
  ORA_OWNER=oracle
  if[!-f$ORA_HOME/bin/dbstart]
  then
  echo"Oraclestartup:cannotstart"
  exit
  fi
  case"$1"in
  ’start’)
  #StarttheOracledatabases:
  #Thefollowingcommandassumesthattheoraclelogin 
  #willnotprompttheuserforanyvalues
  su-$ORA_OWNER-c"$ORA_HOME/bin/lsnrctlstart"
  su-$ORA_OWNER-c$ORA_HOME/bin/dbstart
  ;;
  ’stop’)
  #StoptheOracledatabases:
  #Thefollowingcommandassumesthattheoraclelogin 
  #willnotprompttheuserforanyvalues
  su-$ORA_OWNER-c$ORA_HOME/bin/dbshut
  su-$ORA_OWNER-c"$ORA_HOME/bin/lsnrctlstop"
  ;;
  esac

  使用chmod命令设置权限为750:

  chmod750/etc/init.d/dbora

  使用下面的命令配合适当的运行级别设置dbora服务自动启动:

  chkconfig--level345dboraon

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-12598-1.html
网站维护教程更新时间:2012-03-23 00:43:12  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer