ORA-00845

SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system
这是因为之前虚拟机配置了4G内存,后来改成2G了
将内存改成4G后恢复正常。


alter system set sga_max_size=700m scope=spfile; 
--减少SGA大小,静态参数,重启后生效  
3 alter system set sga_target=80m scope=both;
 --动态参数;oracle推荐:启动时修改此参数,不要动态设置此参数  
4 alter system set pga_aggregate_target=40m sope=both; ---减少pga大小
alter system set sga_max_size=700m scope=spfile;

alter system set pga_aggregate_target=100m scope=both; 


处理方式:


[root@orcl11 ~]# su - oracle
-bash: export: `//ORACLE': not a valid identifier
[oracle@orcl11 ~]$ dba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Jun 15 21:45:44 2021

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

Connected to an idle instance.


数据库启动失败,报错内存不支持本系统
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system

查看系统文件大小
[oracle@orcl11 ~]$ df -Th
Filesystem           Type   Size  Used Avail Use% Mounted on
/dev/mapper/vg_orcl11-LogVol01
                     ext4    55G   21G   32G  40% /
tmpfs                tmpfs  931M   72K  931M   1% /dev/shm
/dev/sda1            ext4   190M   40M  140M  23% /boot

其中tmpfs表示共享内存,oracle数据库SGA和PGA的大小不能比tmpfs大,
如果SGA和PGA之和大于tmpfs,则报错ORA-00845

root用户下,更改tmpfs大小
[root@orcl11 ~]# mount -t tmpfs shmfs -o size=1700M /dev/shm


此时数据库启动正常
SQL> startup
ORACLE instance started.

Total System Global Area 1570009088 bytes
Fixed Size            2253584 bytes
Variable Size         1191185648 bytes
Database Buffers      369098752 bytes
Redo Buffers            7471104 bytes
Database mounted.
Database opened.
上述结果显示SGA大概有1.5G,远大于原来的tmpfs的931M


更改SGA大小,数据库启动情况下sga_max_size后的scope参数只能是spfile
SQL> alter system set sga_max_size=700m scope=both; 
alter system set sga_max_size=700m scope=both
                 *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified


SQL> alter system set sga_max_size=700m scope=spfile;

System altered.

将tmpfs还原
[root@orcl11 ~]# mount -t tmpfs shmfs -o size=931M /dev/shm

数据库正常启动,此时SGA为700M
SQL> startup
ORACLE instance started.

Total System Global Area  730714112 bytes
Fixed Size            2256832 bytes
Variable Size          322961472 bytes
Database Buffers      402653184 bytes
Redo Buffers            2842624 bytes
Database mounted.
Database opened.
SQL> 
 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值