Set Oracle Auto-start in Linux

Source: Internet
Author: User

The test machine is always powered off, causing Oracle to not restart automatically after restart. manual operations are required, so you can set it to auto-start mode.


Operating System: Linux

Database: Oracle 10g


1. vi/etc/oratab

Find bisal:/opt/oracle/102: N and set N to Y.

File comment:

# This file is used by ORACLE utilities. It is created by root. sh
# And updated by the Database Configuration Assistant when creating
# A database.


# A colon, ':', is used as the field terminator. A new line terminates
# The entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ ORACLE_SID: $ ORACLE_HOME: <N | Y>:
#
# The first and second fields are the system identifier and home
# Directory of the database respectively. The third filed indicates
# To the dbstart utility that the database shocould, "Y", or shocould not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ ORACLE_SID are not allowed.

We can see that $ ORACLE_SID is bisal and $ ORACLE_HOME is/opt/oracle/102.

If it is set to Y, the instance can be started by itself. If it is set to N, the instance cannot be started by itself.

The configuration in this file only acts as a switch, and it does not start or shut down. The specific operations are implemented by the $ ORACLE_HOME/bin/dbstart and dbshut scripts. The two scripts will check the configuration in the/etc/oratab file during execution, and the execution can continue only when the value is Y.


2. Add lsnrctl start and dbstart to the rc. local file:

Vi/etc/rc. d/rc. local

Su oracle-lc "/opt/oracle/102/bin/lsnrctl start"

Su oracle-lc/opt/oracle/102/bin/dbstart

File:

#! /Bin/sh
#
# This script will be executed * after * all the other init scripts.
# You can put your own initialization stuff in here if you don't
# Want to do the full Sys V style init stuff.

You can also use your own script as the startup script.


Then restart the server and you will see that both the listener and instance can be started automatically.

Related Article

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.