记录一次生产库遇到的4031错误,后来通过调整sga大小将问题解决了

报错信息:

ORA-04031: 无法分配 32 字节的共享内存 ("shared pool","select user#,password,datats...","SQLA","tmp")
Incident details in: /u01/app/oracle/diag/rdbms/twprod/xxxxx/incident/incdir_237848/xxxxx_ora_36005_i237848.trc
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Tue Jun 06 19:57:24 2017
Errors in file /u01/app/oracle/diag/rdbms/xxxx/xxxx/trace/xxxx_e004_106234.trc (incident=238416):
ORA-04031: unable to allocate 32 bytes of shared memory ("shared pool","select /*+ INDEX(TAB AQ$_AQ...","SQLA","tmp")
Incident details in: /u01/app/oracle/diag/rdbms/xxxx/xxxx1/incident/incdir_238416/xxxx1_e004_106234_i238416.trc

查看当前sga设置:

SYS@ xxxx1> show parameter sga

NAME                                    TYPE        VALUE
------------------------------------ ----------- ------------------------------
lock_sga                                 boolean      FALSE
pre_page_sga                        boolean      FALSE
sga_max_size                         big integer  20G
sga_target                              big integer  20G

调整sga为30g并重启数据库使参数生效:

SYS@ xxxx1> alter system set sga_max_size=30G scope=spfile;

SYS@ xxxx1> alter system set sga_target=30G scop=spfile;

SYS@ xxxx1> shutdown immediate

SYS@ xxxx1> startup

以下是Mos的解决方法,以供参考:

ORA-04031: Unable To Allocate 32 Bytes Of Shared Memory ("shared pool","select tablespace_id, rfno, ...","SQLA","tmp")" (文档 ID 1986741.1)

In this Document

APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.2.0.2 and later

Information in this document applies to any platform.

SYMPTOMS

Alert log reports errors like below in almost all the instances:

ORA-04031: unable to allocate 32 bytes of shared memory ("shared pool","select tablespace_id, rfno, ...","SQLA","tmp")"

CAUSE

The trace file shows there are 6 sga subpools allocated.

...

****************** End of process map dump ************

==============================================

TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 1

----------------------------------------------

"KGH: NO ACCESS " 4056 MB 61%

"gcs dynamic s " 713 MB 11%

"free memory " 625 MB 9%

"gcs dynamic r " 501 MB 8%

"init_heap_kfsg " 195 MB 3%

"FileOpenBlock " 122 MB 2%

"gcs resources " 64 MB 1%

"ges enqueues " 62 MB 1%

"gcs shadows " 45 MB 1%

"PRTMV " 40 MB 1%

-----------------------------------------

free memory 625 MB

memory alloc. 6031 MB

Sub total 6656 MB

==============================================

TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 2

----------------------------------------------

"KGH: NO ACCESS " 3822 MB 71%

"free memory " 343 MB 6%

"SQLA " 223 MB 4%

"gcs dynamic r " 146 MB 3%

"KGLH0 " 126 MB 2%

"gcs dynamic s " 98 MB 2%

"gc name table " 96 MB 2%

"ges resource " 78 MB 1%

"PRTMV " 68 MB 1%

"gcs resources " 65 MB 1%

-----------------------------------------

free memory 343 MB

memory alloc. 5033 MB

Sub total 5376 MB

==============================================

TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 3

----------------------------------------------

"KGH: NO ACCESS " 3812 MB 80%

"free memory " 215 MB 5%

"SQLA " 112 MB 2%

"KGLH0 " 97 MB 2%

"ges resource " 80 MB 2%

"gcs resources " 66 MB 1%

"gcs shadows " 46 MB 1%

"PRTMV " 45 MB 1%

"KQR X PO " 44 MB 1%

"ges enqueues " 22 MB 0%

-----------------------------------------

free memory 215 MB

memory alloc. 4521 MB

Sub total 4736 MB

==============================================

TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 4

----------------------------------------------

"KGH: NO ACCESS " 3557 MB 79%

