调整MEMORY_TARGET后,出现的问题,ORA_00845

本来我的数据库是没有配置AMM的,memory_target,memory_max_target的值都为0,为了开启AMM功能,就随便设置memory_target,memory_max_target为250M,结果悲剧了。

 

1,


调整MEMORY_TARGET后,出现的问题,ORA_00845

如上图,我的memory_target,memory_max_target都是0

2,


调整MEMORY_TARGET后,出现的问题,ORA_00845

3,重启数据库后,报错


调整MEMORY_TARGET后,出现的问题,ORA_00845

4,那就重新修改memory_target,memory_max_target的值呗。spfile肯定不行了,就改pifle,但我的pfile是很早以前的了,如何得到当前的pfile是关键了。刚开始以为create pfile from spfile 这个命令至少要在数据库nomount状态下才能执行,现在想想我是错了。在用有权限的用户连入数据库,即使数据库没有启动依然可以执行这条命令。得到pfile后,使用vi把memory_target,memory_max_target改为350M,再执行create spfile from pfile;


调整MEMORY_TARGET后,出现的问题,ORA_00845

5,启动数据库。本以为没错了,但报错依旧。它不支持memory_target。

 


调整MEMORY_TARGET后,出现的问题,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.

6,由上述的说明知道,应该是我的/dev/shm的容量小于memory_target所致。这样就有两种方法来解决这个问题。一调整memory_target的大小,二调整/dev/shm的大小。

 

我的/dev/shm的大小是:


调整MEMORY_TARGET后,出现的问题,ORA_00845

 

这个大小显然不能满足memory_target至少304M的要求

 

下面是调整/dev/shm大小的方法。 谢谢 http://yangtingkun.itpub.net/post/468/408235

 

虽然我的具体情况和他的不一致,但方法都是一样的.1,调整/dev/shm的大小;2,卸载/dev/shm;3,挂载/dev/shm(以上操作由root用户完成);4 启动数据库

 

7,修改/dev/shm的大小可以通过修改/etc/fstab来实现。

 


调整MEMORY_TARGET后,出现的问题,ORA_00845

修改为:


调整MEMORY_TARGET后,出现的问题,ORA_00845
 
 8,卸载、挂载/dev/shm


调整MEMORY_TARGET后,出现的问题,ORA_00845

 

9,启动数据库,搞定。