ORA-00845: MEMORY_TARGET not supported on this system

ORA-00845: MEMORY_TARGET not supported on this system

Oracle 11g的数据库,打算将SGA设大一点,知道 11g 中有一个新特新 MEMORY_TARGET,于是尝一下鲜,谁知报了个 ORA-00845,报错比较容易迷惑人,不借助Google真得想半天:

?

SQL> alter system set memory_max_target=3G scope=spfile ;

System altered.

SQL> alter system set memory_target=2G scope=spfile ;

System altered.

SQL>
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup ;
ORA-00845: MEMORY_TARGET not supported on this system


      来自Oracle的官方解析是:

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 should be at least the greater of MEMORY_MAX_TARGET and MEMORY_TARGET for each Oracle instance on the computer. If MEMORY_MAX_TARGET or MEMORY_TARGET is set to a non zero value, and an incorrect size is assigned to the shared memory, it will result in an ORA-00845 error at startup.

      简单来说就是 MEMORY_MAX_TARGET 的设置不能超过 /dev/shm 的大小:

?
1
2
[oracle@FWDB FWDB]$ df -h | grep shm
tmpfs                 2.0G     0  2.0G   0% /dev/shm

      还真是撞到这个枪口上了:

      马上把它加大:

[root@MHD-DB-SERVER oradata]# df -h | grep shm
tmpfs 15G 4.8G 11G 32% /dev/shm
[root@MHD-DB-SERVER oradata]# vi /etc/fstab


#
# /etc/fstab
# Created by anaconda on Fri Dec 30 10:53:45 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=fbab7ba9-ed56-4174-b3f1-b90c218fa9f2 / ext4 defaults 1
1
UUID=562a97c7-d64a-4d1b-bc7f-fddc202b80db /boot ext4 defaults 1
2
UUID=90980dc0-af52-40f1-8641-6f0b36e858c5 /data ext4 defaults 1
2
UUID=d240a53e-7f8d-4b7a-9a75-28a422529c51 /tmp ext4 defaults 1
2
UUID=072c9d69-7cc1-4b17-88b6-ddc0a691bad8 /usr ext4 defaults 1
2
UUID=1c956757-a2bd-48c7-8786-f13d50db4616 /var ext4 defaults 1
2
UUID=a3d5231b-6e82-4899-afcf-20ac6979aa56 swap swap defaults 0
0
#tmpfs /dev/shm tmpfs defaults 0 0
tmpfs /dev/shm tmpfs defaults,size=20G 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
~
"/etc/fstab" 20L, 1261C written
[root@MHD-DB-SERVER oradata]# mount -o remount /dev/shm
[root@MHD-DB-SERVER oradata]# df -h /dev/shm

文件系统 容量 已用 可用 已用%% 挂载点
tmpfs    25G 12G 14G  48% /dev/shm

[root@MHD-DB-SERVER oradata]#


 

      再次启动数据库,没有报错了。

你可能感兴趣的:(ORA-00845: MEMORY_TARGET not supported on this system)