重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2781|回复: 0
打印 上一主题 下一主题

[Oracle] linux不能自动启动oracle

[复制链接]
跳转到指定楼层
楼主
发表于 2020-6-14 11:34:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1:查看ORACLE_HOME是否设置
$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1

2:执行dbstart数据库自带启动脚本
[oracle@orcl ~]$ cd $ORACLE_HOME[oracle@orcl dbhome_1]$ cd bin/[oracle@orcl bin]$ dbstartORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener Usage: /u01/app/oracle/product/11.2.0/db_1/bin/dbstart ORACLE_HOME错误提示:ORACLE_HOME_LISTNER 没有设置 [oracle@orcl bin]$ ll | grep dbs-rwxr-x---. 1 oracle oinstall 6088 1月 1 2000 dbshut-rwxr-x---. 1 oracle oinstall 13892 12月 11 16:01 dbstart 编辑 dbstart,将ORACLE_HOME_LISTNER=$1修改成 ORACLE_HOME_LISTNER=$ORACLE_HOME 前提是$ORACLE_HOME环境设置正确 [oracle@orcl bin]$ vi dbstart  ORACLE_HOME_LISTNER=/u01/app/oracle/product/11.2.0/dbhome_1
3:编辑/etc/oratab文件
dbca建库时都会自动创建/etc/oratab文件
将orcl:/u01/app/oracle/product/11.2.0/dbhome_1:N
修改成 orcl:/u01/app/oracle/product/11.2.0/dbhome_1:Y
4:编辑/etc/rc.d/rc.local启动文件,添加数据库启动脚本dbstart
[root@orcl ~]# vi /etc/rc.d/rc.local#!/bin/bash# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES## It is highly advisable to create own systemd services or udev rules# to run scripts during boot instead of using this file.## In contrast to previous versions due to parallel execution during boot# this script will NOT be run after all other services.## Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure# that this script will be executed during boot. touch /var/lock/subsys/localsu oracle -lc "/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start"su oracle -lc /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart
5:重启主机,查看数据库和监听是自启动
6:查看数据库是否处于open状态
select status from v$instance
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-4-29 04:47 , Processed in 0.088427 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表