![why](/static/img/x1mno0Ukhc-600.jpeg)
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_TARGET
limit. The default value is “0”. - MEMORY_MAX_TARGET: This defines the maximum size the
MEMORY_TARGET
can be increased to without an instance restart. If theMEMORY_MAX_TARGET
is not specified, it defaults toMEMORY_TARGET
setting.
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).
umount tmpfs
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.