Home >Database >Mysql Tutorial >Oracle启动报错:ORA-00845: MEMORY_TARGET not supported on this sy

Oracle启动报错:ORA-00845: MEMORY_TARGET not supported on this sy

WBOY
WBOYOriginal
2016-06-07 17:20:271193browse

Oracle启动报错:ORA-00845: MEMORY_TARGET not supported on this system,

今天启动Oracle的时候,报错

[root@localhost ~]#su - oracle

[oracle@localhost ~]$lsnrctl start

lsnrctl: error while loading shared libraries: /u01/app/oracle/product/11.2.0/db_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied

解决办法:在root用户下执行以下命令

[root@localhost ~]# setenforce 0

[root@localhost ~]#su - oracle

[oracle@localhost ~]$lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 20-SEP-2012 19:03:03

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

Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Log messages written to /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                20-SEP-2012 19:03:04
Uptime                    0 days 0 hr. 0 min. 1 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
The listener supports no services
The command completed successfully

问题解决。

[oracle@localhost ~]$ sqlplus / as sysdba

SQL> startup

报错:ORA-00845: MEMORY_TARGET not supported on this system

    
问题定位:安装数据库时或者修改了参数MEMORY_TARGET或者SGA_TARGET的大小。
           SGA参数的大小超过了操作系统/dev/shm的大小。
           linux安装完后默认/dev/shm为物理内存的一半。

技术背景:linux大内存支持(Very Large Memory)中,使用了shmfs/tmpfs选项,ramfs也可以。
           /dev/shm目录挂载类型为tmpfs,此共享内存用于交换,尤其对于大文件优势明显。
           相对于ramfs,tmpfs的优势在于动态调整物理内存的占用,而ramfs不能调整。
           /dev/shm与swap的区别:shm基于内存的文件系统,swap基于硬盘的文件系统。

解决方法:

1、调整MEMORY_TARGET(11G)或者SGA_TARGET(9i,10G)大小(不建议)。

2、调整/dev/shm的大小。
   修改/etc/fstab,,重新mount /dev/shm,然后就可以启动数据库了。

(1)查看/dev/shm 大小
     df -k /dev/shm
     Filesystem 1K-blocks Used Available Use% Mounted on
     tmpfs       4089416   0     4089416  0%  /dev/shm
(2)调整/dev/shm大小
     vi /etc/fstab
     #tmpfs /dev/shm tmpfs defaults 0 0
      tmpfs /dev/shm tmpfs defaults,size=10240M 0 0
(3)重新加载
     umount /dev/shm
     mount /dev/shm
     df -k /dev/shm
(4)登陆测试
     sqlplus / as sysdba

至此问题得到解决。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn