In this Document

  Purpose
  Troubleshooting Steps
  References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 8.0.6.3 and later

Information in this document applies to any platform.

PURPOSE

The purpose of this document is to provide some steps to take to gather some essential information necessary for initial analysis of ORA-4031 errors on the shared pool. For more detailed information gathering, please
refer to MOS Document 430473.1.

Note: this document only applies to ORA-4031 errors generated on the shared pool. For ORA-4031 errors on the large pool, please review MOS Document 1674933.1.
For ORA-4031 errors on the Java and Streams pools, please review MOS Document 1675450.1.

TROUBLESHOOTING STEPS

Review MOS Document 1674117.1 on
what information is to be gathered for analysis of an ORA-4031 issue, why this information is necessary, and how to obtain it.

At least the following pieces of information should be collected to be able to start analysis of the ORA-4031 issue:

  1. For Oracle10g and lower releases, obtain the trace file of the very first ORA-4031 occurrence reported after the last instance startup. For Oracle11g and higher release, obtain the incident package (see MOS Document 443529.1)
    of the very first ORA-4031 incident reported after the last instance startup.
  2. Obtain the RDA report (see MOS Document 314422.1 for
    details of installing & running RDA. RDA can be included in incident packages by default in 11.2.0.2 onwards by following the instructions in MOS Document 1456047.1).
  3. Obtain the current memory allocations in the shared pool:
        CONNECT / AS SYSDBA



        SET PAGESIZE 9999

        SET LINESIZE 256

        SET TRIMOUT ON

        SET TRIMSPOOL ON

        COL 'Total Shared Pool Usage' FORMAT 99999999999999999999999

        COL bytes FORMAT 999999999999999

        COL current_size FORMAT 999999999999999

        COL name FORMAT A40

        COL value FORMAT A20

        ALTER SESSION SET nls_date_format='DD-MON-YYYY HH24:MI:SS';



        SPOOL SGAPARAMS.TXT



        /* Database identification */

        SELECT name, platform_id, database_role FROM v$database;

        SELECT * FROM v$version WHERE banner LIKE 'Oracle Database%';



        /* Current instance parameter values */

        SELECT n.ksppinm name, v.KSPPSTVL value

        FROM x$ksppi n, x$ksppsv v

        WHERE n.indx = v.indx

        AND (n.ksppinm LIKE '%shared_pool%' OR n.ksppinm IN ('_kghdsidx_count', '_ksmg_granule_size', '_memory_imm_mode_without_autosga'))

        ORDER BY 1;



        /* Current memory settings */

        SELECT component, current_size FROM v$sga_dynamic_components;



        /* Memory resizing operations */

        SELECT start_time, end_time, component, oper_type, oper_mode, initial_size, target_size, final_size, status 

        FROM v$sga_resize_ops

        ORDER BY 1, 2;



        /* Historical memory resizing operations */

        SELECT start_time, end_time, component, oper_type, oper_mode, initial_size, target_size, final_size, status 

        FROM dba_hist_memory_resize_ops

        ORDER BY 1, 2;



        /*  Shared pool 4031 information */

        SELECT request_failures, last_failure_size FROM v$shared_pool_reserved;



        /* Shared pool reserved 4031 information */

        SELECT requests, request_misses, free_space, avg_free_size, free_count, max_free_size FROM v$shared_pool_reserved;



        /* Shared pool memory allocations by size */

        SELECT name, bytes FROM v$sgastat WHERE pool = 'shared pool' AND (bytes > 999999 OR name = 'free memory') ORDER BY bytes DESC;



        /* Total shared pool usage */

        SELECT SUM(bytes) "Total Shared Pool Usage" FROM v$sgastat WHERE pool = 'shared pool' AND name != 'free memory';



        /* Cursor sharability problems */

        /* This version is for >= 10g; for <= 9i substitute ss.kglhdpar for ss.address!!!! */

        SELECT sa.sql_text,sa.version_count,ss.*

        FROM v$sqlarea sa,v$sql_shared_cursor ss

        WHERE sa.address=ss.address AND sa.version_count > 50

        ORDER BY sa.version_count ;



        SPOOL OFF
  4. For Oracle10g ang later, obtain an AWR report (see MOS Document 748642.1)
    from the period where the first ORA-4031 was encountered:

        CONNECT / AS SYSDBA

        @?/rdbms/admin/awrrpt.sql
  5. For Oracle10g and later, obtain SGA statistics:
        CONNECT / AS SYSDBA

        ORADEBUG setmypid

        ORADEBUG unlimit

        ALTER SESSION SET events 'immediate trace name dump_all_comp_granule_addrs level 1';

        ORADEBUG tracefile_name

        ORADEBUG close_trace

After having gathered all of the above information, upload the information to the Service Request.

REFERENCES

NOTE:443529.1 - Database 11g: Quick
Steps to Package and Send Critical Error Diagnostic Information to Support [Video]

NOTE:314422.1 - Remote Diagnostic
Agent (RDA) - Getting Started





NOTE:430473.1 - ORA-4031 Common Analysis/Diagnostic
Scripts [Video]

NOTE:1456047.1 - How to Setup Automatic
RDA Data Collection for Incident Packages?

NOTE:1675450.1 - Gathering Initial
Troubleshooting Information for Analysis of ORA-4031 Errors on Java and Streams Pools

NOTE:1674117.1 - SRDC - ORA-4031
on Shared Pool: Checklist of Evidence to Supply

NOTE:1674933.1 - Gathering Initial
Troubleshooting Information for Analysis of ORA-4031 Errors on the Large Pool

