ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 如何解决ORA-00845错误

如何解决ORA-00845错误

原创 Linux操作系统 作者:杨奇龙 时间:2011-04-15 20:18:26 0 删除 编辑
今天刚刚安装了一个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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
MySQL DBA NoSQL DEVOPS

注册时间:2009-10-07

  • 博文量
    1026
  • 访问量
    7700198