如何解決ORA-00845錯誤

楊奇龍發表於2011-04-15
今天剛剛安裝了一個oracle 11gr2的資料庫,第一次啟動時報 ORA-00845錯誤。
oracle@r05a11016.yh.com:/home/oracle>sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.2.0 Production on Fri Apr 15 16:08:57 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system
SQL> exit
Disconnected
檢視資料:
Starting with Oracle Database 11g, the Automatic Memory Management feature requires more shared memory (/dev/shm)and file descriptors.
The size of the shared memory should be at least the greater of MEMORY_MAX_TARGET and MEMORY_TARGET for each Oracle instance on the computer. If MEMORY_MAX_TARGET or MEMORY_TARGET is set to a non zero value, and an incorrect size is assigned to the shared memory,
it will result in an ORA-00845 error at startup.
問題是由於設定SGA的大小超過了作業系統/dev/shm的大小:
oracle@r05a11016.yh.com:/home/oracle>df -h /dev/shm          
Filesystem            Size  Used Avail Use% Mounted on
tmpfs                  71G   34G   37G  48% /dev/shm
可用大小是37G 而從spfile檔案裡的memory_target 是50 多G .
oracle@r05a11016.yh.com:/home/oracle>sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.2.0 Production on Fri Apr 15 16:13:44 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> create pfile='/tmp/orcl.ora' from spfile;
File created.
SQL> exit
Disconnected
oracle@r05a11016.yh.com:/home/oracle>vim  /tmp/orcl.ora
orcl.__db_cache_size=32346472448
orcl.__java_pool_size=134217728
orcl.__large_pool_size=134217728
orcl.__oracle_base='/apsarapangu/disk1/opt/oracle'#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=24427626496
orcl.__sga_target=36373004288
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=3221225472
orcl.__streams_pool_size=134217728
*.audit_file_dest='/apsarapangu/disk1/opt/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/apsarapangu/disk1/opt/oracle/oradata/orcl/control01.ctl','/apsarapangu/disk1/opt/oracle/fast_recovery_
area/orcl/control02.ctl'
*.db_block_size=8192
*.db_domain='yh.com'
*.db_name='orcl'
*.db_recovery_file_dest='/apsarapangu/disk1/opt/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4227858432
*.diagnostic_dest='/apsarapangu/disk1/opt/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
#*.memory_target=60800630784 大於可用/dev/shm大小。將其修改為16g。
*.memory_target=17179869184
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'                                          
"/tmp/orcl.ora" 26L, 1049C written  
重新啟動。
SQL*Plus: Release 11.2.0.2.0 Production on Fri Apr 15 16:30:16 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup pfile='/tmp/orcl.ora'
ORACLE instance started.
Total System Global Area 1.7103E+10 bytes
Fixed Size                  2243608 bytes
Variable Size            8455717864 bytes
Database Buffers         8623489024 bytes
Redo Buffers               21712896 bytes
Database mounted.
Database opened.
==============================
當然可以修改/dev/shm大小 ,使其大於SGA大小。
解決步驟:
修改/etc/fstab 中/dev/shm 的大小,使其大於SGA 的大小。
#vi /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
LABEL=/data /data ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
#tmpfs /dev/shm tmpfs defaults 0 0
tmpfs /dev/shm tmpfs defaults,size=10240M 0 0
。。。。
LABEL=SWAP-sda swap swap defaults 0 0
~
"/etc/fstab" 13L, 965C written
解除安裝再載入
# umount /dev/shm
# mount /dev/shm
再次檢視。
# df -k /dev/shm
  

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

相關文章