测试系统:
数据库版本 :11.2.0.4
操作系统版本:redhat 6.4
一、问题表象:
新建立的测试库,采用的amm内存管理,memory target 分配了744M,觉得有点小,便决定调整 memory target 至1G,在执行完 alter system set memory_max_target=1G scope=spfile 后,关闭数据库,然后startup ,报错
- SQL> startup
- ORA-00845: MEMORY_TARGET not supported on this system
查看trace log
- 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 780140544 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 445829120 and used is 530427904 bytes. Ensure that the mount point is /dev/shm for this directory.
通过trace日志的告警可以发现,在使用AMM特性时,oracle会根据自身内存参数对 /dev/shm有个最低空间要求,当不满足时,便会报此错误;
二、解决措施:
- ##动态调整/dev/shm大小
- mount -t tmpfs shmfs -o size=4g /dev/shm;
-
- ##为了确保操作系统重启之后能生效,需要修改/etc/fstab文件
- shmfs /dev/shm tmpfs size=4g 0
三、相关扩展
/dev/shm是linux下非常有用的目录,其目录下的所有东西都驻留在内存中,可以直接被内存使用,因此读写速度很快;在linux下,它默认的最大值为内存的一半大小。
oracle服务与该目录有关,当oracle启动后,相关进程信息会写入该目录,目录使用率发生变化;
数据库启动前,查询该目录,结果为空,使用 df 查询,free 100%;
数据库启动后,查询该目录,已经有了内容,使用 df 查询,空间使用率发生变化;
参考文档:HugePages and Oracle Database 11g Automatic Memory Management (AMM) on Linux (文档 ID 749851.1)。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29319055/viewspace-2063086/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29319055/viewspace-2063086/