当前位置:首页
开发技术指南» 文章正文
    引言:

 ·寻找可以移动的panel控件。    »显示摘要«
    摘要: rt ......
    摘要: 以下是错误信息: 500 servlet exception c-1_0-rt.tld:13 java.lang.classnotfoundexception: org.apache.taglibs.standard.tlv.jstlcoretlv -----------------------------------------------------------------------......


在linux重新启动下如何设置oracle服务自动开启

我装的是redhat   linux   9,oracle9.2.0.1.0,用sqlplus   "/as   sysdba"   startup可开启实例服务,用lsnrctl   start开启侦听服务,但这些都是通过手工输入操作的,能不能有办法让这些服务就象在windows一样设置为自动,让他在重启之后就可自动运行

NO.1   作者: hevin

这个问题近期有人问过好多遍了,下面是   liuyi8903(好好学习)   的关于此问题的一个回复:  
   
  下面是我在linux   as   3下做的:  
   
  1.   创建文件/etc/oratab  
  添加  
     
  #添加如下内容到/etc/oratab文件中,  
  #$ORACLE_SID是你的Oracle数据库的sid  
  #$ORACLE_HOME是你的Oracle数据库的Oracle_home  
  #Y表示要求在系统启动的时候启动Oracle数据库.N表示不要在系统启动的时候启动Oracle  
  $ORACLE_SID:$ORACLE_HOME:Y    
     
   
   
  2.   修改文件/etc/rc.local添加一下两行  
  su   -   oracle   -c   dbstart  
  su   -   oracle   -c   lsnrctl   start

NO.2   作者: hevin

以下是10G在Linux下oracle自启动的官方表述,可以参考一下,9i应该也有这方面的表述,可以去www.oracle.com找9i的文档看看:  
   
   
  1.Log   in   as   the   root   user.  
   
  2.Edit   the   oratab   file   for   your   platform.  
   
  To   open   the   file,   use   one   of   the   following   commands:  
   
  On   Solaris:  
   
  #   vi   /var/opt/oracle/oratab  
   
  On   AIX,   HP-UX,   Linux,   and   Tru64   UNIX:  
   
  #   vi   /etc/oratab  
   
  Database   entries   in   the   oratab   file   are   displayed   in   the   following   format:  
   
  SID:ORACLE_HOME:{Y|N|W}  
   
  In   this   example,   the   values   Y   and   N   specify   whether   you   want   the   scripts   to   start   up   or   shut   down   the   database,   respectively.   For   each   database   for   which   you   want   to   automate   shutdown   and   startup,   first   determine   the   instance   identifier   (SID)   for   that   database,   which   is   identified   by   the   SID   in   the   first   field.   Then,   change   the   last   field   for   each   to   Y.  
   
  You   can   set   dbstart   to   auto-start   a   single-instance   database   that   uses   an   Automatic   Storage   Management   installation   that   is   auto-started   by   Oracle   Clusterware.   This   is   the   default   behavior   for   an   Automatic   Storage   Management   cluster.   If   you   want   to   do   this,   then   you   must   change   the   oratab   entry   of   the   database   and   the   Automatic   Storage   Management   installation   to   use   a   third   field   with   the   value   W   and   N,   respectively.   These   values   specify   that   dbstart   auto-starts   the   database   only   after   the   Automatic   Storage   Management   instance   is   started.  
   
   
  Note:  
   
  If   you   add   new   database   instances   to   the   system   and   if   you   want   to   automate   startup   for   them,   then   you   must   edit   the   entries   for   those   instances   in   the   oratab   file.    
   
   
  3.Change   directory   to   one   of   the   following   depending   on   your   operating   system:  
   
  Platform   Initialization   File   Directory    
  AIX   /etc    
  Linux   and   Solaris   /etc/init.d    
  HP-UX   and   Tru64   UNIX   /sbin/init.d    
   
   
  4.Create   a   file   called   dbora,   and   copy   the   following   lines   into   this   file:  
   
   
  Note:  
   
  Change   the   value   of   the   ORACLE_HOME   environment   variable   to   an   Oracle   home   directory   for   the   installation.   Change   the   value   of   the   ORACLE   environment   variable   to   the   user   name   of   the   owner   of   the   database   installed   in   the   Oracle   home   directory   (typically,   oracle).    
   
   
  #!   /bin/sh     -x  
  #  
  #   Change   the   value   of   ORACLE_HOME   to   specify   the   correct   Oracle   home  
  #   directory   for   your   installation.  
   
  ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1  
  #  
  #   Change   the   value   of   ORACLE   to   the   login   name   of   the  
  #   oracle   owner   at   your   site.  
  #  
  ORACLE=oracle  
   
  PATH=${PATH}:$ORACLE_HOME/bin  
  HOST=`hostname`  
  PLATFORM=`uname`  
  export   ORACLE_HOME   PATH  
  #  
  if   [   !   "$2"   =   "ORA_DB"   ]   ;   then  
        if   [   "$PLATFORM"   =   "HP-UX"   ]   ;   then  
              remsh   $HOST   -l   $ORACLE   -n   "$0   $1   ORA_DB"  
              exit  
        else  
              rsh   $HOST   -l   $ORACLE     $0   $1   ORA_DB  
              exit  
        fi  
  fi  
  #  
  case   $1   in  
  start)  
                  $ORACLE_HOME/bin/dbstart   $ORACLE_HOME   &  
                  ;;  
  stop)  
                  $ORACLE_HOME/bin/dbshut   $ORACLE_HOME   &  
                  ;;  
  *)  
                  echo   "usage:   $0   {start|stop}"  
                  exit  
                  ;;  
  esac  
  #  
  exit  
   
   
  Note:  
   
  This   script   can   only   stop   Oracle   Net   listener   for   which   a   password   has   not   been   set.   In   addition,   if   the   listener   name   is   not   the   default   name,   LISTENER,   then   you   must   specify   the   listener   name   in   the   stop   and   start   commands:    
  $ORACLE_HOME/bin/lsnrctl   {start|stop}   listener_name  
     
   
   
  5.Change   the   group   of   the   dbora   file   to   the   OSDBA   group   (typically   dba),   and   set   the   permissions   to   750:  
   
  #   chgrp   dba   dbora  
  #   chmod   750   dbora  
   
  6.Create   symbolic   links   to   the   dbora   script   in   the   appropriate   run-level   script   directories   as   follows:  
   
  Platform   Symbolic   Links   Commands    
     
  Linux   #   ln   -s   /etc/init.d/dbora   /etc/rc.d/rc3.d/K01dbora  
  #   ln   -s   /etc/init.d/dbora   /etc/rc.d/rc3.d/S99dbora  
  #   ln   -s   /etc/init.d/dbora   /etc/rc.d/rc5.d/K01dbora  
  #   ln   -s   /etc/init.d/dbora   /etc/rc.d/rc5.d/S99dbora

