Oracle starts with boot

The test machine is always powered off, so Oracle does not restart automatically after restarting, requiring manual operation, so it can be set to self-start mode.

 

Operating System: Linux

Database: Oracle 10g

 

1、vi /etc/oratab

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

Notes to the file:

# 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::
#
# 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 should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.

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

When set to Y, the instance is allowed to self-start, when set to N, self-start is not allowed. 

The configuration in this file only acts as a switch, and it does not specifically perform startup and shutdown. The specific operations are implemented by the $ORACLE_HOME/bin/dbstart and dbshut scripts. These two scripts will check the configuration in the /etc/oratab file when executing, and can continue to execute when it 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

document:

#!/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 defined scripts as startup scripts here.

 

Then restart the server, you can see that the listener and instance can be automatically started

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326241359&siteId=291194637