1.设置自启动
[oracle@raccs ~]$ cat /etc/oratab
#
# This file is used by ORACLE utilities. It is 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, '#', 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 field 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.
#
#
orcl:/u01/app/oracle/product/19.3.0.0/db_1:Y
–将orcl:/u01/app/oracle/product/19.3.0.0/db_1:N改为orcl:/u01/app/oracle/product/19.3.0.0/db_1:Y
前面是实例名,中间是oracle_home,后面是是否自启动,如有多个实例就写多行。
2.编辑自启动和关闭脚本
3.添加开机启动项
给执行权限 chmod 777 rc.local