1、昨天虚拟机做实验重装了一个数据库启动时候报错,这个错误以前也遇见过很多次这次记录下
错误:ORA-00845: MEMORY_TARGET not supported on this system
这个错误是因为我采用了AMM自动内存管理安装系统的时候可能
1、SGA参数的大小超过了操作系统/dev/shm的大小。
2、linux安装完后默认/dev/shm为物理内存的一半。
找了份资料:
linux大内存支持(Very Large Memory)中,使用了shmfs/tmpfs选项,ramfs也可以。
/dev/shm目录挂载类型为tmpfs,此共享内存用于交换,尤其对于大文件优势明显。
相对于ramfs,tmpfs的优势在于动态调整物理内存的占用,而ramfs不能调整。
/dev/shm与swap的区别:shm基于内存的文件系统,swap基于硬盘的文件系统。
redhat 官网对shared memory 的解释:
Chapter 7. Setting Shared Memory
Shared memory allows processes to access common structures and data by placing them in shared memory segments. It is the fastest form of inter-process communication available since no kernel involvement occurs when data is passed between the processes. In fact, data does not need to be copied between the processes.
Oracle uses shared memory segments for the Shared Global Area (SGA) which is an area of memory that is shared by Oracle processes. The size of the SGA has a significant impact to Oracle's performance since it holds database buffer cache and much more.
To see all shared memory settings, execute:
ipcs -lm
7.1. Setting SHMMAX Parameter
This parameter defines the maximum size in bytes of a single shared memory segment that a Linux process can allocate in its virtual address space. For example, if you use the Red Hat Enterprise Linux 3 smp kernel on a 32 bit platform (x86), then the virtual address space for a user process is 3 GB. If you use the Red Hat Enterprise Linux 3 hugemem kernel on a 32 bit platform (x86), then the virtual address space for a user process is almost 4GB. Hence, setting SHMMAX to 4GB - 1 byte (4294967295 bytes) on a smp kernel on a 32 bit architecture will not increase the maximum size of a shared memory segment to 4 GB -1. Even setting SHMMAX to 4 GB - 1 byte using the hugemem kernel on a 32 bit architecture will not enable a process to get such a large shared memory segment. In fact, the upper limit for a shared memory segment for an Oracle 10g R1 SGA using the hugemem kernel is roughly 3.42 GB (~3.67 billion bytes) since virtual address space is also needed for other things like shared libraries. This means if you have three 2 GB shared memory segments on a 32 bit system, no process can attach to more than one shared memory segment at a time. Also note if you set SHMMAX to 4294967296 bytes (4*1024*1024*1024=4GB) on a 32 bit system, then SHMMAX will essentially bet set to 0 bytes since it wraps around the 4GB value. This means that SHMMAX should not exceed 4294967295 on a 32 bit system. On x86-64 platforms, SHMMAX can be much larger than 4GB since the virtual address space is not limited by 32 bits.
Since the SGA is comprised of shared memory, SHMMAX can potentially limit the size of the SGA. SHMMAX should be slightly larger than the SGA size. If SHMMAX is too small, you can get error messages similar to this one:
ORA-27123: unable to attach to shared memory segment
解决办法:加大/dev/shm 的大小 根据上面的资料可的
vi /etc/fstab 增大 /dev/shm 后面的大小
tmpfs /dev/shm tmpfs size=4000M 0 0
错误:ORA-00845: MEMORY_TARGET not supported on this system
这个错误是因为我采用了AMM自动内存管理安装系统的时候可能
1、SGA参数的大小超过了操作系统/dev/shm的大小。
2、linux安装完后默认/dev/shm为物理内存的一半。
找了份资料:
linux大内存支持(Very Large Memory)中,使用了shmfs/tmpfs选项,ramfs也可以。
/dev/shm目录挂载类型为tmpfs,此共享内存用于交换,尤其对于大文件优势明显。
相对于ramfs,tmpfs的优势在于动态调整物理内存的占用,而ramfs不能调整。
/dev/shm与swap的区别:shm基于内存的文件系统,swap基于硬盘的文件系统。
redhat 官网对shared memory 的解释:
Chapter 7. Setting Shared Memory
Shared memory allows processes to access common structures and data by placing them in shared memory segments. It is the fastest form of inter-process communication available since no kernel involvement occurs when data is passed between the processes. In fact, data does not need to be copied between the processes.
Oracle uses shared memory segments for the Shared Global Area (SGA) which is an area of memory that is shared by Oracle processes. The size of the SGA has a significant impact to Oracle's performance since it holds database buffer cache and much more.
To see all shared memory settings, execute:
ipcs -lm
7.1. Setting SHMMAX Parameter
This parameter defines the maximum size in bytes of a single shared memory segment that a Linux process can allocate in its virtual address space. For example, if you use the Red Hat Enterprise Linux 3 smp kernel on a 32 bit platform (x86), then the virtual address space for a user process is 3 GB. If you use the Red Hat Enterprise Linux 3 hugemem kernel on a 32 bit platform (x86), then the virtual address space for a user process is almost 4GB. Hence, setting SHMMAX to 4GB - 1 byte (4294967295 bytes) on a smp kernel on a 32 bit architecture will not increase the maximum size of a shared memory segment to 4 GB -1. Even setting SHMMAX to 4 GB - 1 byte using the hugemem kernel on a 32 bit architecture will not enable a process to get such a large shared memory segment. In fact, the upper limit for a shared memory segment for an Oracle 10g R1 SGA using the hugemem kernel is roughly 3.42 GB (~3.67 billion bytes) since virtual address space is also needed for other things like shared libraries. This means if you have three 2 GB shared memory segments on a 32 bit system, no process can attach to more than one shared memory segment at a time. Also note if you set SHMMAX to 4294967296 bytes (4*1024*1024*1024=4GB) on a 32 bit system, then SHMMAX will essentially bet set to 0 bytes since it wraps around the 4GB value. This means that SHMMAX should not exceed 4294967295 on a 32 bit system. On x86-64 platforms, SHMMAX can be much larger than 4GB since the virtual address space is not limited by 32 bits.
Since the SGA is comprised of shared memory, SHMMAX can potentially limit the size of the SGA. SHMMAX should be slightly larger than the SGA size. If SHMMAX is too small, you can get error messages similar to this one:
ORA-27123: unable to attach to shared memory segment
解决办法:加大/dev/shm 的大小 根据上面的资料可的
vi /etc/fstab 增大 /dev/shm 后面的大小
tmpfs /dev/shm tmpfs size=4000M 0 0
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26764973/viewspace-1467213/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26764973/viewspace-1467213/