ORA-01034 :oracle not available ora-27101

yhj20041128001發表於2011-09-29

新建立的資料庫,新配置listener.ora檔案,然後客戶端連線資料庫,發現報如下錯:
ORA -01034: ORACLE not available

ORA-27101:shared memory realm does not exist :

1。看核心引數設定和alert.log檔案

net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 2010 285420 2010 142
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
vm.swappiness = 0
fs.aio-max-nr = 3145728
vm.overcommit_ratio = 10
vm.dirty_ratio = 20
vm.nr_hugepages = 25602
看後資料庫引數沒有問題,記憶體夠用,資料庫在正常狀態。

SQL> select name,open_mode from v$database;

NAME                        OPEN_MODE
--------------------------- ------------------------------
OGG                         READ WRITE

2.之後發現在報錯之後,繼續輸入使用者名稱和密碼確可以登陸

3.檢視sqlnet.log日誌

28-9?-2011 22:03:16 * (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ogg)(CID=(PROGRAM=C:\Program Files\Quest Soo
ftware\Toad for Oracle\TOAD.exe)()) * (ADDRESS=(PROTOCOL=tcp)(HOST=10)(PORT=2760)) * establish * ogg * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
28-9?-2011 22:03:19 * (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ogg)(CID=(PROGRAM=C:\Program Files\Quest Soo
ftware\Toad for Oracle\TOAD.exe)())) * (ADDRESS=(PROTOCOL=tcp)(HOST=10)(PORT=2764)) * establish * ogg * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor

4.檢查listener是否配置正確

# listener.ora Network Configuration File: /oracle/10205/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/10205)
      (PROGRAM = extproc)
    )
      (SID_DESC =
        (ORACLE_HOME = /oracle/10205)
        (SID_NAME = OGG)
      )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.172.113.130)(PORT = 1521))
    )
  )

~HRTESTDB$tnsping ogg

TNS Ping Utility for Linux: Version 10.2.0.5.0 - Production on 29-9?-2011 03:02:48

Copyright (c) 1997,  2010, Oracle.  All rights reserved.

Used parameter files:
/oracle/10205/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.172.113.130)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ogg)))
OK (0 msec)
listener配置沒有問題。

5.由於例項已經在啟動的狀態,這時候考慮到例項註冊的問題


SQL> show parameter local_listener;

NAME                         TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
local_listener                     string
發現local_listener沒有值。

6設定local_listener;


SQL> alter system set local_listener='(ADDRESS =(PROTOCOL=TCP)(HOST=10.172.113.130)(PORT=1521)(SID=OGG))';

System altered.

或者 SQL>alter system set local_listener='OGG' sid='ogg';
SQL> alter system register;

System altered.
7.再次登陸資料庫,成功。

總結:   

 如果LOCAL_LISTENER丟失,會導致自動例項註冊失敗,資料庫例項不會識別Listener,當Listener連線

資料庫例項的時候,由於Listener沒有註冊,導致了 ORA-27101: shared memory realm does not exist.

疑問:


~

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23757700/viewspace-708505/,如需轉載,請註明出處,否則將追究法律責任。

相關文章