千家信息网

centos6.5 oracle开机自启动的环境怎么配置

发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,这篇"centos6.5 oracle开机自启动的环境怎么配置"文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,
千家信息网最后更新 2026年11月02日centos6.5 oracle开机自启动的环境怎么配置

这篇"centos6.5 oracle开机自启动的环境怎么配置"文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇"centos6.5 oracle开机自启动的环境怎么配置"文章吧。

centos 6.5 oracle开机自启动的环境配置详解

环境:centos 6.5 + oracle 11g

自启动之前问题

虚拟机里的oracle环境,每次重启完系统,用plsql developer连接,先是报错:

无tns监听程序

解决方法是切换到系统的oracle用户,执行lsnrctl start,但是执行之前,因为oracle_home环境变量没有生效,还要是环境变量文件生效,步骤如下:

[oracle@localhost ~]$ source .bash_profile [oracle@localhost ~]$ echo $oracle_home/home/oracle/app/oracle/product/11.2.0/dbhome_1[oracle@localhost ~]$ lsnrctl start

启动完成后,再次连接,又报错:

oracle没有启动。启动步骤如下:

[oracle@localhost ~]$ sqlplus /nologsql*plus: release 11.2.0.1.0 production on wed oct 19 14:29:10 2016copyright (c) 1982, 2009, oracle. all rights reserved.sql> conn / as sysdbaconnected to an idle instance.sql> startuporacle instance started.total system global area 776646656 bytesfixed size         2217384 bytesvariable size       490736216 bytesdatabase buffers     281018368 bytesredo buffers        2674688 bytesdatabase mounted.database opened.

配置自启动

下面把上述过程都配置成开机启动。

环境变量生效

可能是因为我的oracle用户不是桌面登录的,是从终端su切换过来的,.bash_profile文件没有运行。我把文件里的内容写入.bashrc文件后,重启就可以了。

tns监听以及oracle服务自启动

编辑: /etc/oratab文件,把最后一行的n改成y

# this file is used by oracle utilities. it is created by root.sh# and updated by the database configuration assistant when creating# a database.# 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::## the first and second fields are the system identifier and home# directory of the database respectively. the third filed 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:/home/oracle/app/product/11.2.0/dbhome_1:y

路径可能不同

编辑 /etc/rc.local 文件,增加 最后两行:

#!/bin/sh## this script will be executed *after* all the other init scripts.# you can put your own initialization stuff in here if you don't# want to do the full sys v style init stuff.touch /var/lock/subsys/localservice smb restartsu - oracle -c 'lsnrctl start'su - oracle -c 'dbstart'su - oracle -c 'emctl start dbconsole'

dbstart是数据库自带的启动脚本,我们只要加到rc.local中让它开机调用就可以了。但是还需要编辑一下它。修改dbstart的oracle_home_listner,使其指向$oracle_home:

# first argument is used to bring up oraclenet listeneroracle_home_listner=$oracle_home

重启虚拟机,发现plsql developer可以直接连接上了。

以上就是关于"centos6.5 oracle开机自启动的环境怎么配置"这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注行业资讯频道。

环境 配置 内容 文件 变量 步骤 文章 用户 知识 篇文章 系统 切换 监听 不同 一行 价值 再次 大部分 就是 指向 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 广州淘业互联网络科技 圆梦互联网科技 互联网科技资迅 互联网科技开发公司 丰台科技园 互联网 融势互联网科技 伴你行互联网科技有限公司 四个字互联网科技公司取名 华中科技有哪些互联网大佬 成都互联网科技公司100强 山东子淼互联网科技有限公司 皮皮虾互联网科技有限公司 江苏互联网智能科技软件 互联网科技数字货币 上海创道互联网络科技有限公司 唯美互联网科技 众联互联网络科技 杭州融税互联网科技有限公司 瑞安市蟠桃会互联网科技有限公司 北京瑞云互联网科技有限公司 亿人帮互联网科技有限公司 互联网与新科技 无锡溥仪互联网科技有限公司 深圳市运趣互联网科技有限公司 中国的互联网科技企业的崛起 长沙茂晟互联网科技有限公司 卓翼科技产业互联网合作 深圳互联网科技的发展 科技信息时代互联网发展 悟空问答互联网科技
0