"free memory " 367 MB 8%

"KQR L PO " 79 MB 2%

"KGLH0 " 76 MB 2%

"gcs resources " 66 MB 1%

"SQLA " 61 MB 1%

"gcs shadows " 45 MB 1%

"PRTMV " 39 MB 1%

"ges enqueues " 16 MB 0%

"KGLHD " 12 MB 0%

-----------------------------------------

free memory 367 MB

memory alloc. 4113 MB

Sub total 4480 MB

==============================================

TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 5

----------------------------------------------

"KGH: NO ACCESS " 3689 MB 85%

"free memory " 215 MB 5%

"KGLH0 " 74 MB 2%

"gcs resources " 65 MB 2%

"gcs shadows " 44 MB 1%

"PRTMV " 40 MB 1%

"SQLA " 32 MB 1%

"ges enqueues " 24 MB 1%

"db_block_hash_buckets " 21 MB 0%

"KGLHD " 12 MB 0%

-----------------------------------------

free memory 215 MB

memory alloc. 4137 MB

Sub total 4352 MB

==============================================

TOP 10 MEMORY USES FOR SGA HEAP SUB POOL 6

----------------------------------------------

"KGH: NO ACCESS " 3685 MB 76%

"free memory " 240 MB 5%

"gcs dynamic s " 138 MB 3%

"flashback generation buff " 122 MB 2%

"SQLA " 116 MB 2%

"gcs dynamic r " 106 MB 2%

"KGLH0 " 91 MB 2%

"gcs resources " 64 MB 1%

"gcs shadows " 44 MB 1%

"PRTMV " 41 MB 1%

-----------------------------------------

free memory 240 MB

memory alloc. 4624 MB

Sub total 4864 MB

TOTALS ---------------------------------------

Total free memory 2005 MB

Total memory alloc. 28 GB

Grand total 30 GB

==============================================

There are 6 subpools created in the SGA and a high amount of memory is allocated to "KGH: NO ACCESS "

There are multiple bugs open on the same but on 11gR2 there is no actual fix.

SOLUTION

As a solution for the issue you can disable the use of durations.

The shared pool can have subpools with 4 durations. These durations are "instance", "session", "cursor", and "execution". By default these durations are separate from each other.

The disable durations, you have to set the underscore parameter:

"_enable_shared_pool_durations = false"

This is recommended by development for all similar issues.

The main advantage of "_enable_shared_pool_durations = false" is that all the durations are combined into one pool and so a duration will not run out while another duration has free memory.

This issue will be fixed in 12c version due to architectural changes which will allow less need of durations for subpools.

Note:

Please note that unpublished Enhancement Request Bug 8857940 - NEED COMMON DURATIONS FOR UNSHRINKABLE POOLS 8857940, fixed starting with 12.1.0.1, addresses the durations issue as well. With the fix for Bug 8857940 in place, Oracle permits to group the shared pool durations in 2 groups to allow better shareability of the memory and avoid the ORA-4031 errors.

Another possible solution is to apply Patch 8857940 if it is available for your platform and version.

REFERENCES

BUG:19236833 - EXADATA: ORA-04031: UNABLE TO ALLOCATE 32 BYTES OF SHARED MEMORY "SQLA" "TMP"

NOTE:411.1 - ADR Different Methods to Create IPS Package

BUG:17789414 - SUPERCLUSTER: ORA-4031 ERRORS OCCURING WEEKLY CAUSING INSTANCE CRASHES

BUG:20447919 - ORA-4031: UNABLE TO ALLOCATE 32 BYTES

转载于:https://www.cnblogs.com/MrLeo701/p/7084771.html

