這篇文章主要為大家展示了“在Oracle11g RAC環境下如何處理ORA-00845錯誤”,內容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“在Oracle11g RAC環境下如何處理ORA-00845錯誤”這篇文章吧。
因機房空調停電原因機房溫度過高而導致兩個節點的Oracle11G RAC數據庫服務器自動關機。等啟動服務器后,發現數據庫起不來,如題如下:
[oracle@DB-2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 2 10:35:31 2017
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system
SQL> exit
原因為初始化參數MEMORY_TARGET或MEMORY_MAX_TARGET不能大于共享內存(/dev/shm),為了解決這個問題,要不調整Oracle初始化參數要不調大/dev/shm。
Oracle原來參數文件相關參數文件如下:
orcl2.memory_max_target=68719476736
orcl1.memory_max_target=68719476736
*.memory_target=30558650368
orcl2.memory_target=68719476736
orcl1.memory_target=6871947673
操作系統的共享內存(/dev/shm)參數如下:
[oracle@DB-1 shm]$ cat /etc/fstab | grep tmpfs
tmpfs /dev/shm tmpfs defaults,size=131072M 0 0
通過vi /etc/fstab命令分別修改兩個節點的size為64G,如下:
tmpfs /dev/shm tmpfs defaults,size=64G 0 0
[oracle@CRXJ-DB-1 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_crxjdb1-LogVol02
2.3T 1.3T 882G 60% /
tmpfs 64G 34G 30G 54% /dev/shm
/dev/sda1 194M 33M 152M 18% /boot
/dev/mapper/vg_crxjdb1-LogVol01
9.9G 151M 9.2G 2% /tmp
重新嘗試啟動數據庫,還是報ORA-00845錯誤,因此對將初始化參數文件spfile導出成pfile后進行編輯并重新生成spfile,過程如下:
[oracle@DB-1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 2 10:36:33 2017
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> create spfile from pfile='/home/oracle/pfile_yu.ora';
File created.
Elapsed: 00:00:00.21
編輯相關內容如下:
orcl2.memory_max_target=64424509440
orcl1.memory_max_target=64424509440
*.memory_target=64424509440
orcl2.memory_target=64424509440
orcl1.memory_target=64424509440
重新生成spfile并啟動數據庫:
SQL> create spfile from pfile='/home/oracle/pfile_yu.ora';
File created.
Elapsed: 00:00:00.18
SQL> exit
Disconnected
[oracle@DB-1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 2 10:40:30 2017
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 6.4137E+10 bytes
Fixed Size 2219552 bytes
Variable Size 3.8118E+10 bytes
Database Buffers 2.5770E+10 bytes
Redo Buffers 247029760 bytes
Database mounted.
Database opened.
SQL>
數據庫啟動成功。
在另一個節點也進行類似操作,兩個節點數據庫都正常啟動并運行,應用能正常訪問了。
注:在節點一生成完spfile后,在節點二上企圖啟動數據庫,但還是報錯:
[oracle@DB-2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 2 10:35:31 2017
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system
查看操作系統信息:
[oracle@DB-2 ~]$ df -h|grep shm
tmpfs 64G 397M 63G 1% /dev/shm
[oracle@DB-2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 2 10:46:28 2017
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> create pfile='/home/oracle/pfile_yu.ora' from spfile;
create pfile='/home/oracle/pfile_yu.ora' from spfile
*
ERROR at line 1:
ORA-01565: error in identifying file '?/dbs/spfile@.ora'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
對于以上問題,從節點一把參數文件復制過來后直接生成spfile
[oracle@DB-1 ~]$ scp pfile_yu.ora DB-2:/home/oracle/pfile_yu.ora 100% 1929 1.9KB/s 00:00
[oracle@DB-2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 2 10:54:48 2017
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> create spfile from pfile='/home/oracle/pfile_yu.ora';
File created.
SQL> startup
ORACLE instance started.
Total System Global Area 6.4137E+10 bytes
Fixed Size 2219552 bytes
Variable Size 3.3554E+10 bytes
Database Buffers 3.0333E+10 bytes
Redo Buffers 247029760 bytes
Database mounted.
Database opened.
SQL> exit
以上是“在Oracle11g RAC環境下如何處理ORA-00845錯誤”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。