ORA-00845: MEMORY_TARGET not supported on this system

本文介绍了解决Oracle数据库启动时遇到的ORA-00845错误的方法,该错误通常与系统共享内存设置不足有关。文章提供了两种调整共享内存大小的方式:一是通过修改/etc/fstab文件并重新挂载/dev/shm;二是直接使用mount命令临时调整大小。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

SQL> startup nomount;
ORA-00845: MEMORY_TARGET not supported on this system
SQL>

alert_log:
Wed Mar 13 10:38:04 2013
Adjusting the default value of parameter parallel_max_servers
from 160 to 135 due to the value of parameter processes (150)
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 1610612736 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 773545984 and used is 242552832 bytes. Ensure that the mount point is /dev/shm for this directory.
memory_target needs larger /dev/shm

Oracle的官方解析:
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 should be at least the greater of MEMORY_MAX_TARGET and MEMORY_TARGET for each Oracle instance on the computer. If MEMORY_MAX_TARGET or MEMORY_TARGET is set to a non zero value, and an incorrect size is assigned to the shared memory, it will result in an ORA-00845 error at startup.


[root@pc02 ~]# df -h | grep shm
tmpfs                 970M  232M  738M  24% /dev/shm
[root@pc02 ~]# cat /etc/fstab | grep tmpfs
tmpfs                   /dev/shm                tmpfs   defaults        0 0
[root@pc02 ~]#

通过重新挂载来修改其大小:
一:
[root@db2 ~]#vi /etc/fstab      //更换/dev/shm默认大小为2G

LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
#tmpfs                   /dev/shm               tmpfs   defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults,size=2048M  0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-hda3         swap                    swap    defaults        0 0

注:本行defaults,size=10240M 中间无空格
[root@db2 ~]#
[root@db2 ~]# umount /dev/shm
[root@db2  ~]# mount /dev/shm
[root@pc02 ~]# df  -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             428G   59G  348G  15% /
/dev/sda2              16G  177M   15G   2% /tmp
tmpfs                 4.0G  232M  3.8G   6% /dev/shm
[root@pc02 ~]#

二:
[root@pc02 ~]# mount -o remount,size=4G /dev/shm
[root@pc02 ~]# df -h | grep shm
tmpfs                 4.0G  232M  3.8G   6% /dev/shm
[root@pc02 ~]#
[root@pc02 ~]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/tmp              /tmp                    ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-sda3         swap                    swap    defaults        0 0
[root@pc02 ~]#

SQL> startup
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size                  2228784 bytes
Variable Size             905973200 bytes
Database Buffers          687865856 bytes
Redo Buffers                7344128 bytes
Database mounted.
Database opened.
SQL>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值