Auto-start in Oracle Linux

Source: Internet
Author: User

The content of this article mainly comes from: http://lbyzx123.javaeye.com/blog/829235

 

1. Create the script file Oracle10g under/etc/init. d/with the following content:

 

#! /Bin/bash

# Whoami

# Root

# Chkconfig: 345 51 49

#/Etc/init. d/Oracle10g

# Description: starts the Oracle dabase deamons

#

Ora_home =/home/Oracle/product/10.2.0/db_1/

Ora_owner = Oracle

Case "$1" in

Start)

Echo-n "Starting Oracle10g :"

Su-$ ora_owner-c "$ ora_home/bin/dbstart "&

Su-$ ora_owner-c "$ ora_home/bin/LSNRCTL start"

Touch/var/lock/subsys/Oracle10g

Echo

;;

Stop)

Echo-n "shutting down Oracle10g :"

Su-$ ora_owner-c "$ ora_home/bin/dbshut "&

Su-$ ora_owner-c "$ ora_home/bin/LSNRCTL stop"

Rm-F/var/lock/subsys/Oracle10g

Echo

;;

Restart)

Echo-n "Restarting Oracle10g :"

$0 stop

$0 start

Echo

;;

*)

Echo "Usage: 'basename $ 0' START | stop | restart"

Exit 1

Esac

Exit 0

 

2. Run chkconfig Oracle10g -- add to add service 3. The above script does not start the database instance. You need to modify the file/etc/oratab (if the file does not exist, run the script/home/Oracle/product/10.2.0/db_1/root. SH)

 

 

Change N in line similar to "orcl:/Oracle/product/10.2.0/db_1: N" to Y4 and run service Oracle10g [Start | stop] to test whether the database can be started or stopped. 5, restart the machine to test whether the database is successfully started.

 

 

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.