ORA-00845: MEMORY_TARGET not supported on this system

Scenario
1. My PC has multiple Virtual Machines. I initially started my VMs’ with 6 GB memory. I started receiving errors when starting up RAC because of host memory limitations.

2. I then reconfigured the memory after database installation and the error experienced when starting up the database.
ORA-00845: MEMORY_TARGET not supported on this system

3. I guess the easy is to reset the memory, login to the database and adjust the MEMORY_TARGET  to a value below or in the 4GB range.

4. But what if this was a real world problem and there was no luxury to do the easy. This would mean changing parameters in the init and or spfile.

Here is what I did.

[oracle@rman dbs]$ cd $ORACLE_HOME
[oracle@rman dbhome_1]$ cd dbs
[oracle@rman dbs]$ ls
hc_asm.dat initasm.ora init.ora lkASM orapwasm peshm_asm_0
[oracle@rman dbs]$ cat initasm.ora
SPFILE=’+DATA/asm/spfileasm.ora’  [ — comment| so the init file has a pointer to the spfile]
[oracle@rman dbs]$

But you can get all excited BUT, what does the alert log say.

          ——————————————-alert log start——————————————-
[oracle@rman trace]$ tail -f alert_asm.log
WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 2046820352 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 1964347392 and used is 161312768 bytes. Ensure that the mount point is /dev/shm for this directory.
memory_target needs larger /dev/shm
Wed Feb 20 04:49:22 2019
Starting ORACLE instance (normal)
WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 2046820352 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 1964347392 and used is 161312768 bytes. Ensure that the mount point is /dev/shm for this directory.
memory_target needs larger /dev/shm
Wed Feb 20 04:51:30 2019
Starting ORACLE instance (normal)
WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 2046820352 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 1964347392 and used is 161312768 bytes. Ensure that the mount point is /dev/shm for this directory.
memory_target needs larger /dev/shm
——————————————-alert log end——————————————-

Resource | https://ihazem.wordpress.com/2011/03/08/increase-size-of-tmpfs-file-system/

To increase the size, do the following:
The before snap
[root@rman dbs]# df -h | grep tmpfs
tmpfs 2.0G 154M 1.9G 8% /dev/shm

1. Modify /etc/fstab line to look something like this:
tmpfs /dev/shm tmpfs size=24g 0 0
— this is what I actually did
tmpfs /dev/shm tmpfs size=5g 0 0 [– comment | I made mine 5g]

2. mount -o remount tmpfs

3. df -h (to see the changes)
The after snap
[root@rman dbs]# df -h | grep tmpfs
tmpfs 5.0G 154M 4.9G 4% /dev/shm

Note: Be careful not too increase it too much b/c the system will deadlock since the OOM (Out-Of-Memory) handler can not free up that space.

Startup the database and edit the config

SQL> show parameter MEMORY
NAME TYPE VALUE
———————————— ———– ——————————
hi_shared_memory_address integer 0
memory_max_target big integer 2240M
memory_target big integer 2240M
shared_memory_address integer 0
alter system reset memory_target;

[oracle@rman trace]$ srvctl stop database -d asm
[oracle@rman trace]$ srvctl start database -d asm
[oracle@rman trace]$ srvctl status database -d asm
Database is running.
SQL> show parameter MEMORY
NAME TYPE VALUE
———————————— ———– ——————————
hi_shared_memory_address integer 0
memory_max_target big integer 0
memory_target big integer 0
shared_memory_address integer 0