Welcome 微信登录

首页 / 数据库 / MySQL / Oracle 在Linux上作为服务启动

新建文件名为Oracle 
  1. [root@stark init.d]# pwd 
  2. /etc/init.d 
  3. [root@stark init.d]# touch oracle 
向oracle中添加下列内容 
  1. #!/bin/bash 
  2. # chkconfig: 35 95 1 
  3. # description: init script. to start/stop oracle database 10g, TNS listener 
  4. # match these values to your environment: 
  5. export ORACLE_BASE=/oracle 
  6. export ORACLE_HOME=/oracle/10.2 
  7. export ORACLE_TERM=xterm 
  8. export PATH=/home$ORACLE_HOME/bin:$PATH:. 
  9. export NLS_LANG=American_America.AL32UTF8 
  10. export ORACLE_SID=stark 
  11. export DISPLAY=localhost:0 
  12. export ORACLE_USER=oracle 
  13. case $1 in 
  14.     start) 
  15.     su - "$ORACLE_USER"<<stark 
  16.     lsnrctl start 
  17.     sqlplus /nolog<<jadeshow 
  18.     connect / as sysdba 
  19.     startup 
  20. jadeshow 
  21.     
  22. stark 
  23.     ;; 
  24.     stop) 
  25.     su - "$ORACLE_USER"<<stark 
  26.     lsnrctl stop 
  27.     sqlplus /nolog<<jadeshow 
  28.     connect / as sysdba 
  29.     shutdown immediate 
  30. jadeshow 
  31.     
  32. stark 
  33.     ;; 
  34.     
  35.           
  36.     *) 
  37.     echo "Usage: $0 {start|stop}" 
  38.     ;; 
  39. esac 
修改权限,使得oracle具有可执行权限 
  1. [root@stark init.d]# chmod a+x oracle  
添加oracle到系统服务并且开机启动
  1. [root@stark init.d]# chkconfig add oracle 
  2. [root@stark init.d]# chkconfig oracle on
DUMP数据文件特定块到跟踪文件里Oracle EBS使用adpatch工具打patch过程相关资讯      Oracle数据库基础教程 
  • 在Oracle数据库中插入含有&符号的  (03/06/2013 09:20:14)
  • Oracle 执行计划更改导致数据加工  (02/13/2013 14:45:04)
  • 判断Oracle Sequence是否存在  (02/13/2013 14:32:26)
  • Oracle数据库中无法对数据表进行  (02/26/2013 14:24:58)
  • Oracle 在同一台主机上建立用户管  (02/13/2013 14:40:58)
  • Oracle em 无法启动,报not found错  (02/13/2013 14:29:48)
本文评论 查看全部评论 (0)
表情: 姓名: 字数