ORA-00845: MEMORY_TARGET not supported on this system
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORA-00845: MEMORY_TARGET not supported on this system相关的知识,希望对你有一定的参考价值。
环境:RHEL6.6+11gR2RAC
由于虚拟环境搭建rac做测试,设置虚机内存为3G,打补丁导致pc机太慢,因此调整两台虚拟机内容为2534M内存,启动虚拟后发现数据库无法启动,尝试在单节点手工启动报如下错误:
[email protected] ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Sat May 28 01:03:24 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system
SQL>
查找资料后发现问题如下,见MOS ID 460506.1
在oracle 11g中新增的内存自动管理的参数MEMORY_TARGET,它能自动调整SGA和PGA,这个特性需要用到/dev/shm共享文件系统,而且要求/dev/shm必须大于MEMORY_TARGET,如果/dev/shm比MEMORY_TARGET小就会报错。
查看警告日志爆出如下信息:
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 1207959552 bytes. /dev/shm is either not mounted or is moun
ted with available space less than this size. Please fix this so that MEMORY_TARGET can work as expected. Current available is 1101058048 and used is 120430592 bytes. Ensure that the mount po
int is /dev/shm for this directory.
memory_target needs larger /dev/shm
解决方案
1.初始化参数MEMORY_TARGET或MEMORY_MAX_TARGET不能大于/dev/shm,为了解决这个问题,可以增大/dev/shm
如:
mount -t tmpfs shmfs -o size=3g /dev/shm
2.为了确保操作系统重启之后能生效,需要修改/etc/fstab文件。
tmpfs /dev/shm tmpfs size=3g 0
3.如果/dev/shm没有挂载也会报上面的错,所以需要确保已经挂载。
修改后重启服务器查看如下:
[[email protected] ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 71G 20G 48G 30% /
tmpfs 3.0G 412M 2.6G 14% /dev/shm
/dev/sda1 190M 29M 151M 16% /boot
[[email protected] ~]$ cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed May 25 00:45:01 2016
#
# Accessible filesystems, by reference, are maintained under ‘/dev/disk‘
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=78a45723-e057-4055-a9b6-251acb2e6bb2 / ext4 defaults 1 1
UUID=29aae331-4dbe-4bf6-93d2-dc9eed0366f3 /boot ext4 defaults 1 2
UUID=68b77663-849b-4c80-891f-da37b671d992 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults,size=3G 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
[[email protected] ~]$
查看数据库已经启动。
[[email protected] ~]# su - grid
c[[email protected] ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE cluster1
ONLINE ONLINE cluster2
ora.FRA.dg
ONLINE ONLINE cluster1
ONLINE ONLINE cluster2
ora.LISTENER.lsnr
ONLINE ONLINE cluster1
ONLINE ONLINE cluster2
ora.OCR_VOTE.dg
ONLINE ONLINE cluster1
ONLINE ONLINE cluster2
ora.asm
ONLINE ONLINE cluster1 Started
ONLINE ONLINE cluster2 Started
ora.gsd
OFFLINE OFFLINE cluster1
OFFLINE OFFLINE cluster2
ora.net1.network
ONLINE ONLINE cluster1
ONLINE ONLINE cluster2
ora.ons
ONLINE ONLINE cluster1
ONLINE ONLINE cluster2
ora.registry.acfs
ONLINE ONLINE cluster1
ONLINE ONLINE cluster2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE cluster2
ora.cluster.db
1 ONLINE ONLINE cluster1 Open
2 ONLINE ONLINE cluster2 Open
ora.cluster1.vip
1 ONLINE ONLINE cluster1
ora.cluster2.vip
1 ONLINE ONLINE cluster2
ora.cvu
1 ONLINE ONLINE cluster1
ora.oc4j
1 ONLINE ONLINE cluster1
ora.scan1.vip
1 ONLINE ONLINE cluster2
什么是/dev/shm
tmpfs是Linux/Unix系统上的一种基于内存的文件系统。tmpfs可以使用您的内存或swap分区来存储文件。由此可见,tmpfs主要存储暂存的文件。它有如下2个优势 : 1. 动态文件系统的大小。2. tmpfs 的另一个主要的好处是它闪电般的速度。因为典型的 tmpfs 文件系统会完全驻留在内存 RAM 中,读写几乎可以是瞬间的。同时它也有一个缺点 tmpfs 数据在重新启动之后不会保留,因为虚拟内存本质上就是易失的。
本文出自 “技术成就梦想!” 博客,请务必保留此出处http://dreamsanqin.blog.51cto.com/845412/1784496
以上是关于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