The reason and solution of ORA-00845

Source: Internet
Author: User

This problem was found in a test. Restore the backup of the production database on the VM. The server has 24 GB of memory, and the VM has allocated 2 GB of memory. Let's get down to the truth:

When the system reports a ORA-00845 error, it is caused by more shared memory and file descriptors required by the new memory management features of Oracle 11 GB. The solution is to change the size of/dev/shm. Of course, you can also change the size of MEMORY_MAX_TARGET, but this method is not good.

The following is a description in the official manual. To make it easier for a friend who is still reading English for the time being, add a brief description of Chinese to the end of each section.

Automatic Memory Management


Starting with Oracle Database 11g, the Automatic Memory Management feature requires more shared memory (/dev/shm) and file descriptors. the size of the shared memory must be at least the greater of the MEMORY_MAX_TARGET and MEMORY_TARGET parameters for each Oracle instance on the computer. if the MEMORY_MAX_TARGET parameter or the MEMORY_TARGET parameter is set to a nonzero value, and an incorrect size is assigned to the shared memory, it results in an ORA-00845 error at startup. on Linux systems, if the operating system/dev/shm mount size is too small for the Oracle system global area (SGA) and program global area (PGA ), it results in an ORA-00845 error.
Starting from 11 GB, the AMM feature requires more shared memory and file descriptors. For each oracle instance on the computer, its shared memory must be at least larger than MEMORY_MAX_TARGET and MAX_TARGET. If you enable AMM, that is, the two parameters above are set to a non-zero value and an incorrect shared memory value is set, a ORA-00845 error occurs at startup.


The number of file descriptors for each Oracle instance must be at least 512 * PROCESSES. the limit of descriptors for each process must be at least 512. if file descriptors are not sized correctly, you can see an ORA-27123 error from varous Oracle processes and potentially Linux Error EMFILE (Too open files) in non-Oracle processes.
This section is about the cause of ORA-27123 errors because the file descriptor does not reach the minimum value required by oracle.


To determine the amount of shared memory available, enter the following command:
Run the following command to check the available shared memory value of the system.
# Df-h/dev/shm/


Note:
The MEMORY_MAX_TARGET and MEMORY_TARGET parameters cannot be used when the LOCK_SGA parameter is enabled, or with HugePages on Linux.


On the Initialization Parameters page, note the Memory Size (SGA and PGA), which sets the initialization parameter MEMORY_TARGET or MEMORY_MAX_TARGET. the initialization parameters cannot be greater than the shared memory file system on the operating system. for example, if the shared memory file system allocation on your system is 1 GB, but you set Memory Size (MEMORY_TARGET) to 2 GB, then the following error messages are displayed during database startup:


ORA-00845: MEMORY_TARGET not supported on this system
ORA-01078: Failure in processing system parameters
This section is a specific example. In the parameter file, the two initialization parameters cannot be larger than the shared memory file system on the operating system. For example, if the file system allocates 1 GB shared memory on your system, but the MEMORY_TARGET you set is 2 GB, then 00845 is returned.


In addition, if you click All Initialization Parameters and the global database name is longer than eight characters, then the database name value (in the DB_NAME parameter) is truncated to the first eight characters, and the DB_UNIQUE_NAME parameter value is set to the global name.
This is not what I want to talk about in this article ~~~


The workaround, if you encounter the ORA-00845 error, is to increase the/dev/shm mountpoint size.


For example:


# Mount-t tmpfs shmfs-o size = 7g/dev/shm
To make this change persistent internal SS system restarts, add an entry in/etc/fstab similar to the following:


Shmfs/dev/shm tmpfs size = 7g 0
The above string tells us how to increase the size of/dev/shm and how to take effect permanently.

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.