Learn from:
http://blog.csdn.net/condywl/article/details/57129696
1. Modify the configuration file under root user/etc/oratab
vim/etc/oratab Content: # This file isUsed by ORACLE utilities. It iscreated by root.sh# and updated by either Database Configuration Assistant whilecreating# a database or ASM Configuration Assistant whilecreating ASM instance.# A Colon,':', isUsed asThe field terminator. ANewLine 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, the database should,"Y", or should not,#"N", be brought-on system boot time.## multiple entries with the same $ORACLE _sid is not allowed.# #orcl:/u01/app/oracle/product/18.1.0/dbhome_1:y
Depending on the information, the latter is a modified line of information:
orcl:/u01/app/oracle/product/18.1. 0/dbhome_1:y
2. Switch to Oracle user and go to Oracle's home path
Su- oraclecd $ORACLE _home/bin
3. Edit Dbstart and Dbshut files in the Oracle home directory
Main modification points:
Modify multiple to $ORACLE _home
and modify the oraclebasehome_exec to the following.
orabasehome_exec= $ORACLE _home/bin
Perform operational tests in the bin directory
./dbshut and./dbstart Verify that the database is turned on or off normally
Verify that the LSNRCTL status and Oracle Sqlplus/as SYSDBA are available below
4. Modify the boot-up script.
Switch to root user
Su-/etc/rc.d/rc.local
#这里需要给rc. Local Add executable permissions
chmod +x/etc/rc.d/rc.local
After Systemd Linux should have not primarily supported rc.local under Boot mode.
Add a line at the end of the document
SU-ORACLE-LC Dbstart
5. Reboot Linux verifies that Oracle can automatically start up.
Oracle 18c CENTOS7 Set boot automatically starts Oracle