Automatic Memory Management in Oracle Database 11g
Oracle Database 11g brings lot of new enhancements, especially in the Memory management. Oracle 11g allows you to allocate one chunk of memory, which Oracle uses to dynamically manage both the SGA and PGA.
Automatic memory management is configured using two new initialization parameters:
- MEMORY_TARGET: The amount of shared memory available for Oracle to use when dynamically controlling the SGA and PGA. This parameter is dynamic, so the total amount of memory available to Oracle can be increased or decreased, provided it does not exceed the
MEMORY_MAX_TARGETlimit. The default value is “0”.
- MEMORY_MAX_TARGET: This defines the maximum size the
MEMORY_TARGETcan be increased to without an instance restart. If the
MEMORY_MAX_TARGETis not specified, it defaults to
If you are using UNIX/Linux, before you consider using AMM you should check the current size of your shared memory file system. On Linux you do this by issuing the following command.
df -k /dev/shm
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 3072000 1276532 1795468 42% /dev/shm
To adjust the shared memory file system size issue the following commands, specifying the required size of shared memory. First unmount the current mounted volume and set the new one (in this example we set it to 3GB).
mount -t tmpfs shmfs -o size=1200m /dev/shm
Now, the above commands will only last until the next reboot. If you want to make this permanent you need to add the adjustment to the fstab file. To do this just edit the file /etc/fstab and add the line:
none /dev/shm tmpfs size=3000m 0 0
This is by far the easiest way to manage memory in Oracle Database 11g.