Linux DB instance monitoring boot boot settings

Source: Internet
Author: User

Linux The next DB instance listens for boot settings

2016/5/16 Zhanky

Script Introduction

Before we get started, let's start by introducing a few scripts that will be used.

Oratab

Oratab files are created when you create a DB instance, and are executed with the root user executing the root.sh script at installation time. (If you forget, you can create it manually.) )

$oracle_home/bin/dbstart and $oracle_home/bin/dbshut in the $oracle_home/bin directory need to call/etc/oratab files, and Dbstart and Dbshut will fail if they do not exist. , error message for/etc/oratab "is notaccessible.

Oratab is in the format: ORACLE_SID:ORACLE_HOME:AUTO

If you need to start the database automatically, set auto to Y, which takes effect when the Dbstart command is called. Dbstart launches the appropriate database according to the configuration in the/etc/oratab, and the option is just the switch to start and close the database with $oracle_home/bin/dbstart and $oracle_home/bin/dbshut.

If you do not start the database with a Dbstart script, you start with your own script, and you do not need to oratab the file at all.

Dbstart

Dbstart is the script that comes with the startup DB instance when the database is installed, which is stored by default under $oracle_home/bin. Here we set the system boot automatically execute Dbstart script file to implement, boot automatically start data instance.

Lsnrctl

Lsnrctl is the script that comes with the startup database listener when the database is installed, which is stored by default under $oracle_home/bin. Here we set the system boot automatically execute LSNRCTL script file to implement, boot automatically start data monitoring

Rc.local

rc.local The system comes with a boot program script, which is stored by default under/ETC/RC.D. We can start the database instance and listen automatically by adding a script that executes the startup database and initiates the listener in the Rc.local script.

Test introduction

System version: Linuxredhat 5.4 x64

DB version: Oracle database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

Instance Name: Test

Oracle_home :/u01/app/oracle/product/11.2.0/dbhome_1



Test steps

1 , modify/oratab

Because I have no oratab in the environment, so I created it manually

[Email protected]/]$ Vi/etc/oratab

[Email protected]/]$ Cat/etc/oratab

Test:/u01/app/oracle/product/11.2.0/dbhome_1:y

2 , edit/rc.local

Red Place for new additions.

The first article is: Log on with the Oracle user, run the Lsnrctl start script to enable monitoring.

The second article is: Log in with Oracle user, run Dbstart startup database

[Email protected]/]$ vi/etc/rc.d/rc.local

[Email protected]/]$ cat/etc/rc.d/rc.local

#!/bin/sh

#

# This script is executed *after* all and the other init scripts.

# can put your own initialization stuff in here if you don ' t

# want to does the full Sys V style init stuff.

Touch/var/lock/subsys/local

Su-oracle-c "/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl Start"

Su-oracle-c "/u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart Startup"

[Email protected]/]$ ~

3 , test validation, restart the database.

The database instance is then completed and the listener is powered on from boot.


This article is from "Cham Kang Ying" blog, please be sure to keep this source http://zhanky.blog.51cto.com/7154288/1773975

Linux DB instance monitoring boot boot settings

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.