ITPub博客

首页 > 数据库 > Oracle > ORA-00845: MEMORY_TARGET not supported on this system

ORA-00845: MEMORY_TARGET not supported on this system

Oracle 作者:lltfjsy 时间:2017-02-09 09:32:23 0 删除 编辑

ORA-00845: MEMORY_TARGET not supported on this system

 
使用虚拟机时,机器实在太卡,原来虚拟机会把你所分配给它的内存扣死,昨天把虚拟机的内存从1.5G缩小到1G。机器果然顺畅了,不过担心的问题也出现了--oracle的实例启动不了。
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system

来自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.
      简单来说就是 MEMORY_MAX_TARGET 的设置不能超过 /dev/shm 的大小
我不知道怎样调整MEMORY_MAX_TARGET,所以就调整/dev/shm的大小

查看原本大小
[root@Shine2 oracle]# df -h|grep shm
tmpfs                 505M  75K  505M  1% /dev/shm

在文件搜索里找到6个initXXX.ora文件,随便打开两个发现memorytarget的值不同。。。
其中有一个是1G,那就1G吧。。。也不知道是什么
[oracle@Shine2 ~]$ gedit /etc/fstab
把文件中
tmpfs                   /dev/shm                tmpfs  defaults        0 0
改为
tmpfs                   /dev/shm                tmpfs  defaults,size=1G        0 0

[root@Shine2 oracle]# umount /dev/shm
出现错误:/dev/shm is busying,并提示我使用lsof命令。
lsof(list open files)是一个列出当前系统打开文件的工具。
[root@Shine2 oracle]# lsof |grep shm
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/oracle/.gvfs
      Output information may be incomplete.
pulseaudi 2997    oracle  mem       REG       0,16  67108904       9562 /dev/shm

[root@Shine2 oracle]# kill 2997
[root@Shine2 oracle]# lsof |grep shm
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/oracle/.gvfs
      Output information may be incomplete.
把使用该文件的进程干掉了

[root@Shine2 oracle]# umount /dev/shm
[root@Shine2 oracle]# mount /dev/shm
[root@Shine2 oracle]# df -h|grep shm
tmpfs                 1.0G  400M  625M  40% /dev/shm
卸载再重新挂载后,实例终于可以启动了~哈哈<img type="face" src="http://www.sinaimg.cn/uc/myshow/blog/misc/gif/E___6708EN00SIGG.gif" real_src="http://www.sinaimg.cn/uc/myshow/blog/misc/gif/E___6708EN00SIGG.gif" alt="ORA-00845: MEMORY_TARGET not supported on this system" title="ORA-00845: MEMORY_TARGET not supported on this system" style="margin:0px;padding:0px;list-style:none;" />

[oracle@Shine2 ~]$ sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 30 09:34:01 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter user-name: / as sysdba
Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  640286720 bytes
Fixed Size            1338420 bytes
Variable Size          461374412 bytes
Database Buffers      171966464 bytes
Redo Buffers            5607424 bytes
Database mounted.
Database opened.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31411496/viewspace-2133258/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2016-11-16

  • 博文量
    19
  • 访问量
    11642