The size of/dev/shm in Linux causes ORA-00845: MEMORY_TARGETnotsupportedon

Source: Internet
Author: User
Oracle11g AMM memory management mode is to use devshm, so sometimes modify MEMORY_TARGET or MEMORY_MAX_TARGET will have a ORA-00845 error, in the security

Oracle 11g AMM memory management mode is to use/dev/shm, so sometimes modify MEMORY_TARGET or MEMORY_MAX_TARGET will have a ORA-00845 error, in the security

In Linux, the following error occurs when Oracle 11.2.0.4 starts an instance:
SQL> startup nomount pfile =/u03/app/oracle/11.2.0/db/dbs/initcssb. ora
ORA-00845: MEMORY_TARGET not supported on this system


View error help information
[Oracle11 @ oracle11g dbs] $ oerr ora 845
00845,000 00, "MEMORY_TARGET not supported on this system"
// * Cause: The MEMORY_TARGET parameter was not supported on this operating system or/dev/shm was not sized correctly on Linux.
// * Action: Refer to documentation for a list of supported operating systems. Or, size/dev/shm to be at least the SGA_MAX_SIZE on each Oracle instance running on the system.


The error occurs because the operating system does not support the MEMORY_TARGET parameter or the size of/dev/shm on Linux is incorrect. This is the second instance in the operating system, the MEMORY_TARGET parameter is set for the first instance, so this parameter is not supported because the size of/dev/shm is incorrect, the solution is to set the minimum value of/dev/shm to the size set by running the SGA_MAX_SIZE instance on the operating system. /Dev/shm/is the next directory in linux, and the/dev/shm directory is not on the disk, but in the memory. Therefore, the efficiency of using linux/dev/shm/is very high, directly write it into the memory.
Tmpfs has the following features:
1. tmpfs is a file system, not a block device. You just install it and it can be used.
2. The size of the dynamic file system.
3. Another major benefit of tmpfs is its lightning speed. Because the typical tmpfs file system will completely reside in RAM, reading and writing can be almost instantaneous.
4. tmpfs data will not be retained after restart, because the virtual memory is essentially easy to lose. Therefore, it is necessary to perform some script operations such as loading and binding.

In linux, the capacity of/dev/shm is by default half of the memory size. You can see it by running the df-h command. But it does not really occupy this memory. If there is no file in/dev/shm/, it actually occupies 0 bytes of memory. If it is 1 GB at the maximum, if there is a M file in it, the remaining m can still be used by other applications, but the M memory it occupies will never be recycled and re-divided by the system.

Linux/dev/shm capacity (size) can be adjusted. In some cases (such as oracle database), the default maximum of half of the memory is insufficient, in addition, the default inode quantity is very low. Generally, you need to increase the inode quantity. You can use the mount command to manage it.
Mount-o size = 1500 M-o nr_inodes = 1000000-o noatime, nodiratime-o remount/dev/shm
On 2 GB machines, the maximum capacity is increased to 1.5 GB, and the number of inode is increased to 1000000, this means that up to 1 million small files can be stored and the/etc/fstab file can be used to modify the/dev/shm capacity (add the size Option). After modification, re-mount the file.

Here, the SGA_MAX_SIZE of the instance is 1 GB, and the following command shows the size of/dev/shm.
[Root @ oracle11g ~] # Df-lh
Filesystem Size Used Avail Use % Mounted on
/Dev/sda1 23G 20G 1.6G 93%/
/Dev/sdb1 9.9G 5.8G 3.6G 62%/u02
Tmpfs 2G 1.3 M 0.7G 65%/dev/shm


From the above results, we can see that the available size of/dev/shm is only 0.7 GB. Execute the following command to modify it.
[Root @ oracle11g ~] # Vi/etc/fstab
LABEL = // ext3 defaults 1 1
/Dev/sdb1/u02 ext3 defaults 1 2
Tmpfs/dev/shm tmpfs ults, size = 4G 0 0
Devpts/dev/pts devpts gid = 5, mode = 620 0 0
Sysfs/sys sysfs defaults 0 0
Proc/proc defaults 0 0
LABEL = SWAP-sda2 swap defaults 0 0

"/Etc/fstab" 7L, 540C written


Uninstall/dev/shm, but/dev/shm is being accessed
[Root @ oracle11g ~] # Umount/dev/shm
Umount:/dev/shm: device is busy
Umount:/dev/shm: device is busy


Use fuser to process, fuser command,-k: kill processes accessing the named file (killing all processes that are accessing the specified file ), -m indicates the file system or block device where the specified file is located (in the mount State ). All processes accessing the file system are listed.
[Root @ oracle11g ~] # Fuser-km/dev/shm
/Dev/shm: 3152 m 3154 m 3156 m 3160 m 3162 m 3164 m 3166 m 3168 m 3170 m 3172 m 3174 m 3176 m 3178 m 3180 m 3182 m 3184 m 3186 m 3193 m 3195 m 3197 m 3199 m 3201 m 3236 m 3248 m 3250 m 3256 m 3292 m
[Root @ oracle11g ~] # Umount/dev/shm
[Root @ oracle11g ~] # Mount/dev/shm
[Root @ oracle11g ~] # Df-lh
Filesystem Size Used Avail Use % Mounted on
/Dev/sda1 23G 20G 1.6G 93%/
/Dev/sdb1 9.9G 5.8G 3.6G 62%/u02
Tmpfs 4.0G 0 4.0G 0%/dev/shm


Restart the instance.
SQL> startup nomount pfile =/u03/app/oracle/11.2.0/db/dbs/initcssb. ora
ORACLE instance started.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.