1. 程式人生 > >oracle11g的內存分配不當,導致的錯誤ORA-01034,ORA-00838,ORA-27101

oracle11g的內存分配不當,導致的錯誤ORA-01034,ORA-00838,ORA-27101

ora- service listener replace cnblogs oracleo file admin tor

由於開發需要,oracle11g被應用於虛擬機,所以系統資源顯得彌足珍貴,百度了一下就有答案。

用dba身份進入Oracle,筆者在plsql中對數據庫進行管理:

show parameter sga; --顯示內存分配情況

alter system set sga_max_size=200m scope=spfile; --修改占用內存的大小

註:在PL/SQL中 在command window中的Editor模式下使用以上命令

(轉)

還有memory_target

alter system set memory_target=100m;

也正是因為這一句話導致oracle沒能正常運行。

故障現象:

連接oralce,提示服務沒有監聽。

啟動數據庫出現ORA-01034,ORA-00838和ORA-27101錯誤。

而windows service中是正常的,OracleOraDb11g_home1TNSListener,OracleServiceXXX.

Microsoft Windows [版本 6.1.7601]
版權所有 (c) 2009 Microsoft Corporation。保留所有權利。

C:\Users\Administrator>SQLPLUS /nolog

SQL*Plus: Release 11.2.0.1.0 Production on 星期五 6月 30
10:35:33 2017 Copyright (c) 1982, 2010, Oracle. All rights reserved. SQL> conn / as sysdba 已連接到空閑例程。 SQL> show parameters target ORA-01034: ORACLE not available 進程 ID: 0 會話 ID: 0 序列號: 0 SQL> startup ORA-00838: Specified value of MEMORY_TARGET is too small, needs to be at least 148M

經過摸索,解決方案如下

Microsoft Windows [版本 6.1.7601]
版權所有 (c) 2009 Microsoft Corporation。保留所有權利。

C:\Users\Administrator>SQLPLUS /nolog

SQL*Plus: Release 11.2.0.1.0 Production on 星期五 6月 30 10:35:33 2017

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


SQL> create spfile from pfile=‘C:\oracle\admin\xxx\pfile\init.ora.9312016162455‘
;

文件已創建。

SQL> startup
ORACLE 例程已經啟動。

Total System Global Area  208769024 bytes
Fixed Size                  2174320 bytes
Variable Size             146801296 bytes
Database Buffers           54525952 bytes
Redo Buffers                5267456 bytes
數據庫裝載完畢。
數據庫已經打開。
SQL>

 估計是spfile文件配置問題,而此文件是二進制的,我們用pfile文件生成spfile文件。

記住首先打開

C:\oracle\admin\xxx\pfile\init.ora.9312016162455
這個文件,找到memory_target修改成209209200,即200m

oracle11g的內存分配不當,導致的錯誤ORA-01034,ORA-00838,ORA-27101