Oracle設定預設資料庫,ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist

來源:互聯網
上載者:User

標籤:

Oracle 設定預設資料庫

如果我們的伺服器上或者電腦上安裝了多個資料庫,當我們使用sqlplus時如果為指定資料庫時登入到的是哪一個資料庫呢?今天遇到了一個老問題:

ORA-01034: ORACLE not available

ORA-27101: shared memory realm does not exist

以前也遇到過:根據網上的博文一步一步操作下就OK了,可是今天試了下不行,經過分析發現原來是我登入進入是另一個資料庫,可如果每次都指定登入到那個資料庫太麻煩了,就去查詢了些資料,設定預設資料庫:

 

首先開啟註冊表,win+R運行regedit然後HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDB12Home2>ORACLE_SID設定預設資料庫的SID

 

隨便附上解決:

ORA-01034: ORACLE not available

ORA-27101: shared memory realm does not exist的方法,這是從網上找到的一份十分靠譜的方法,至少每次遇到都能解決我的問題!

 

解決方案一:

ERROR:

ORA-01034: ORACLE not available

ORA-27101: shared memory realm does not exist

進程 ID: 0

會話 ID: 0 序號: 0

因為這個小小的錯誤,折騰了我好幾個小時,特記錄如下。

上網搜尋了下解決方案,如下:

sqlplus "sys/password as sysdba"

串連成功,提示"已串連到空閑常式"

SQL> startup

ORACLE 常式已經啟動。

Total System Global Area  535662592 bytes

Fixed Size                  1375792 bytes

Variable Size             293601744 bytes

Database Buffers          234881024 bytes

Redo Buffers                5804032 bytes

資料庫裝載完畢。

ORA-03113: 通訊通道的檔案結尾

進程 ID: 5412

會話 ID: 5 序號: 5

出現一個新錯誤:ORA-03113: 通訊通道的檔案結尾;分析可能由於昨晚資料庫強制關閉,導致檔案狀態可能不一致,因為正常關閉資料庫會同步校正各檔案,使得重新啟動的時候檔案時間點一致。

找到解決方案如下:

SQL> conn / as sysdba

已串連到空閑常式。

SQL> startup mount

ORACLE 常式已經啟動。

Total System Global Area  535662592 bytes

Fixed Size                  1375792 bytes

Variable Size             293601744 bytes

Database Buffers          234881024 bytes

Redo Buffers                5804032 bytes

資料庫裝載完畢。

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC

---------- ---------- ---------- ---------- ---------- ---------- ---

STATUS           FIRST_CHANGE# FIRST_TIME     NEXT_CHANGE# NEXT_TIME

---------------- ------------- -------------- ------------ -------------

         1          1        340   52428800        512          1 NO

INACTIVE               8474486 02-4月 -11          8522856 02-4月 -11

         3          1        342   52428800        512          1 NO

INACTIVE               8555222 06-4月 -11          8565162 11-4月 -11

         2          1        343   52428800        512          1 NO

CURRENT                8565162 11-4月 -11       2.8147E+14

SQL> alter database open resetlogs

  2  ;

alter database open resetlogs

*

第 1 行出現錯誤:

ORA-01139: RESETLOGS 選項僅在不完全資料庫恢複後有效

SQL> recover database until time ‘2011-04-11 12:12:12‘

完成介質恢複。

SQL> alter database open resetlogs;

資料庫已更改。

SQL> shutdown

資料庫已經關閉。

已經卸載資料庫。

ORACLE 常式已經關閉。

SQL> startup

ORACLE 常式已經啟動。

Total System Global Area  535662592 bytes

Fixed Size                  1375792 bytes

Variable Size             293601744 bytes

Database Buffers          234881024 bytes

Redo Buffers                5804032 bytes

資料庫裝載完畢。

資料庫已經開啟。

 

 

 

解決方案:二

我頂 字型大小:大 中 小

在試圖登入pl/sql時,輸入使用者名稱(system/pwd)後,Oracle報告下列錯誤:

ERROR:

ORA-27101 Shared memory realm does not exist

ORA-01034 ORACLE not available &<60;

 

 

查閱了相關

ORA-27101 Shared memory realm does not exist

ORA-01034 ORACLE not available &<60;

的說明,解釋為ORACLE_HOME或者ORACLE_SID設定不正確。

但檢查bash_profile以後沒有發現錯誤;

錯誤點,沒有開啟oracle服務;

解決辦法,直接開啟oracle相關數據庫的服務;

或按照下面的步驟操作:

lsnrctl start

sqlplus ‘/as sysdba‘

sql> startup

emctl start dbconsole

isqlplusctl start

 

Oracle設定預設資料庫,ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.