iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >再说ORA-00845: MEMORY_TARGET not supported on this system
  • 472
分享到

再说ORA-00845: MEMORY_TARGET not supported on this system

2024-04-02 19:04:59 472人浏览 泡泡鱼
摘要

    网上很多关于这个错误的文章,有些还引用了oracle文档中的说明。Setting Memory Target at Instance Startup on l

    

网上很多关于这个错误的文章,有些还引用了oracle文档中的说明。

Setting Memory Target at Instance Startup on linux
Starting with Oracle Database 11g Release 1 (11.1), Oracle provides the option of automatically managing SGA and PGA with a combined MEMORY_TARGETparameter without having to set SGA_TARGET and PGA_AGGREGATE_TARGET explicitly. This is supported on Linux, windows, Solaris, HPUX, and aiX (reference Bug 7258378).
If you see the ORA-00845 error reported on Linux Machines at Oracle instance startup when using the MEMORY_TARGET parameter, then check the size of /dev/shm. If /dev/shm is not configured, then mount it sized to be at least the value of MEMORY_TARGET. If /dev/shm is configured but the amount of available space reported (through df -k /dev/shm) is less than MEMORY_TARGET, then free the space or mount a larger /dev/shm to satisfy the MEMORY_TARGET size. Note that if you set theMEMORY_MAX_TARGET parameter greater than MEMORY_TARGET, then ensure that /dev/shm is sized to be at least the value of MEMORY_MAX_TARGET.
Memory Target for Oracle Database InstancesRunning Database Configuration Assistant (DBCA) defaults to this Automatic Memory Management option. In the case of upgrade or manual database creation,MEMORY_TARGET can be specified in the initialization parameter file.

 

大部分人理解为,要求/dev/shm至少必须不小于MEMORY_MAX_TARGET的大小。

但是根据测试的实际情况,必须是/dev/shm的可用空间不小于MEMORY_MAX_TARGET的大小。

例如

sql> show parameter target

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
arcHive_lag_target                   integer     0
db_flashback_retention_target        integer     1440
fast_start_io_target                 integer     0
fast_start_mttr_target               integer     0
memory_max_target                    big integer 6336M
memory_target                        big integer 6336M
parallel_servers_target              integer     16
pga_aggregate_target                 big integer 0
sga_target                           big integer 0

 

根据参数,memory_max_target 参数为6.18G

[root@oracledb ~]# mount -o remount,size=10G /dev/shm
[root@oracledb ~]# df -h
Filesystem                        Size  Used Avail Use% Mounted on
/dev/mapper/vg_Centosdbo-lv_root   50G   42G  5.3G  89% /
tmpfs                              10G  9.9G 144M  99% /dev/shm
/dev/sda2                         485M   39M  421M   9% /boot
/dev/sda1                         200M  260K  200M   1% /boot/efi
/dev/mapper/vg_centosdbo-lv_home  1.3T  504G  744G  41% /home
[root@oracledb ~]# su – oracle

 

 

 

即便这里我设置size大小为10G。但是可用空间只有144M.

这时我启动数据库

SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 30 14:29:21 2016

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

SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system

仍然会报错。

如下所示,如果保证可用空间大于memory_max_target,则数据库正常启动。

[root@oracledb ~]# mount -o remount,size=16G /dev/shm
[root@oracledb ~]# df -h
Filesystem                        Size  Used Avail Use% Mounted on
/dev/mapper/vg_centosdbo-lv_root   50G   42G  5.3G  89% /
tmpfs                              16G  6.2G  9.9G  39% /dev/shm
/dev/sda2                         485M   39M  421M   9% /boot
/dev/sda1                         200M  260K  200M   1% /boot/efi
/dev/mapper/vg_centosdbo-lv_home  1.3T  504G  744G  41% /home
[root@oracledb ~]# sqlplus /nolog
-bash: sqlplus: command not found
[root@oracledb ~]# su - oracle
[oracle@oracledb ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 30 14:30:41 2016

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

SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 6614106112 bytes
Fixed Size                  2213896 bytes
Variable Size            3556771832 bytes
Database Buffers         3019898880 bytes
Redo Buffers               35221504 bytes
Database mounted.
Database opened.
SQL>  

 

由此可能的情况是,/dev/shm默认为系统内存的一半,虽然理论上可能已经大于MEMORY_TARGET,但数据库启动是可能仍然会报错。

比如我所用的测试库,MEMORY_TARGET是6.18G

而默认/dev/shm为内存的一半,即7.7G左右。但数据库启动时仍然报错。

 

[root@oracledb ~]# free -g
             total       used       free     shared    buffers     cached
Mem:            15         11          4          0          0         10
-/+ buffers/cache:          0         14
Swap:            7          0          7
[root@oracledb ~]# 

 

您可能感兴趣的文档:

--结束END--

本文标题: 再说ORA-00845: MEMORY_TARGET not supported on this system

本文链接: https://www.lsjlt.com/news/42850.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作