Configure the Oracle10g service in Linux

Source: Internet
Author: User

My OS: Red Hat Enterprise Server 4
The Database Service, Oracle em, and Oracle ISQLPLUS are installed.

Log in as root,
1) Change the/etc/oratab File
For example, my oratab file is as follows:
Sharkl:/u01/APP/Oracle/product/10.2.0/db_1: Y
This line means: Instance name: ORACLE_HOME: Start or not
Dbstart and dbshut in ORACLE_HOME/bin scan the file to determine whether to start the Oracle database service.
2) goto/etc/init. d
Create an oracle file (a shell script file). For example, the content of my Oracle file is as follows:

#! /Bin/bash
#
#/Etc/rc. d/init. d/Oracle
#
# Source function library.
#
# Test-x/usr/sbin/ATD | exit 0

Retval = 0
ORACLE_HOME =/u01/APP/Oracle/product/10.2.0/db_1

#
# See how we were called.
#

Prog = "oracle"

Start (){
# Check If atd is already running
# If [! -F/var/lock/subsys/Oracle]; then
Echo-N $ "Starting $ prog :"
Su-Oracle-c "$ ORACLE_HOME/bin/dbstart"
Su-Oracle-c "$ ORACLE_HOME/bin/LSNRCTL start"
# Fi
Return $ retval
}

Stop (){
Echo-N $ "Stopping $ prog :"
Su-Oracle-c "$ ORACLE_HOME/bin/dbshut"
Su-Oracle-c "$ ORACLE_HOME/bin/LSNRCTL stop"
Return $ retval
}

Restart (){
Stop
Start
}

Reload (){
Restart
}

Case "$1" in
Start)
Start
;;
Stop)
Stop
;;
Reload | restart)
Restart
;;
*)
Echo $ "Usage: $0 {START | stop | restart }"
Exit 1
Esac

Exit $?
Exit $ retval

3) Run chmod 755 Oracle

4) log on to XWindow as root,
Click "application"Program/System/Server Settings /"
Select "Action/Add service" and enter the service name oracle. Note that the name must be consistent with the file name created in step 2.

Other Oracle em services and ISQLPLUS services are similar to Oracle database services.
Oracle EM: emctl START | stop dbconsole
ISQLPLUS: isqlplusctl START | stop

 

 

 

 

 

 

 

 

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.