Oracle Automatic Start and Stop on Linux

Source: Internet
Author: User

1. Create the/etc/rc. d/init. d/Oracle10g script file as the root user. The content is as follows (the environment variable settings are modified according to the actual situation ):

#! /Bin/bash
#
# Chkconfig: 35 95 1
# Description: init script to start/stop Oracle Database 10g, TNS Listener, EMS, ISQLPLUS
#
#
#
# Match these values to your environment:

Export oracle_base =/home/APP/Oracle
Export ORACLE_HOME = $ oracle_base/product/10.1.0/db_1
# Export oracle_term = xterm
Export Path = $ path: $ ORACLE_HOME/bin
Export nls_lang = 'American _ America. zhs16gbk'
Export oracle_sid = esales
# Export display = localhost: 0
Export oracle_user = Oracle

# See how we are called:
Case $1 in
Start)
Su-"$ oracle_user" <EOO
LSNRCTL start
Sqlplus/nolog <Eos
Connect/As sysdba
Startup
EOS
Emctl start dbconsole
Isqlplusctl start
EOO
;;

Stop)
Su-"$ oracle_user" <EOO
LSNRCTL stop
Sqlplus/nolog <Eos
Connect/As sysdba
Shutdown immediate
EOS
Emctl stop dbconsole
Isqlplusctl stop
EOO
;;

*)
Echo "Usage: $0 {START | stop }"
;;
Esac

 

2. Run the following command as the root user
Chmod 755/etc/rc. d/init. d/Oracle10g
Chkconfig -- add Oracle10g

3. Restart the service
Service Oracle10g stop
Service Oracle10g start

 

In this way, Oracle automatically starts and stops when the host is switched on and off.

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/wzy0623/archive/2007/06/27/1668662.aspx

Related Article

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.