ORA-04031: Unable To Allocate 32 Bytes Of Shared Memory相关推荐

  1. ORA-04031: unable to allocate 12312 bytes of shared memory

    前两天一非常重要的生产库的alert日志里面一直报如下错误: NOTE: deferred map free for map id 8 Tue Feb 19 14:08:13 2013 WARNING ...

  2. oralce异常 ORA-04031: unable to allocate bytes of shared memory (shared pool,unknown object....

    问题:ORA-04031: unable to allocate 12312 bytes of shared memory ("shared pool","unknown ...

  3. ORA-39095: Dump file space has been exhausted: Unable to allocate 8192 bytes

    甲骨文Oracle数据库使用EXPDP/IMPDP进行Oracle数据迁移从高版本(11g)到底版本(10g)步骤 Oralce数据导入 可能产生的错误 ORA-39095: Dump file sp ...

  4. Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 359404 bytes) in

    为什么80%的码农都做不了架构师?>>>    Fatal error: Allowed memory size of 8388608 bytes exhausted (tried ...

  5. STM8S编译错误unable to allocate space for sections/blocks with a total

    STM8S编译错误unable to allocate space for sections/blocks with a total # 欢迎使用Markdown编辑器 笔者用IAR for STM8 ...

  6. tornado创建项目后build vxworks报错unable to allocate heap, heap_chunk_size 587202560, Win32 error 0

    tornado创建项目后build vxworks报错unable to allocate heap, heap_chunk_size 587202560, Win32 error 0 build报错 ...

  7. Native memory allocation (malloc) failed to allocate 2863661056 bytes for committing reserved memory

    服务器生产环境数据同步报错kettle 导致调度无法正常启动,报错日志如下: 见第二行信息显示:由于内存不足导致,系统无法分配足够内存让调度运行. 解决办法: 可以调节 -XX:MaxPermSize ...

  8. IAR编译错误:unable to allocate space for sections/blocks with a total estimated minimum size of 0x504c

    IAR编译错误:unable to allocate space for sections/blocks with a total estimated minimum size of 0x504c 用 ...

  9. Pinging ? with 32 bytes of data 故障解决

    前几天遇到一个问题: 拨号一切正常,确不能上网.通过网上查找,问题解决.  C:\>ping 202.98.96.68 Pinging ? with 32 bytes of data: Repl ...

最新文章

  1. 【No.1_sizeof与strlen】
  2. tf.keras.layers.MaxPool2D 示例 池化层
  3. Kettle 合并记录报错!
  4. 鸿蒙系统2020正式版,鸿蒙2.0来了!华为开发者大会HDC 2020宣布
  5. java 1.6u29 下载_jdk1.6 64位下载|JDK 6(Java SE Development Kit)下载6u43 64位官方版_java运行环境 IT猫扑网...
  6. Python 大数据分析 淘宝商品销量的关系
  7. 基于java的银行综合业务柜台系统设计与实现(含源文件)
  8. 线性代数笔记 -- A = LU的应用
  9. 小米pro笔记本加装dw1820a无线网卡,完美装苹果macOS
  10. Windows Server 2019/2022域控制器网络位置变为“专用网络”或“公共网络”
  11. GraphQL 总结 + 在Django应用(Graphene)
  12. 养成备份的习惯的重要性
  13. 上古卷轴5传奇版LE与重制版SE的区别(LE Vs SE)
  14. CSS超出两行隐藏,但是仍然有部分第三行文字溢出
  15. Linux发行版之间有什么区别?
  16. Docker——Docker 容器数据卷(Volumes)
  17. CORS解决跨域的几种实现方式
  18. 数字IC后端设计实现floorplan及powerplan规划
  19. STM32 HAL库之USB
  20. 工程项目建设数字化管理解决方案

热门文章

  1. 在SunOS5.8/solaris7上使用Xerces-C解析器
  2. who is the one who actually know the essential things in life?
  3. anything, if you have made a choice
  4. 关于C#内存释放的BUG?
  5. double转整数问题
  6. net.sf包JSONArray与JSONObject遍历
  7. rhel5.5_Apache配置openssl支持https服务
  8. flex4.6 保留自动产生的actionscript代码的编译选项
  9. MVC扩展控制器工厂,通过继承DefaultControllerFactory来决定使用哪个接口实现,使用Ninject...
  10. 利用 Selenium 自动化 web 测试【步骤详解】