zoukankan      html  css  js  c++  java
  • ORA-00845: MEMORY_TARGET not supported on this system

      在出现此错误之前,需要理解参数/dev/shm的作用。

      使用df -h查看该参数目前大小:

    [root@Abbott ~]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/vg_abbott-LogVol01
                           36G   12G   23G  34% /
    tmpfs                 940M   72K  939M   1% /dev/shm
    /dev/sda1             190M   41M  140M  23% /boot

      这里可以看到总共大小为940M,只使用了72K

      进入数据库生成pfile文件,修改pfile文件中的参数如下,将数据库内存管理修改为AMM(自动内存管理)

    SQL> create pfile='/home/oracle/pfile.ora' from spfile;
    
    File created.
    
    SQL> quit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    [oracle@Abbott ~]$ ls
    backup  dict.log  pfile.ora
    [oracle@Abbott ~]$ vi pfile.ora 
    *.memory_max_target=1572864010
    *.memory_target=1572864010
    #*.pga_aggregate_target=214748364
    #*.sga_max_size=1288490188
    #*.sga_target=1288490188

      重新启动数据库:

    [oracle@Abbott ~]$ sqlplus / as sysdba
    
    SQL*Plus: Release 11.2.0.4.0 Production on Thu Jun 15 16:40:59 2017
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    Connected to an idle instance.
    
    SQL> startup pfile='/home/oracle/pfile.ora' nomount;
    ORA-00845: MEMORY_TARGET not supported on this system

      这里可以看到数据库无法启动,错误提示系统不支持,查阅文档后,发现如果使用AMM自动内存管理,那么/dev/shm这个参数就非常重要。
      /dev/shm是linux非常有用的一个目录,它就是所谓的tmpfs,也可以称之为临时文件系统(不是块设备),类似oracle中的临时表空间一样,用于加速和优化系统。该目录并没有放在磁盘上,而是放在内存当中

      当使用AMM自动内存管理之后,数据库启动后会在/dev/shm目录下面生成很多ORA文件。

      实践发现,/dev/shm参数必须设置得比memory_max_size大,数据库才可以正常启动

      永久修改参数:

    [oracle@Abbott ~]$ cat /etc/fstab 
    
    /dev/mapper/vg_abbott-LogVol00 swap                    swap    defaults        0 0
    tmpfs                   /dev/shm                tmpfs   defaults,size=1600M        0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
    sysfs                   /sys                    sysfs   defaults        0 0
    proc                    /proc                   proc    defaults        0 0

      再次重新启动数据库,可正常启动:

    SQL> startup pfile='/home/oracle/pfile.ora' nomount; 
    ORACLE instance started.
    
    Total System Global Area 1586708480 bytes
    Fixed Size                  2253624 bytes
    Variable Size             704646344 bytes
    Database Buffers          872415232 bytes
    Redo Buffers                7393280 bytes
  • 相关阅读:
    Error: could not open `C:Program FilesJavajre6libi386jvm.cfg'
    异常:java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path '/app/userInfoMaint/getProvince.do'
    解析Java反射
    Cause: java.sql.SQLException: 无效的列索引
    Internet Explorer 无法打开该 Internet 站点,请求的站点不可用或无法找到
    解决The JSP specification requires that an attribute name is preceded by whitespace问题
    pl/sql的to_char和to_date
    oracle 在xml中批量插入,批量修改及多组条件查询
    时间转换模板
    Java网络编程从入门到精通(5):使用InetAddress类的getHostName方法获得域名
  • 原文地址:https://www.cnblogs.com/zx3212/p/7019025.html
Copyright © 2011-2022 走看看