本文主要向大家介绍了Oracle数据库之oracle 18c centos7 设置开机自动启动Oracle,通过具体的内容向大家展现,希望对大家学习Oracle数据库有所帮助。
1.在root用户下进行修改配置文件/etc/oratab
vim/etc/oratab
内容:
#ThisfileisusedbyORACLEutilities.Itiscreatedbyroot.sh
#andupdatedbyeitherDatabaseConfigurationAssistantwhilecreating
#adatabaseorASMConfigurationAssistantwhilecreatingASMinstance.
#Acolon,‘:‘,isusedasthefieldterminator.Anewlineterminates
#theentry.Linesbeginningwithapoundsign,‘#‘,arecomments.
#
#Entriesareoftheform:
#$ORACLE_SID:$ORACLE_HOME::
#
#Thefirstandsecondfieldsarethesystemidentifierandhome
#directoryofthedatabaserespectively.Thethirdfieldindicates
#tothedbstartutilitythatthedatabaseshould,"Y",orshouldnot,
#"N",bebroughtupatsystemboottime.
#
#Multipleentrieswiththesame$ORACLE_SIDarenotallowed.
#
#
orcl:/u01/app/oracle/product/18.1.0/dbhome_1:Y
根据信息增加后者是修改的一行信息为:
orcl:/u01/app/oracle/product/18.1.0/dbhome_1:Y
2.切换到oracle用户,并且进入到oracle的home路径下
su-oracle
cd$ORACLE_HOME/bin
3.编辑oraclehome目录下的dbstart以及dbshut的文件
主要修改点:
将多个$1修改为$ORACLE_HOME
以及将ORACLEBASEHOME_EXEC修改为如下.
ORABASEHOME_EXEC=$ORACLE_HOME/bin
在bin目录下执行操作测试
./dbshut以及./dbstart验证能够正常开启或者关闭数据库
验证lsnrctl下status以及oraclesqlplus/assysdba下面都可用
4.修改开机启动脚本.
切换到root用户
su-root
vim/etc/rc.d/rc.local#这里需要给rc.local增加可执行权限chmod+x/etc/rc.d/rc.localsystemd之后linux应该已经不主要支持rc.local下面的启动方式了.
在文档的最后增加一行
su-oracle-lcdbstart
5.rebootlinux验证oracle可以自动启动起来.
本文由职坐标整理并发布,希望对同学们学习Oracle有所帮助,更多内容请关注职坐标数据库Oracle数据库频道!
如果觉得《oracle18c服务启动 Oracle数据库之oracle 18c centos7 设置开机自动启动Oracle》对你有帮助,请点赞、收藏,并留下你的观点哦!