dbora.erb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. # chkconfig: 345 98 10
  3. # description: Oracle auto start-stop script.
  4. #
  5. # Set ORA_HOME to be equivalent to the $ORACLE_HOME
  6. # from which you wish to execute dbstart and dbshut;
  7. #
  8. # Set ORA_OWNER to the user id of the owner of the
  9. # Oracle database in ORA_HOME.
  10. ORA_HOME=<%= @oracleHome %>
  11. ORACLE_HOME=<%= @oracleHome %>
  12. ORA_OWNER=<%= @user %>
  13. if [ ! -f $ORA_HOME/bin/dbstart ]
  14. then
  15. echo "Oracle startup: cannot start"
  16. exit
  17. fi
  18. case "$1" in
  19. 'start')
  20. # Start the Oracle databases:
  21. # The following command assumes that the oracle login
  22. # will not prompt the user for any values
  23. #su $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
  24. su $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
  25. touch /var/lock/subsys/dbora
  26. ;;
  27. 'stop')
  28. # Stop the Oracle databases:
  29. # The following command assumes that the oracle login
  30. # will not prompt the user for any values
  31. su $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
  32. #su $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
  33. rm -f /var/lock/subsys/dbora
  34. ;;
  35. esac