Configure dbstart for Oracle10g in RedhatAS4 to enable auto-start upon startup

Source: Internet
Author: User
1. modify the dbstart Script: $ vi $ Oracle_HOME/bin/dbstart # ORACLE_HOME_LISTNER =/ade/vikrkuma_new/oracleORACLE_HOME_LISTNER = $ ORACLE_HOME2. modify/etc/oratab in the following format: $ vi/etc/oratabSID: $ ORACLE_HOME: Y3. Modify/etc/rc. local implementation

1. Modify the dbstart script:
$ Vi $ Oracle_HOME/bin/dbstart
# ORACLE_HOME_LISTNER =/ade/vikrkuma_new/oracle
ORACLE_HOME_LISTNER = $ ORACLE_HOME

2. Modify/etc/oratab in the following format:
$ Vi/etc/oratab
SID: $ ORACLE_HOME: Y
3. Modify/etc/rc. local to implement automatic startup
# Vi/etc/rc. local
Su-c "$ ORACLE_HOME/bin/dbstart" oracle
Su-c "$ ORACLE_HOME/bin/emctl start dbconsole" oracle restart system check whether the settings are successful.

In addition, use RedHat to start the service implementation:
1. Add the following script file under/etc/rc. d/init. d and name it oracle:
#! /Bin/sh
# Chkconfig: 2345 99 01
# Description: ORACLE 10g Server
ORACLE_HOME =/oracle/product/10.2.0.1
If [! -F $ ORACLE_HOME/bin/dbstart]
Then
Echo "ORACLE cannot start"
Exit
Fi
Case "$1" in
'Start ')
Echo "Starting Oracle Database ..."
Su-oracle-c "$ ORACLE_HOME/bin/dbstart"
Su-oracle-c "$ ORACLE_HOME/bin/emctl start dbconsole"
;;
'Stop ')
Echo "Stoping Oracle Database"
Su-oracle-c "$ ORACLE_HOME/bin/emctl stop dbconsole"
Su-oracle-c "$ ORACLE_HOME/bin/dbshut"
;;
Esac

Chkconfig: 2345 99 01 indicates that the script starts the oracle 10g service at runtime Level 2, 3, 4, and 5, with the startup priority of 99 and the shutdown priority of 01.
2. Then use the root permission:
# Cd/etc/rc2.d
# Ln-s/etc/rc. d/init. d/oracle S99oracle
# Chkconfig -- list oracle
# Chkconfig -- level 2345 on restart the system, you can see Starting oracle during the startup process, because we set the priority to 99, usually the final startup. [OK] Later. It may be a little slow to start emctl, and the waiting time is a little longer.

After the service is started, you can run oracle start or oracle stop as the root user to start or stop the service.

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.