国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務(wù)器 > Web服務(wù)器 > 正文

centos 6.5 oracle開機自啟動的環(huán)境配置詳解

2024-09-01 13:50:03
字體:
供稿:網(wǎng)友

centos 6.5 oracle開機自啟動的環(huán)境配置詳解

環(huán)境:centos 6.5 + Oracle 11g

自啟動之前問題

虛擬機里的oracle環(huán)境,每次重啟完系統(tǒng),用plsql developer連接,先是報錯:

無TNS監(jiān)聽程序

解決方法是切換到系統(tǒng)的oracle用戶,執(zhí)行l(wèi)snrctl start,但是執(zhí)行之前,因為ORACLE_HOME環(huán)境變量沒有生效,還要是環(huán)境變量文件生效,步驟如下:

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

啟動完成后,再次連接,又報錯:

centos,6.5,oracle開機自啟動的環(huán)境配置,oracle開機啟動,oracle,開機自啟環(huán)境配置

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.

配置自啟動

下面把上述過程都配置成開機啟動。

環(huán)境變量生效

可能是因為我的oracle用戶不是桌面登錄的,是從終端su切換過來的,.bash_profile文件沒有運行。我把文件里的內(nèi)容寫入.bashrc文件后,重啟就可以了。

TNS監(jiān)聽以及oracle服務(wù)自啟動

編輯: /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:<N|Y>:## 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是數(shù)據(jù)庫自帶的啟動腳本,我們只要加到rc.local中讓它開機調(diào)用就可以了。但是還需要編輯一下它。修改dbstart的ORACLE_HOME_LISTNER,使其指向$ORACLE_HOME:

# First argument is used to bring up OracleNet ListenerORACLE_HOME_LISTNER=$ORACLE_HOME

重啟虛擬機,發(fā)現(xiàn)plsql developer可以直接連接上了。

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 巴东县| 泰和县| 贵阳市| 旅游| 辰溪县| 喜德县| 南雄市| 新郑市| 盈江县| 南漳县| 奉节县| 和政县| 陇川县| 古丈县| 天气| 镇安县| 湖南省| 安庆市| 曲周县| 彭山县| 崇左市| 五峰| 东山县| 龙山县| 荆州市| 蒲城县| 原阳县| 永兴县| 恩平市| 延吉市| 邹城市| 根河市| 桃园市| 凤冈县| 广德县| 阆中市| 鄢陵县| 获嘉县| 海口市| 东台市| 广德县|