Oracle 11G 64-bit RHEL (Red Hat Enterprise Linux) 5.5 64-bit automatic restart and shutdown commands

Source: Internet
Author: User
Tags stop script

Oracle 11G 64-bit automatic restart and shutdown commands in RHEL (Red Hat Enterprise Linux, the same below) 5.5 64-bit:

Log On As an oracle user and enter:

VI/etc/init. d/Oracle

On the Edit page, add the following content: (assume that the Oracle main directory is/u01/APP/Oracle/product/11.2.0/Dbhome_1)

#! /Bin/ Sh  # Chkconfig:  35   80   10  # Description: Oracle Auto Start - Stop script. # Set ora_home to be equivalent to the $ ORACLE_HOME # From  Which You wish to execute dbstart and dbshut; # Set ora_owner to the user  ID  Of the owner of the # Oracle Database  In  Ora_home.ora_home =/U01/APP/Oracle/product/ 11.2 . 0 / Dbhome_1ora_owner = Oracle  If [! -F $ ora_home/bin/ Dbstart]  Then      Echo  "  Oracle startup: cannot start  "  Exit  Fi  Case   "  $1  "   In  '  Start  '  ) # Start the Oracle databases:  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 -$ Ora_owner-C "  $ Ora_home/bin/dbstart  " >/Var/log/ Oracle  Echo   "  Done  "  # Start the listener:  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 -$ Ora_owner-C "  $ Ora_home/bin/LSNRCTL start  " >/Var/log/ Oracle  Echo   "  Done.  "  Echo   "  -------------------------------------------------  " >/Var/log/ Oracle  Date + "  % T % A % d: finished.  " >/Var/log/ Oracle  Echo   "  -------------------------------------------------  " >/Var/log/ Oracle  Touch /Var/lock/subsys/ Oracle ;;  ' Stop  '  ) # Stop the Oracle listener:  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 -$ Ora_owner-C "  $ Ora_home/bin/LSNRCTL stop  " >/Var/log/ Oracle Echo   "  Done.  "  Rm -F/var/lock/subsys/ Oracle # Stop the Oracle database:  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 -$ Ora_owner-C "  $ Ora_home/bin/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 ;;  Esac 

restart. Oracle is shut down with RHEL shutdown. Oracle is automatically started after the system is restarted.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.