others

ORA-04031: Unable to Allocate %n Bytes of Shared Memory ("shared pool",%s,%s,%s)

APPLIES TO:

Oracle Database - Enterprise Edition - Version 8.1.7.4 and later

Information in this document applies to any platform.

***Checked for relevance on 31-Jul-2013***

Archived

PURPOSE

ORA-04031: unable to allocate %s bytes of shared memory (\"%s\",\"%s\",\"%s\",\"%s\")

TROUBLESHOOTING STEPS

fix:

Try to increase shared_pool_size in init.ora file. If it seems large enough
then improve segmentation in shared pool by reserving part of shared pool for
large objects using parameter SHARED_POOL_RESERVED_SIZE (good value to start
tuning is 1/3 of shared-pool size). It is possible to decide what is "
large object" by parameter SHARED_POOL_RESERVED_MIN_ALLOC.

Gathering Initial Troubleshooting Information for Analysis of ORA-4031 Errors on the Shared Pool的更多相关文章

  1. 【ORA】ORA-00371: not enough shared pool memory

    今天rac中有一个节点asm实例起不来包了ora-000371的错误,错误贴在下面: [oracle@rac2 dbs]$ srvctl start asm -n rac2 PRKS-1009 : F ...

  2. Oracle内存全面分析

    Oracle内存全面分析 Oracle的内存配置与oracle性能息息相关.而且关于内存的错误(如4030.4031错误)都是十分令人头疼的问题.可以说,关于内存的配置,是最影响Oracle性能的配置 ...

  3. Oracle Net Listener Parameters (listener.ora)(转)

    12/20 7 Oracle Net Listener Parameters (listener.ora) This chapter provides a complete listing of th ...

  4. Click to add to Favorites Troubleshooting: High Version Count Issues (Doc ID 296377.1)

    Copyright (c) 2018, Oracle. All rights reserved. Oracle Confidential. Click to add to Favorites Trou ...

  5. Troubleshooting ORA-01555 - Snapshot Too Old: Rollback Segment Number "String" With Name "String" Too Small (Doc ID 1580790.1)

    Troubleshooting ORA-01555 - Snapshot Too Old: Rollback Segment Number "String" With Name & ...

  6. Troubleshooting Autoinvoice Import

    metalink :1089172.1 In this Document   Purpose   Troubleshooting Steps   AutoInvoice Execution Repor ...

  7. Troubleshooting 'library cache: mutex X' Waits. (Doc ID 1357946.1)

    In this Document   Purpose   Troubleshooting Steps   What is a 'library cache: mutex X' wait?   What ...

  8. Back up and restore information in Firefox profiles

    Click the menu button , click Help and select Troubleshooting Information. The Troubleshooting Infor ...

  9. Database hang and Row Cache Lock concurrency troubleshooting

    http://www.dadbm.com/database-hang-row-cache-lock-concurrency-troubleshooting/ Issue backgroundThis ...

随机推荐

  1. Swift中使用NSLog的问题

    在Swift中如果想要以如下方式执行NSLog,则编译器必定抱怨: class Foo {} NSLog("%@",Foo()) 因为Foo是原生Swift类不是继承自NSObje ...

  2. 基于BaseAdapter的Listview小Demo

    ListView是android开发中比较常用的控件, 其中适配器模式可以选择: ArrayAdapter:简单易用,通常用于将数组或者List集合的读个包值封装成多个列表项 SimpleAdapte ...

  3. Android 高级控件(七)——RecyclerView的方方面面

    Android 高级控件(七)--RecyclerView的方方面面 RecyclerView出来很长时间了,相信大家都已经比较了解了,这里我把知识梳理一下,其实你把他看成一个升级版的ListView ...

  4. github pages + Hexo + 域名绑定搭建个人博客

    环境 Windows 10(64 位) Git-2.7.4-64-bit node-v4.4.7-x64 如果上述软件已经安装的,跳过,没有安装的下载安装. 1,git下载安装(https://git ...

  5. 【Netty源码分析】发送数据过程

    前面两篇博客[Netty源码分析]Netty服务端bind端口过程和[Netty源码分析]客户端connect服务端过程中我们分别介绍了服务端绑定端口和客户端连接到服务端的过程,接下来我们分析一下数据 ...

  6. 14 Fragment 碎片总结

    Fragment 碎片 一, Fragment是什么? Android 3.0以后出现的 Api11 以上 Activity的组成部分 Fragment(小的Activity) Fragment可以显 ...

  7. Android 5.1.1 源码目录结构

    点击打开链接 最近公司培训新同事,我负责整理一点关于android的基础知识,遥想当年,刚接触android,也是一头雾水, 啥都不懂,就是靠看文档和视频,对android有一个初步了解,然后就通过查 ...

  8. SimpleAdapter和Baseadapter填充listActivity-android学习之旅()

    简介 SimpleAdapter的功能是能够为AbsListView提供复杂的数据,需要构造ListView 代码示例 package peng.liu.testview; import androi ...

  9. 记录github出错及解决方案

    刚刚在github上更新自己项目的一些内容时出现了一些错误,几经折腾及在网上查找资料终于解决.具体记录如下: 主要就是就是在push时报错,错误信息如下: 根据报错信息原本以为是要重新pull一下,但 ...

  10. 第三方ProgressHUD进度条 技术分享

    创建一个进度辅助视图: 初始化: - (void)viewDidLoad { [super viewDidLoad]; <span style="color: rgb(255, 0, ...