日期:2014-05-16  浏览次数:20549 次

ORA-00845 1
mysql oracle 关于
oracle 11g ORA-00845 处理方法一则
[oracle@db11g ~]$ sqlplus “/as sysdba”

SQL*Plus: Release 11.2.0.1.0 Production on Mon Jul 11 12:52:21 2011

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

Connected to an idle instance.

SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system

查看alert文件的提示:
Starting ORACLE instance (normal)
WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 2046820352 bytes.

/dev/shm is either not mounted or is mounted with available space less than this size. Please fix this so that MEMORY_TARGET can work as expected. Current

available is 1989042176 and used is 0 bytes. Ensure that the mount point is /dev/shm for this directory.
memory_target needs larger /dev/shm
Mon Jul 11 12:52:22 2011

根据oracle参考手册上对ora-00845的解释:

ORA-00845: MEMORY_TARGET not supported on this system
Cause: The MEMORY_TARGET parameter was not supported on this operating system or /dev/shm was not sized correctly on Linux.
Action: Refer to documentation for a list of supported operating systems. Or, size /dev/shm to be at least the SGA_MAX_SIZE on each Oracle instance running

on the system.

初步判断是memory_target的值大于了/dev/shm的值:

[oracle@db11g ~]$ df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
tmpfs 1.9G 0 1.9G 0% /dev/shm

[oracle@db11g /]$ cat $ORACLE_HOME/dbs/spfile$ORACLE_SID.ora

db11g.__java_pool_size=16777216
db11g.__large_pool_size=16777216
db11g.__oracle_base=’/u01/app/oracle’#ORACLE_BASE set from environment
db11g.__pga_aggregate_target=872415232
db11g.__sga_target=1275068416
db11g.__shared_io_pool_size=0
db11g.__shared_pool_size=369098752
db11g.__streams_pool_size=0
*.audit_file_dest=’/u01/app/oracle/admin/db11g/adump’
*.audit_trail=’db’
*.compatible=’11.2.0′
*.control_files=’/dev/raw/raw5′,’/dev/raw/raw6′,’/dev/raw/raw7′CC”Z
*.db_block_size=8192
*.db_domain=”
*.db_name=’db11g’
*.db_recovery_file_dest=’/u01/app/oracle/flash_recovery_area’
*.db_recovery_file_dest_size=2G
*.diagnostic_dest=’/u01/app/oracle’
*.dispatchers=’(PROTOCOL=TCP) (SERVICE=ORCLXDB)’
*.instance_name=’db11g’
*.memory_target=2G
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.undo_tablespace=’UNDOTBS1′

通过比对发现:memory_target为2g,而/dev/shm总大小为1.9g,原因找到了,为什么会出现这种情况呢?

结合这两天对操作系统的修改,为了解决 Memory for crash kernel (0×0 to 0×0) notwithin permissible range,而启用了Kdump,修改了启动参数,增加了crashkernel=128M@16M,由于物理内存总大小为4g,内核划走了128m的内存,总可用物理内存就没有4g了,而/dev/shm的默认大小为物理内存的一半。因此要修改参数配置文

件/etc/fstab,将/dev/shm设为固定2g即可,然后重新挂载,启动数据库。操作如下:

[root@db11g ~]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
/dev/sdb1               /u01                    ext3    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts