Linux启动多个Oracle实例
生活随笔
收集整理的這篇文章主要介紹了
Linux启动多个Oracle实例
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
概述
Centos6.5 有兩個數據庫實例 orcl1 和 orcl2
需要都起來
關鍵:操作每個數據庫實例之前設置ORACLE_SID變量
export ORACLE_SID=數據庫實例
啟動orcl1
使用oracle用戶登錄主機
[root@entel2 ~]# su - oracle oracle@entel2:[/oracle]$export ORACLE_SID=orcl1 oracle@entel2:[/oracle]$sqlplus sys/system as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 28 07:23:47 2016Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL>startup無誤即可。
啟動orcl2
使用oracle用戶登錄主機
[root@entel2 ~]# su - oracle oracle@entel2:[/oracle]$export ORACLE_SID=orcl2 oracle@entel2:[/oracle]$sqlplus sys/system as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 28 07:23:47 2016Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> startup ORACLE instance started.Total System Global Area 801701888 bytes Fixed Size 2232640 bytes Variable Size 318770880 bytes Database Buffers 473956352 bytes Redo Buffers 6742016 bytes Database mounted. Database opened.Database opened.
監聽啟動
切到oracle用戶
[root@entel2 ~]# su - oracle查看監聽狀態
oracle@entel2:[/oracle]$lsnrctl statusLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 28-SEP-2016 07:25:02Copyright (c) 1991, 2013, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.45.7.198)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 28-SEP-2016 06:06:16 Uptime 0 days 1 hr. 18 min. 46 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /oracle/product/112/network/admin/listener.ora Listener Log File /oracle/diag/tnslsnr/entel2/listener/alert/log.xml Listening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.45.7.198)(PORT=1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.123.1)(PORT=1521))) Services Summary... Service "orcl1" has 2 instance(s).Instance "orcl1", status UNKNOWN, has 1 handler(s) for this service...Instance "orcl1", status READY, has 1 handler(s) for this service... Service "orcl2" has 2 instance(s).Instance "orcl2", status UNKNOWN, has 1 handler(s) for this service...Instance "orcl2", status READY, has 1 handler(s) for this service... The command completed successfully啟動/停止
lsnrctl start/stop監聽 UNKNOWN狀態解釋
實例狀態為UNKNOWN值時表明此服務是靜態注冊的設置。這時監聽器用來表明它不知道關于該實例的任何信息,只有當客戶發出連接請求時,它才檢查該實例是否存在。
動態注冊的數據庫通過狀態信息中的狀態READY或狀態BLOCKED(對于一個備用數據庫)來指明。不管關閉何時數據庫,動態注冊的數據庫都會動態地從 監聽器注銷,而與之相關的信息將從狀態列表中消失。這樣,不管數據庫是在運行還是已經關閉,監聽器總是知道它的狀態。該信息將被用于連接請求的回退(fallback)和負載平衡。
既然有動態監聽為什么還要靜態監聽呢?原因如下:
1.監聽器不是最早啟動,oracle實例先啟動
2.監聽器重啟
3.oracle實例沒有open
更加詳細的解釋請看Dave的博文 Oracle Listener 動態注冊 與 靜態注冊
總結
以上是生活随笔為你收集整理的Linux启动多个Oracle实例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux-grep命令
- 下一篇: Oracle启动和停止的方式详解