ORA-00845: MEMORY_TARGET not supported on this system

Posted Secdata Share Blog

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORA-00845: MEMORY_TARGET not supported on this system相关的知识,希望对你有一定的参考价值。

1. 问题描述

数据库启动报错,如下提示

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

2. 问题分析

$ oerr ora 00845
00845, 00000, "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.

在Oracle 11g里,通过MEMORY_TARGET参数自动管理SGA和PGA。 但是在Oracle 11gR2 里如果MEMORY_TARGET参数值设定的过大,可能就会出现这个错误。

3. 解决方法

增加/dev/shm, /dev/shm通常用做共享内存

/dev/shm是一个临时文件系统(tmpfs) , 从/etc/fstab中mount支持标准的参数"size",可以用size来增加或者减少在/dev/shm上的tmpfs大小.如果没有设置size,它的大小大于MEMORY_TARGET。

3.1 修改/dev/shm大小

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                       30G  6.4G   22G  23% /
tmpfs                  32G     0   32G   0% /dev/shm
/dev/sda1             477M   33M  419M   8% /boot
/dev/mapper/vgoracle-lvoracle
                     1008G  348G  610G  37% /oracle

调整该大小,重新进行挂载

$ sudo umount /dev/shm
$ mount -t tmpfs shmfs -o size=50G /dev/shm

3.2 修改配置文件/etc/fstab开机自启动

tmpfs                   /dev/shm                tmpfs   defaults,size=55G       0 0

3.3 再次启动数据库验证

SQL> startup
ORACLE instance started.

Total System Global Area 5.0107E+10 bytes
Fixed Size            2264856 bytes
Variable Size         2.5636E+10 bytes
Database Buffers     2.4428E+10 bytes
Redo Buffers           41463808 bytes
Database mounted.
Database opened.
SQL> show parameter memory;

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address         integer     0
memory_max_target             big integer 48000M
memory_target                 big integer 48000M
shared_memory_address             integer     0

补充:重启进行验证

发现重启之后/dev/shm的挂载大小又变成了物理内存的一半,查看配置文件,有默认挂载的配置,将其注释,重新挂载,问题解决

# tmpfs                   /dev/shm                tmpfs   defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults,size=55G       0 0

以上是关于ORA-00845: MEMORY_TARGET not supported on this system的主要内容,如果未能解决你的问题,请参考以下文章

ORA-00845: MEMORY_TARGET not supported on this system

ORA-00845: MEMORY_TARGET not supported on this system

ORA-00845: MEMORY_TARGET not supported on this system

ORA-00845: MEMORY_TARGET not supported

ORA-00845: MEMORY_TARGET not supported on this system

解决办法:ORA-00845: MEMORY_TARGET not supported on thi