NO.3   作者: bobfang

Oracle在linux下的自动启动脚本  
   
  环境是redhat   9+oracle   9.2.0.4  
   
  1、在/etc/rc.d/init.d下创建脚本,名字就取为oracle,内容如下。假设oracle的安装用户是ora9。  
  case   "$1"   in    
  start)    
  echo   "Starting   Oracle   Databases   ...   "    
  echo   "-------------------------------------------------"   >>   /var/log/oracle    
  date   +"   %T   %a   %D   :   Starting   Oracle   Databasee   as   part   of   system   up."   >>   /var/log/oracle    
  echo   "-------------------------------------------------"   >>   /var/log/oracle    
  su   -   ora9   -c   "dbstart"   >>   /var/log/oracle    
  echo   "Done."    
  echo   "Starting   Oracle   Listeners   ...   "    
  echo   "-------------------------------------------------"   >>   /var/log/oracle    
  date   +"   %T   %a   %D   :   Starting   Oracle   Listeners   as   part   of   system   up."   >>   /var/log/oracle    
  echo   "-------------------------------------------------"   >>   /var/log/oracle    
  su   -   ora9   -c   "lsnrctl   start"   >>   /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   "Stoping   Oracle   Listeners   ...   "    
  echo   "-------------------------------------------------"   >>   /var/log/oracle    
  date   +"   %T   %a   %D   :   Stoping   Oracle   Listener   as   part   of   system   down."   >>   /var/log/oracle    
  echo   "-------------------------------------------------"   >>   /var/log/oracle    
  su   -   ora9   -c   "lsnrctl   stop"   >>   /var/log/oracle    
  echo   "Done."    
  rm   -f   /var/lock/subsys/oracle    
  echo   "Stoping   Oracle   Databases   ...   "    
  echo   "-------------------------------------------------"   >>   /var/log/oracle    
  date   +"   %T   %a   %D   :   Stoping   Oracle   Databases   as   part   of   system   down."   >>   /var/log/oracle    
  echo   "-------------------------------------------------"   >>   /var/log/oracle    
  su   -   ora9   -c   "dbshut"   >>/var/log/oracle    
  echo   "Done."    
  echo   ""    
  echo   "-------------------------------------------------"   >>   /var/log/oracle    
  date   +"   %T   %a   %D   :   Finished."   >>   /var/log/oracle    
  echo   "-------------------------------------------------"   >>   /var/log/oracle    
   
  ;;    
  restart)    
  $0   stop    
  $0   start    
   
  ;;    
  *)    
  echo   "Usage:   oracle   {start|stop|restart}"    
  exit   1    
  esac  
   
  2、修改/etc/rc.d/init.d/oracle的属性为755。  
   
  3、创建不同级别的link文件。  
  $   ln   -s   /etc/rc.d/init.d/oracle   /etc/rc.d/rc5.d/S99oracle  
  $   ln   -s   /etc/rc.d/init.d/oracle   /etc/rc.d/rc0.d/K01oracle  
  $   ln   -s   /etc/rc.d/init.d/oracle   /etc/rc.d/rc1.d/K01oracle  
   
  4、编辑/etc/oratab文件,设置需要自动启动的数据库实例。  
   
  5、在$ORACLE_HOME/dbs下,创建符号连接文件init$ORACLE_SID  
  cd   $ORACLE_HOME/dbs  
  ln   -s   spfile$ORACLE_SID.ora   init$ORACLE_SID.ora


    摘要: 怎样做一个绿色软件,考过来就能用的那种????不需要注册组件么? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE