启动虚拟机的oracle,在startup的时候报ora_00845的错误
“ORA-00845: MEMORY_TARGET not supported on this system”
SQL> !oerr ora 845
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 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. For ASM instances, set MEMORY_TARGET explicitly to 0 if /dev/shm cannot be configured.
原因:共享内存不足引起.增大即可.
[root@rac01 ~]# vi /etc/fstab
none /dev/shm tmpfs defaults,size=1024M 0 0
在defaults,后面添加适当大小即可.注意单位是大写的M,小写无效.
[root@rac01 ~]# mount -o remount /dev/shm
切换回oracle 后startup OK!
以上方法有个问题,shm默认是物理内存的一半,就算修改了shm但是如果不remount还是不生效
有个比较暴力的办法在开启过程中remount
[root@centos01 ~]# vi /etc/rc.local
增加:mount -o remount /dev/shm