First of all thanks to Dude over at the OTN Discussion forums for this. Im reblogging since Oracle doesnt like you to post links to blogs in the forum for some reason. You can find his full how-to for Oracle on Ubuntu here:
https://forums.oracle.com/forums/thread.jspa?threadID=2301639
Here is the issue I was having after I moved from Ubuntu 10 to 11.10. Following this how-to worked for me just fine and only took a few minutes. Good luck!
ORA-00845: MEMORY_TARGET
Oracle 11gR2 XE, or any other edition, under Ubuntu 11.10 will result in “ORA-00845: MEMORY_TARGET not support on this system” either at Oracle database startup or during the initial installation. Ubuntu 11.10 uses a new version of the “systemd” system and session manager and has migrated away from /dev/shm and other common directories in favor of /run.
Starting with the release version of Oracle 11gR2 Express Edition, Oracle uses Automatic Memory Management. Oracle 11g AMM under Linux requires shared memory using /dev/shm. Although Ubuntu 11.10 installs a /dev/shm symbolic link automatically at system startup to address compatibility, the solution is not sufficient for Oracle 11g.
There are several ways how to address the problem, which basically mean to either enable Oracle 11g to recognize /dev/shm shared memory, or to to change from the default Oracle 11g Automatic Memory Management (AMM) to Oracle 10g Automatic Shared Memory Management (ASMM). This section has been updated from the previous version of this document to reduce the instructions by removing the content related to ASMM and changing the strategy to fix /dev/shm without modifying files that could be subject to change by automatic OS updates, i.e. /etc/init/mounted-dev.conf and /etc/fstab. To enable Oracle 11g AMM, enter the following commands:
Login as root:
sudo su -
Cut & paste the following into the command prompt (not a text editor):
cat > /etc/init.d/oracle-shm <<-EOF
#! /bin/sh
# /etc/init.d/oracle-shm
#
#
case “\$1″ in
start)
echo “Starting script /etc/init.d/oracle-shm”
# Run only once at system startup
if [ -e /dev/shm/.oracle-shm ]; then
echo “/dev/shm is already mounted, nothing to do”
else
rm -f /dev/shm
mkdir /dev/shm
mount -B /run/shm /dev/shm
touch /dev/shm/.oracle-shm
fi
;;
stop)
echo “Stopping script /etc/init.d/oracle-shm”
echo “Nothing to do”
;;
*)
echo “Usage: /etc/init.d/oracle-shm {start|stop}”
exit 1
;;
esac
#
### BEGIN INIT INFO
# Provides: oracle-shm
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Bind /run/shm to /dev/shm at system startup.
# Description: Fix to allow Oracle 11g use AMM.
### END INIT INFO
EOF
Install the oracle-shm init script:
chmod 755 /etc/init.d/oracle-shm
update-rc.d oracle-shm defaults 01 99
Restart the system:
shutdown -r now (This is the way to do it if you are doing this remotely. Using this will tell your machine to restart itself. Its handy when you are working remotely.)
Verify the success:
sudo cat /etc/mtab | grep shm
Results you are looking for:
none /run/shm tmpfs rw,nosuid,nodev 0 0
/run/shm /dev/shm none rw,bind 0 0
The upper limit of shared memory under Linux is set to 50 % of the installed RAM by default. If your system has less than 2 GB of RAM installed, there is still a chance to run into ORA-00845 error if your shared memory is used by other software.
The verify available shared memory, type the following commands:
sudo df -h /run/shm