Set up oracle11g boot automatically

Source: Internet
Author: User

Set the oracle11g boot to start automatically:

Setup in Redhat and CentOS allows the Oracle system to start automatically and is set to Disallowed by default.

1. Modify the/etc/oratab file under the root account:

# Vi/etc/oratab

Orcl=/db/app/oracle/product/11.1.0/db_1:n the last N is changed to Y,


2. Under Oracle account, modify the Oracle's own startup and shutdown scripts, respectively, Dbstart and Dbshut.

Both scripts enable the startup and shutdown of Oracle scripts.

Modify $oracle_home/bin/dbstart file under Account:

$ cd $ORACLE _home/bin

$ VI Dbstart

Find oracle_home_listner=$1 this line instead: oracle_home_listner= $ORACLE _home

$ cd $ORACLE _home/bin

$ VI Dbshut

Find oracle_home_listner=$1 this line instead: oracle_home_listner= $ORACLE _home


# cd/etc/rc.d/init.d/

Vim oracle.sh

#

#!/bin/bash

#chkconfig: 2345 80 25

#/etc/init.d/oracle11g

#description: ORACLE 11g Server

# run-level Startup script. For the Oracle Listener and Instances

# IT relies on the information on/etc/oratab

Export ORACLE_BASE=/U01

Export oracle_home=/u01/app/oracle/product/11.1

Export oracle_sid=ora11g

Export Oracle_ownr=oracle

Export path= $PATH: $ORACLE _home/bin

if [!-F $ORACLE _home/bin/dbstart-o!-D $ORACLE _home]

Then

echo "Oracle startup:cannot start"

Exit 1

Fi

Case "$" in

Start

# Oracle Listener and instance startup

Echo-n "Starting Oracle:"

Su $ORACLE _ownr-c "$ORACLE _home/bin/lsnrctl start"

Su $ORACLE _ownr-c "$ORACLE _home/bin/dbstart $ORACLE _home"

Touch/var/lock/oracle

echo "OK"

;;

Stop

# Oracle Listener and instance shutdown

Echo-n "Shutdown Oracle:"

Su $ORACLE _ownr-c "$ORACLE _home/bin/lsnrctl Stop"

Su $ORACLE _ownr-c "$ORACLE _home/bin/dbshut $ORACLE _home"

Rm-f/var/lock/oracle

echo "OK"

;;

Reload|restart)

$ stop

$ start

;;

*)

echo "Usage: ' basename ' Start|stop|restart|reload"

Exit 1

Esac

Exit 0


Chkconfig--add Oracle # Add Service

Chkconfig Oracle on # starts automatic motion

Chkconfig--list Oracle # See if it's successful




This article is from the "willing to share with you" blog, please be sure to keep this source http://9265463.blog.51cto.com/9255463/1767972

Set up oracle11g boot automatically

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.