亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

 更新時間:2017年01月08日 10:57:53   作者:小_馬  
這篇文章主要介紹了centos 6.5 oracle開機自啟動的環(huán)境配置詳解的相關資料,需要的朋友可以參考下

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

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

oracle沒有啟動。啟動步驟如下:

[oracle@localhost ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 19 14:29:10 2016

Copyright (c) 1982, 2009, Oracle. All rights reserved.

SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 776646656 bytes
Fixed Size         2217384 bytes
Variable Size       490736216 bytes
Database Buffers     281018368 bytes
Redo Buffers        2674688 bytes
Database mounted.
Database opened.

配置自啟動

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

環(huán)境變量生效

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

TNS監(jiān)聽以及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:<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/local
service smb restart
su - 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 Listener
ORACLE_HOME_LISTNER=$ORACLE_HOME

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

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

相關文章

  • 基于centos7 安裝python3.6.4出錯的解決方法

    基于centos7 安裝python3.6.4出錯的解決方法

    下面小編就為大家分享一篇基于centos7 安裝python3.6.4出錯的解決方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-01-01
  • Apache訪問機制配置小結

    Apache訪問機制配置小結

    本文主要介紹了Apache訪問機制配置小結,包括如何設置訪問控制、認證和授權,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2024-07-07
  • LNMP系列教程之 解決sendmail不能發(fā)送郵件問題

    LNMP系列教程之 解決sendmail不能發(fā)送郵件問題

    客戶需要驗證郵件注冊用戶我發(fā)現(xiàn)郵件發(fā)送不了。一般的主機我用過,直接在dz后臺開啟就可以實現(xiàn)。查閱相關資料應該是sendmail不能發(fā)送郵件導致的。那我們如何解決呢
    2012-09-09
  • Ubuntu系統(tǒng)下用Crontab命令定時執(zhí)行PHP文件詳解

    Ubuntu系統(tǒng)下用Crontab命令定時執(zhí)行PHP文件詳解

    這篇文章主要給大家介紹了在Ubuntu系統(tǒng)下用Crontab命令定時執(zhí)行PHP文件的相關資料,文中介紹的非常詳細,對大家具有一定的參考學習價值,需要的朋友們下面來一起看看吧。
    2017-06-06
  • CentOS 7.2搭建VNC遠程桌面服務的方法

    CentOS 7.2搭建VNC遠程桌面服務的方法

    本篇文章主要介紹了CentOS 7.2搭建VNC遠程桌面服務的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-03-03
  • Apache防DDOS模塊mod_evasive安裝和配置方法詳解

    Apache防DDOS模塊mod_evasive安裝和配置方法詳解

    這篇文章主要介紹了Apache防DDOS模塊mod_evasive安裝和配置方法,需要的朋友可以參考下
    2014-03-03
  • 詳解Ubuntu16.04啟動器圖標異常解決方法

    詳解Ubuntu16.04啟動器圖標異常解決方法

    本篇文章主要介紹了詳解Ubuntu16.04啟動器圖標異常解決方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-04-04
  • 一張圖看盡Linux內核運行原理

    一張圖看盡Linux內核運行原理

    一張圖看盡Linux內核運行原理,幫助大家了解Linux內核運行原理,通過這張圖,你可以很方便地學習內核知識,需要的朋友可以參考下
    2016-01-01
  • easyswoole一鍵安裝腳本及寶塔安裝錯誤問題

    easyswoole一鍵安裝腳本及寶塔安裝錯誤問題

    這篇文章主要介紹了easyswoole一鍵安裝腳本及寶塔安裝錯誤問題,文中給大家提到了Linux寶塔安裝EsaySwoole的方法,需要的朋友可以參考下
    2019-10-10
  • Linux中fork()函數實例分析

    Linux中fork()函數實例分析

    這篇文章主要為大家詳細介紹了Linux 中fork()函數實例,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2016-11-11

最新評論