我想刷新共享池,因为有错误
ORA-04031: unable to allocate 32 bytes of shared memory
所以我想使用刷新共享池
alter system flush shared_pool;
使用连接为sysdba
hwflow08:flman800 > sqlplus "conn as sysdba"
SQL*Plus: Release 10.2.0.3.0 - Production on Wed Jan 28 05:39:56 2015
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter password: Connected.
在执行alter system命令时,我们遇到了ORA-01012
SQL> alter system flush buffer_cache;
alter system flush buffer_cache
*
ERROR at line 1:
ORA-01012: not logged on
任何人都可以指导我如何刷新共享池? (我不想关闭数据库,也不想增加共享池的大小)
以前同样的问题来了:
我选择了SHUTDOWN DB.所以在STARTUP之后,当我通过SYSDBA连接并执行相同的查询时,系统刷新shared_pool;那个时候它完美无缺.所以问题仍然是为什么ORACLE在内存不足时不允许刷新共享池?什么是使用alter system flush shared_pool的有效方法;
编辑:
好像它的10g BUG
解决方法:
检查SGA区域大小 – 缓冲池,字典缓存,库缓存.
还要检查动态视图v $sga_resize_ops.你可能会找到一个理由.
这些版本的Oracle也有一个bug,导致Oracle无法摆脱旧的exec计划,如果它们太多了.您应该升级到终端补丁集10.2.0.5.
您还应该考虑设置参数cursor_sharing,但在某些情况下这可能没有帮助.首先你应该找到一个罪魁祸首,通常这是由一些像Hibernate这样的ORM框架引起的.
更新:
在早期版本12c RAC cluser中也存在内存泄漏.所以当你执行这个:
SQL> select * from ( select name, bytes/1024/1024/1024 from v$sgastat where pool ='shared pool' order by 2 desc ) where rownum <11;
NAME BYTES/1024/1024/1024
-------------------------- --------------------
ges resource dynamic 7.42374295
value block free list 4.61375274
free memory 2.66423168
gcs resources 1.78276435
ges enqueues 1.45691999
gcs shadows .990424648
db_block_hash_buckets .343753815
gcs res hash bucket .125
gc name table .09375
KTSL subheap .086000413
因此,您可以看到7GB的SGAs RAM被某些集群件缓冲区占用.
但是这些错误的最常见原因是大量的硬解析导致库缓存增长.
标签:linux,oracle
来源: https://codeday.me/bug/20190806/1603353.html