Chinaunix首页 | 论坛 | 博客
  • 博客访问: 476761
  • 博文数量: 34
  • 博客积分: 860
  • 博客等级: 军士长
  • 技术积分: 626
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-31 16:37
文章分类

全部博文(34)

文章存档

2012年(34)

分类: Oracle

2012-06-25 10:44:23


  1. vi /etc/oratab
  2. SID:ORACLE_HOME:Y

  3. 自动启动脚本/etc/rc.d/init.d/oracle
  4. case "$1" in
  5. start)
  6. echo "Starting Oracle Database..."
  7. echo "-------------------------------" >> /var/log/oracle
  8. date +"%T %a %D :Starting Oracle Database as part of system up." >> /var/log/oracle
  9. echo "-------------------------------" >> /var/log/oracle
  10. su - oracle -c "dbstart" >> /var/log/oracle
  11. echo "Done."
  12. echo "Starting Oracle Listeners ... "
  13. echo "--------------------------------" >> /var/log/oracle
  14. date +"%T %a %D : Starting Oracle Listeners as part of system up." >> /var/log/oracle
  15. echo "--------------------------------" >> /var/log/oracle
  16. su - oracle -c "lsnrctl start" >> /var/log/oracle
  17. echo "Done."
  18. echo " "
  19. echo "----------------------------------" >> /var/log/oracle
  20. date +" %T %a %D : Finished. " >> /var/log/oracle
  21. touch /var/lock/subsys/oracle

  22. ;;
  23. stop)
  24. echo "Stoping Oracle Listener ... "
  25. echo "----------------------------------" >> /var/log/oracle
  26. date +"%T %a %D : Stoping Oracle Listener as part of system down. " >> /var/log/oracle
  27. echo "----------------------------------" >> /var/log/oracle
  28. su - oracle -c "lsnrctl stop" >> /var/log/oracle
  29. echo "Done."
  30. rm -f /var/lock/subsys/oracle
  31. echo "Stoping Oracle Databases ... "
  32. echo "------------------------------------" >> /var/log/oracle
  33. date +"%T %a %D : Stoping Oracle Databases as part of system down." >> var/log/oracle
  34. echo "------------------------------------" >> /var/log/oracle
  35. su - oracle -c "dbshut" >> /var/log/oracle
  36. echo "Done."
  37. echo " "
  38. echo "------------------------------------" >> /var/log/oracle
  39. date +"%T %a %D : Finsthed." >> /var/log/oracle
  40. echo "------------------------------------" >> /var/log/oracle

  41. ;;
  42. restart)
  43. $0 stop
  44. $0 start

  45. ;;
  46. *)
  47. echo "Usage: oracle { start | stop | restart } "
  48. exit 1
  49. esac

  50. chmod 755 /etc/rc.d/init.d/oracle

  51. ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc2.d/S99oracle
  52. ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc3.d/S99oracle
  53. ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc5.d/S99oracle

  54. ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc0.d/K01oracle
  55. ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc6.d/K01oracle

阅读(3031) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~