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.