1 First modify the/etc/oratab file to add the following line:
Ycr:/u01/app/oracle/product/12.1.0/dbhome_1:y
An explanation of the/etc/oratab file is as follows:
# This file was used by ORACLE utilities. It's created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.
# A Colon, ': ', is used as the field terminator. A New Line terminates
# The entry. Lines beginning with a pound sign, ' # ', is comments.
#
# Entries is of the form:
# $ORACLE _sid: $ORACLE _home:<n| Y>:
#
# The first and second fields is the system identifier and home
# Directory of the database respectively. The third field indicates
# to the Dbstart utility and the database should, "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE _sid is not allowed.
#
#
Ycr:/u01/app/oracle/product/12.1.0/dbhome_1:y
The meaning of the above three parameters is, the instance name, ORACLE HOME, whether to allow the use of Dbstart to start the database
2 Modify the file/etc/rc.d/rc.local, add the following line:
Su oracle-lc "/u01/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl start"
Su oracle-lc "/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbstart"
The explanations for rc.local are as follows:
#!/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-lc "/u01/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl start"
Su oracle-lc "/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbstart"
/etc/rc.d/rc.local is the last one in the init script that starts with the boot.
RedHat (Linux) Oracle Database Setup boot-up