温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2020-07-21 14:26:17 来源:网络 阅读:1179 作者:libydwei 栏目:关系型数据库

    

网上很多关于这个错误的文章,有些还引用了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 ~]# 

 

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI