當tmpfs /dev/shm 太小時,無法修改memory_target的大小。
錯誤提示:ORA-00845: MEMORY_TARGET not supported on this system 處理
1. 修改tmpfs的大小:
在紅帽企業版Linux的
應用程式如果遵循POSIX或者使用GLIBC(2.2和更高版本),通常使用/dev/shm作共享記憶體(shm_open,shm_unlink)。
/dev/shm是一個臨時檔案系統(tmpfs),可以從/etc/fstab中mount。是以,支援标準的參數例如"size",可以用來增加或者
減少在/dev/shm上的tmpfs大小.(預設的,它的大小是系統RAM的一半)。
例如:為了将/dev/shm的大小增加到12GB,修改/etc/fstab的這行:
預設的:
none /dev/shm tmpfs defaults 0 0
改成:
none /dev/shm tmpfs
defaults,size=12G 0 0
重新mount
/dev/shm使之生效:
# mount -o remount /dev/shm
馬上可以用"df
-h"指令檢查變化。
2.接下來就可以修改oracle其參數
要修改memory_target的值還受memory_max_target參數的限制,memory_target<=memory_max_target。
是以必須先增大memory_max_target的大小。
SQL> alter system set memory_target=11.2G;
alter system set memory_target=11.2G
*
ERROR at line 1:
ORA-32005: error while parsing size specification [11.2G]
大小寫不能用機關G
SQL> alter system set memory_target=11468M scope=both;
alter system set memory_target=11468M scope=both
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00837: Specified value of MEMORY_TARGET greater than MEMORY_MAX_TARGET
SQL> alter system set memory_max_target=11468M scope=both;
alter system set memory_max_target=11468M scope=both
*
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified
SQL> alter system set memory_max_target=11468M scope=spfile;
System altered.
SQL>
SQL> alter system set memory_target=11468M scope=spfile;
System altered.