三、ORA-00845
最后谈一下ORA-00845的由来和解决方案:
如果memory_max_target/memory_target设置过大,可能导致instance无法启动,报ORA-00845错误。
[Oracle@yft bin]$ 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
// *Action: Refer to documentation for a list of supported operating systems. Or, size /dev/shm to be at leacle instance running on the system.
SQL> alter system set memory_max_target=400m scope=spfile;
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system
这个错误有点误导,实际上这并不是说该平台版本上不支持AMM特性,只是设置的memory_max_target超过了系统中设置的share memory(/dev/shm)而已。
[oracle@yft bin]$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 395M 0 395M 0% /dev/shm
在Oracle 11g for linux中似乎是用了一种新的机制来管理共享内存段,而不是传统的sys /dev/shm了。在alert.ora中可以找到更准确的错误描述:
Mon Feb 25 12:13:21 2013
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 419430400 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 413466624 and used is 0 bytes. Ensure that the mount point is /dev/shm for this directory.
memory_target needs larger /dev/shm
解决的办法之一是增加tmpfs文件系统的容量:
修改/etc/fstab中tmpfs对应的行;将原来的tmpfs /dev/shm tmpfs defaults 0 0 改成tmpfs /dev/shm tmpfs default,size=1024M 0 0,这样tmpfs增大为1G,重新mount /dev/shm使之生效。
[root@yft ~]# vi /etc/fstab
tmpfs /dev/shm tmpfs defaults,size=420m 0 0
[root@yft ~]# mount -o remount /dev/shm
[root@yft ~]# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 420M 0 420M 0% /dev/shm
SQL> startup
ORACLE instance started.
Total System Global Area 418484224 bytes
Fixed Size 1336932 bytes
Variable Size 406849948 bytes
Database Buffers 4194304 bytes
Redo Buffers 6103040 bytes
Database mounted.
Database opened.
更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-10/107729.htm
