ORA-00845的原因与解决

php中文网
发布: 2016-06-07 17:24:10
原创
2230人浏览过

当系统报出ORA-00845错误时,是由于oracle 11g的内存管理新特性要求更多的共享内存和文件描述符导致的。解决方法呢就是更改/dev/

这个问题是在一次测试中发现的。在虚拟机上恢复生产库的备份,服务器是24g内存,而虚拟机才分配了2g。好了,言归正传:

当系统报出ORA-00845错误时,是由于Oracle 11g的内存管理新特性要求更多的共享内存和文件描述符导致的。解决方法呢就是更改/dev/shm的大小,当然也可以更改MEMORY_MAX_TARGET大小,但是这个方法不好。

下面是官方手册里的说明,为了让暂时看英文还头大的朋友稍微舒服点儿,在每段后面都加上中文的简要说明。

Automatic Memory Management


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 must be at least the greater of the MEMORY_MAX_TARGET and MEMORY_TARGET parameters for each Oracle instance on the computer. If the MEMORY_MAX_TARGET parameter or the MEMORY_TARGET parameter is set to a nonzero value, and an incorrect size is assigned to the shared memory, it results in an ORA-00845 error at startup. On Linux systems, if the operating system /dev/shm mount size is too small for the Oracle system global area (SGA) and program global area (PGA), it results in an ORA-00845 error.
从11g开始,AMM特性呢要求更多的共享内存和文件描述符。对于计算机上的每个oracle实例,它的共享内存大小必须至少比MEMORY_MAX_TARGET和MAX_TARGET都大。如果你启用了AMM,也就是上面的两个参数设置成了非零值,,并且设置了不正确的共享内存值,那么就会在启动时出现ORA-00845的错误。


The number of file descriptors for each Oracle instance must be at least 512*PROCESSES. The limit of descriptors for each process must be at least 512. If file descriptors are not sized correctly, you see an ORA-27123 error from various Oracle processes and potentially Linux Error EMFILE (Too many open files)in non-Oracle processes.
这一段是说ORA-27123错误的原因,是文件描述符没有达到oracle要求的最小值。


To determine the amount of shared memory available, enter the following command:
执行下面的命令,查看系统可用共享内存值大小
# df -h /dev/shm/


Note:
The MEMORY_MAX_TARGET and MEMORY_TARGET parameters cannot be used when the LOCK_SGA parameter is enabled, or with HugePages on Linux.

因赛AIGC
因赛AIGC

因赛AIGC解决营销全链路应用场景

因赛AIGC 73
查看详情 因赛AIGC


On the Initialization Parameters page, note the Memory Size (SGA and PGA), which sets the initialization parameter MEMORY_TARGET or MEMORY_MAX_TARGET. The initialization parameters cannot be greater than the shared memory file system on the operating system. For example, if the shared memory file system allocation on your system is 1 GB, but you set Memory Size (MEMORY_TARGET) to 2 GB, then the following error messages are displayed during database startup:


ORA-00845: MEMORY_TARGET not supported on this system
ORA-01078: Failure in processing system parameters
这一段就是说了一个具体的例子。在参数文件中,那两个初始化参数不能比操作系统上的共享内存文件系统大。例如,你的系统上共享内存文件系统分配的值是1GB,但是你设置的MEMORY_TARGET到2GB了,那么00845就来了。


In addition, if you click All Initialization Parameters and the global database name is longer than eight characters, then the database name value (in the DB_NAME parameter) is truncated to the first eight characters, and the DB_UNIQUE_NAME parameter value is set to the global name.
这个不是本篇文章要说的,略过~~~


The workaround, if you encounter the ORA-00845 error, is to increase the /dev/shm mountpoint size.


For example:


# mount -t tmpfs shmfs -o size=7g /dev/shm
To make this change persistent across system restarts, add an entry in /etc/fstab similar to the following:


shmfs /dev/shm tmpfs size=7g 0
上面的这一串就是告诉咱们如何增加/dev/shm的大小,并且如何永久生效

linux

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门推荐
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号