Linux Env Oracle auto start when OS start

上一篇 / 下一篇  2005-08-23 00:00:00 / 个人分类:系统

When We configure an Oracle instance, how to start it automatically when the os restart


(1)vi /etc/oratab
  orcl:/usr/local/oracle/product/9.2.0:Y
(2)vi /home/oracle/.bash_profile
  ORACLE_SID=orcl
  ORAENV_ASK=NO
  export ORACLE_SID ORAENV_ASK
  . oraenv
(3)在 /etc/rc.d/init.d 下创建一个dbora文件。
内容如下:

  #!/bin/sh
  ORA_HOME=/usr/local/oracle/product/9.2.0
  ORA_OWNER=oracle
  if [ ! -f /bin/dbstart ]
  then
  echo "Oracle startup: cannot start"
  exit
  fi
  case "" in
  'start') #start oracle database and listeners
  su - -c "/bin/dbstart"
  su - -c "/bin/lsnrctl start"
  ;;
  'stop') #stop oracle databse and listeners
  su - -c "/bin/lsnrctl stop"
  su - -c "/bin/dbshut"
  ;;
  esac

把这个文件与下列文件联接:
ln -s /etc/rc.d/init.d/dbora /etc/rc.d/rc3.d/S99dbora
ln -s /etc/rc.d/init.d/dbora /etc/rc.d/rc5.d/S99dbora
ln -s /etc/rc.d/init.d/dbora /etc/rc.d/rc0.d/K10dbora

(4)编辑dbstart文件
以oracle用户登陆
vi /usr/local/oracle/product/9.2.0/bin/dbstart
- add the following line:
SPFILE=/dbs/spfile.ora
after this line: PFILE=/dbs/init.ora

- change:
if [ -f ] ; then
to:
if [ -f -o -f ] ; then


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-07  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 1900
  • 日志数: 276
  • 图片数: 1
  • 建立时间: 2007-12-16
  • 更新时间: 2008-08-26

RSS订阅

Open Toolbar