ORA-00845: MEMORY_TARGET not supported on this system

  在出现此错误以前,须要理解参数/dev/shm的做用。linux

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

[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(自动内存管理)oracle

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

  从新启动数据库:app

[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文件。ui

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

  永久修改参数:
spa

 

[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

 

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

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
相关文章
相关标签/搜索