In Linux, only auto start of Oracle is configured.

Source: Internet
Author: User
Linux: RedHatEnterpriseLinux5.6Oracle: 10g1, modify the/etc/oratab file and change orcl:/home/oracle/product/10.2.0/db_1: N to orcl: /home/oracle/product/10.2.0/db_1: Y2, modify $ ORACLE_H under the oracle account

Linux: RedHat Enterprise Linux 5.6

Oracle version: 10 GB

1. Modify the/etc/oratab File

Set orcl:/home/oracle/product/10.2.0/db_1: N

Changed to orcl:/home/oracle/product/10.2.0/db_1: Y.

2. Modify the $ ORACLE_HOME/bin/dbstart file under the oracle account:

# Su-ORACLE

$ Cd $ ORACLE_HOME/bin

$ Vi dbstart

Locate ORACLE_HOME_LISTNER = $1.

Changed:

ORACLE_HOME_LISTNER = $ ORACLE_HOME

..................

3. Create the following script named oracle

#! /Bin/bash

# Chkconfig: 2345 99 10

# Description: Startup Script for oracle Databases

#/Etc/rc. d/init. d/oradbstart

Export ORACLE_BASE =/home/oracle/

Export ORACLE_HOME =/home/oracle/product/10.2.0/db_1

Export ORACLE_SID = orcl

Export PATH = $ PATH: $ ORACLE_HOME/bin

Case "$1" in

Start)

Echo "----- startup oracle -----" >>$ ORACLE_HOME/log/oracleLog. log

Su oracle-c $ ORACLE_HOME/bin/dbstart

Touch/var/lock/subsys/oracle

Echo "----- startup oracle successful -----" >>$ ORACLE_HOME/log/oracleLog. log

Echo "OK"

;;

Stop)

Echo "----- shutdwn oracle -----" >>$ ORACLE_HOME/log/oracleLog. log

Su oracle-c $ ORACLE_HOME/bin/dbshut

Rm-f/var/lock/subsys/oracle

Echo "----- shutdown oracle successful -----" >>$ ORACLE_HOME/log/oracleLog. log

Echo "OK"

;;

*)

Echo "Usage: 'basename $ 0' start | stop"

Exit 1

Esac

Exit 0

4. Modify permissions

# Su-root

Chown oracle/etc/init. d/oracle

Chmod 775/etc/init. d/oracle

5. Create a connection

Create a symbolic link file.

Chkconfig -- add/etc/init. d/oracle

(Note that the system is usually restarted here)

6. Verification

Copy the Code as follows:

# Cd/etc/init. d

Sh oracle11 start

After the script is executed, check the oracleLog file in the/$ ORACLE_HOME/log/directory. Is there any output information for the startup branch of the script?

Sh oracle11 stop

After the command is executed, check the oracleLog file in the/$ ORACLE_HOME/log/directory. Is there any script to close the branch output information?

If the information is displayed, the setting is successful. If not, set it again and pay attention to file permissions. LINUX has strict user concepts. After all, it is a multi-user system.

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.