讲解Linux环境下Oracle数据库的自动启动与停止_Oracle数据库_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

讲解Linux环境下Oracle的自动启动与停止

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

黑客防线网安网讯:  1、 修改Oracle系统配置文件/etc/oratab   /etc/oratab 格式为: SID:ORACLE_HOME:AUTO   把AUTO域设置为Y(大写),只有这样,oracle 自带的dbstart和dbshut才能够发挥作用。我的为:...

  1、 修改Oracle系统配置文件/etc/oratab

  /etc/oratab 格式为: SID:ORACLE_HOME:AUTO

  把AUTO域设置为Y(大写)只有这样oracle 自带的dbstart和dbshut才能够发挥作用我的为:

  ora9i:/home/oracle/ora/products/9.2.0:Y

  2、 编写服务脚本:

  如下:

#!/bin/bash 
# 
#################FUNCTION############# 
# 
#AutoStartOracleandlistener 
#AutoStopOracleandlistener 
# 
##################################### 
# 
#createdbyZhouYS2003-11-26 
# 
case"$1"in 
start) 
echo"StartingOracleDatabases..." 
echo"-------------------------------------------------">>/var/log/oracle 
date+"%T%a%D:StartingOracleDatabaseeaspartofsystemup.">>/var/log/oracle 
echo"-------------------------------------------------">>/var/log/oracle 
su-oracle-c"dbstart">>/var/log/oracle 
echo"Done." 
echo"StartingOracleListeners..." 
echo"-------------------------------------------------">>/var/log/oracle 
date+"%T%a%D:StartingOracleListenersaspartofsystemup.">>/var/log/oracle 
echo"-------------------------------------------------">>/var/log/oracle 
su-oracle-c"lsnrctlstart">>/var/log/oracle 
echo"Done." 
echo"" 
echo"-------------------------------------------------">>/var/log/oracle 
date+"%T%a%D:Finished.">>/var/log/oracle 
echo"-------------------------------------------------">>/var/log/oracle 
touch/var/lock/subsys/oracle 
;; 
stop) 
echo"StopingOracleListeners..." 
echo"-------------------------------------------------">>/var/log/oracle 
date+"%T%a%D:StopingOracleListeneraspartofsystemdown.">>/var/log/oracle 
echo"-------------------------------------------------">>/var/log/oracle 
su-oracle-c"lsnrctlstop">>/var/log/oracle 
echo"Done." 
rm-f/var/lock/subsys/oracle 
echo"StopingOracleDatabases..." 
echo"-------------------------------------------------">>/var/log/oracle 
date+"%T%a%D:StopingOracleDatabasesaspartofsystemdown.">>/var/log/oracle 

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

footer  footer  footer  footer