ORA-04031: Unable To Allocate 32 Bytes Of Shared Memory

来源:http://www.cnblogs.com/MrLeo701/archive/2017/06/27/7084771.html
-Advertisement-
Play Games

記錄一次生產庫遇到的4031錯誤,後來通過調整sga大小將問題解決了 報錯信息: ORA-04031: 無法分配 32 位元組的共用記憶體 ("shared pool","select user#,password,datats...","SQLA","tmp")Incident details in: ...


記錄一次生產庫遇到的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

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • https://tw.transcend info.com/Support/FAQ 940 以下的內容皆來自上面這個網址。 什麼是USB 3.1? 什麼是USB 3.1? USB 3.1為USB協會制定的新規範,分別為USB 3.1 Gen1和Gen2 USB 3.1 Gen1 (SuperSpee ...
  • 上一篇文章介紹瞭如何搭建Kotlin的開發環境,可是這個開發環境依然基於Android Studio,而在Android Studio上使用Java進行編碼,本來就是理所應當的,何必還要專門弄個Kotlin,這個Kotlin相比Java到底有哪些好處呢? 我們可以把Kotlin看作是Java的升級版 ...
  • 一,代碼。 二,輸出。 ...
  • 項目用到的地圖功能有點多,同時集成了地圖、定位以及導航這幾個功能。 每個單獨使用,都很順利,但合在一起用會有問題。 我每次集成百度地圖,都會在http://lbsyun.baidu.com/sdk/download?selected=mapsdk_basicmap,mapsdk_searchfunc ...
  • Android表情開發 效果圖: 源碼下載-github:https://github.com/SiberiaDante/EmotionApp (覺得有用的給個星星,支持一下哦) ...
  • 自定義樣式 dialog,可設置界面外點擊屏幕外和返回鍵 是否消失 基本用法如下: Utils 工具類封裝: 效果圖: git 源碼下載 To get a Git project into your build: To get a Git project into your build: To ge ...
  • 由於經常會出現 Schema hasn't been registered for model "User" 這樣的問題,所以深入的尋找了一下原因,一點一點的向上查找,最後解決了。 首先是app.js裡面在使用之前要定義,和初始化註冊一次mongoose() 如圖: 因為下麵的index和users ...
  • 神經網路(neural network)是深度學習中一種非常重要的模型,關於神經網路更詳細的介紹呢,這裡就不介紹了,可以自行搜索瞭解。文章主要整理了7個神經網路的實戰項目,相信對神經網路學習者會有所幫助~ ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...