Even if we (dbi services) usually advise to setup Oracle Enterprise Linux for Oracle deployments on Linux, it might appear that some customers still prefer other certified distributions such as SuSE Linux Enterprise Server (SLES). This post describes the configuration of the tmpfs filesystem size on SuSE Linux Enterprise Server 11.0 (SLES 11, without any service pack) in order to use the Oracle 11.2 Automatic Memory Management feature (AMM) through the Oracle instance parameter memory_target.

In order to configure the MAA, let’s have a look at the documentation: http://download.oracle.com/docs/cd/E11882_01/install.112/e24321/pre_install.htm#autoId2

We can see that the documentation focuses on OEL and Red Hat like systems which are slightly different on SuSE 11:
Per default on Linux, the tmpfs filesystem is sized to half of the server memory:

server1:~ # free
total       used       free     shared    buffers     cached
Mem:      74100380     510908   73589472          0       9024     124608

server1:~ # df -h /dev/shm/
Filesystem            Size  Used Avail Use% Mounted on
udev                   36G  128K   36G   1% /dev

However, for a pure Oracle server it might be worth to increase this size, for instance on a server having 72 GB of memory, 50 GB might be allocated to the Oracle database.

For this purpose, the size of the tmpfs must be explicitly set in the /etc/fstab. If not, starting the database with a larger size (memory_target) will result in the following error messages at startup:

ORA-00845: MEMORY_TARGET not supported on this system
ORA-01078: Failure in processing system parameters

On SLES 11, in order to increase the tmpfs, we need to proceed differently as on Red Hat. Per default, the tmpfs filesystem is mounted through the following command in /etc/init.d/boot.localfs:

mount -fv -t tmpfs udev /dev

This mount results in the following output:

server1:~ # df -h | grep udev
udev                   36G  128K   36G   1% /dev

In contrary to the Oracle documentation (Red-Hat focused), we do not mount a “shmfs” device but a “udev” device on SLES. In order to mount this tmpfs filesystem with another size than half of the memory, for instance 50 GB, we need to adapt the /etc/fstab:

udev                 /dev/shm               tmpfs      noauto,size=50g       0 0

Note that /dev/shm has to be explicitely used, since the Oracle kernel checks (hard coded) for a mount point called /dev/shm on the filesystem. A missing /dev/shm will result in the following error while starting Oracle:

————————————–
WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 10737418240 bytes. /dev/shm is either not mounted or is mounted with available space less than this size. Please fix this so that MEMORY_TARGET can work as expected. Current available is 0 and used is 0 bytes. Ensure that the mount point is /dev/shm for this directory.
memory_target needs larger /dev/shm
————————————–

We prevent the automatic mount (through umount/mount -a) with the “noauto” parameter (see the fstab entry).

For an immediate mount, we can use the “mount /dev/shm” command:

server1:~ # mount /dev/shm

server1:~ # df -h /dev/shm
Filesystem            Size  Used Avail Use% Mounted on
udev                   50G  128K   50G   1% /dev

The question now is how to make this change persistent. We decided to avoid changing the SuSE boot scripts, therefore we had to mount /dev/shm in the oracle boot procedure:

server1:~ # cat /etc/init.d/oracle.linux

——————–
….
case “$1” in
‘start’)

if [ $(mount | grep /dev/shm | wc -l) -lt 1 ]; then
echo “$0 : mounting /dev/shm”
mount /dev/shm
ret=$?
fi

if [ ${ret} -ne 0 ]; then
echo “error $0 : /dev/shm could not be mounted”
exit 1
fi

su – oracle -c “${DMK_HOME:-/u00/app/oracle/local/dmk}/bin/service_start_stop.ksh start”
touch /var/lock/subsys/oracle
;;
‘stop’)
su – oracle -c “${DMK_HOME:-/u00/app/oracle/local/dmk}/bin/service_start_stop.ksh stop”
rm -f /var/lock/subsys/oracle
;;
*)
echo “usage $0 {start|stop}”
>exit 1
;;
esac
….
——————–

We also decided not to “unmount” the /dev/shm filesystem while stopping Oracle. As a result, this is what we see after reboot (and after an Oracle instance start):

server1:~ # df -h /dev/shm
Filesystem            Size  Used Avail Use% Mounted on
udev                   50G   29G   22G  58% /dev/shm

During our tests, we also tried to modify the /etc/init.d/boot.localfs script in order to mount /dev/shm directly within this script. However, this prevented the network from being started correctly since SuSE itself uses tmpfs for /dev during the boot. After the boot procedure, if /dev/shm is not used (mounted) by another process/script, the following files remain available in /dev/shm :

server1:~ # ls -lrt /dev/shm/sysconfig/
total 28
-rw-r–r– 1 root root  5 Oct 24 15:52 network
-rw-r–r– 1 root root  3 Oct 24 15:52 config-lo
-rw-r–r– 1 root root 27 Oct 24 15:52 if-lo
-rw-r–r– 1 root root  7 Oct 24 15:52 ifup-lo
-rw-r–r– 1 root root  5 Oct 24 15:52 config-eth0
-rw-r–r– 1 root root 29 Oct 24 15:52 if-eth0
-rw-r–r– 1 root root  7 Oct 24 15:52 ifup-eth0
drwxr-xr-x 2 root root 60 Oct 24 15:52 tmp
-rw-r–r– 1 root root  0 Oct 24 15:52 ready-lo
-rw-r–r– 1 root root  0 Oct 24 15:52 ready-eth0
-rw-r–r– 1 root root  0 Oct 24 15:52 ready-eth1
-rw-r–r– 1 root root  0 Oct 24 15:52 ready-eth2
-rw-r–r– 1 root root  0 Oct 24 15:52 ready-eth3

After a correct /dev/shm configuration and after a reboot, the shm devices on SLES11 should be mounted and visible through:

server1:~ # mount | grep shm
udev on /dev/shm type tmpfs (rw,size=50g)

Note that this information is also available on the Novell website and in the Oracle forum under:

  • http://www.novell.com/support/viewContent.do?externalId=7006027&sliceId=1
  • https://forums.oracle.com/forums/thread.jspa?threadID=1040814

Have fun using tmpfs and AMM under SuSE 11!