add partition导致ora-4031错误

APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.2.0.4 to 11.2.0.4 [Release 11.2]
Information in this document applies to any platform.

SYMPTOMS

In this case, the issue is observed in three different RAC databases, each on 11.2.0.4, that were experiencing excessive PRTMV memory allocation during weekly partition maintenance operations. The PRTMV memory allocated by the instances reached 100G in some cases:

Example:

SQL> select name, bytes from v$sgastat  where pool = ‘shared pool‘ and (bytes > 999999 or name = ‘free memory‘) order by bytes desc;

NAME                                                 BYTES
------------------------------ ---------------------------
PRTMV                                         120913780976  <----112G
free memory                                    22767772296
gcs resources                                   4333239880
gcs shadows                                     2999935320
SQLA                                            2451326936

This leds to ORA-4031 errors, the instance being unresponsive, and the need to restart the instance to finish the maintenance jobs.

CAUSE

Each partition maintenance operation allocates PRTMV memory, and each cursor referencing the object also allocates PRTMV memory. 
DDLs on the partitioned objects invalidates the existing cursors and new cursors are created, and old versions may not be able to be purged if there are still references to them. 
Thus the memory grows and grows until ORA-04031 starts to be seen due to the excessive allocation in PRTMV memory structure.

SOLUTION

The following actions were taken over the course of troubleshooting the issue, and the ORA-4031 errors were resolved with all below steps in place:

1) The shared pool size was increased by 20%.

2) Durations were eliminated (_enable_shared_pool_durations=false)

3) Granule size was set to 32M

4) Patches for the following bugs were applied:
        Bug 19461270 - ORA-4031 EXECUTING TRUNCATE PARTITION ON INTERVAL PARTITIONED TABLES
        Bug 18953287 - UNKEEP USER-KEPT CURSOR WHEN INVALIDATED
        Bug 19614585 - QUERY REPORTED ORA 600 [KKSGAGETNOALLOC_INT0] ON ADG AFTER SWITCHOVER
        Bug 20754583 - ‘LIBRARY CACHE: MUTEX X‘ HIT AT RUNNING DBMS_STATS, ISSUE OBSERVED ON OTHER INST. Note! This fix has been superseded by the fix in Bug:28891741. Instead of applying patch 20754583, apply patch 28891741.
        Bug 20635353 - ORA-4031 WITH PRTMV HEAP AFTER ALTERING PARTITIONED TABLE
        Bug 19689979 - ORA-8103 RUNNING SELECT ON PARTITION TABLE ON RAC NODE

5) Event 20635353 was set to level 5 (needs 20635353 and represents the number of memory heap no-wait latch requests made, with ‘5‘ being the maximum):

To set the event:
    alter system set event = ‘20635353 level 3‘ scope=spfile;
    and restart the instance.

6) User activity was minimized during maintenance

7) Partition maintenance operations were reduced by:
        a) Not issuing a separate ‘drop subpartition‘ statement for each subpartition in a partition, and instead mass dropping all of the subpartitions in a partition by issuing one ‘drop partition‘ statement
        b) Not truncating a partition or subpartition before dropping it

8) Spreading the maintenance operations over different sessions so that there was a better chance of the PRTMV memory mapping to different subpools instead of concentrating in one subpool

Ultimately step 7 was probably most effective - there is a direct correlation between the amount of PRTMV memory allocated and the number of DDL operations executed on the maintained objects. However, all of the steps above were helpful.

我当时就调整了下share pool得大小,

然后每次加2000多个的分区,然后在刷新一下share pool,释放PRTMV占用的内存。

原文地址:https://www.cnblogs.com/muzisanshi/p/11888554.html

时间: 2024-10-26 08:26:16

add partition导致ora-4031错误的相关文章

【体系结构问题解决,1】解决4031错误方法

三.解决4031错误方法: (ora-4031错误产生原因:大量的硬解析后,导致链上的chunk都变的非常小,此时来了一个大的sql会找不到合适的chunk,就会报ora-4031错误.) 如果SHARED_POOL_SIZE 设置得足够大,又可以排除 Bug 的因素,那么大多数的ORA- 04031 错误都是由共享池中的大量的SQL 代码等导致过多内存碎片引起的. 1.执行alter system flush shared_pool; 清理library cache 和rows cache ,

表收集错误导致执行计划错误

有时候,表收集信息错误,导致执行计划错误问题. SQL> insert into test values(1,'user1'); 已创建 1 行. SQL> commit; 提交完成. SQL> select * from test; ID NAME ---------- ---------------------------------------- 1 user1 SQL> insert into test values(2,'user2'); 已创建 1 行. SQL>

Can&#39;t add self as subview crash错误

问题原因: push 或者pop方法写在viewController的viewWillAppear或者viewDidLoad内,页面没有加载完成就直接进入下一个页面或者返回到下一个页面.点击返回按钮就会报以下这个崩溃.*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't add self as subview' 解决方法: 1.push或者pop可以写在上一个页面pus

在input中回车后页面提交导致出现HTTP 错误 405.0 - Method Not Allowed

前些时间在做一个搜索功能时发现一个比较有意思的现象,场景是这样的:在一个模态窗口中是一个订单列表,页面的顶部有若干个状态筛选框和一个搜索关键字输入框,当焦点在关键字输入框时按回车,本来是对input的keyup事件做了监听,当发现是按了回车键时便自动提交搜索请求的,但输入关键字后按回车时页面竟然跳转了,并且出现"HTTP 错误 405.0 - Method Not Allowed无法显示您正在查找的页面,因为使用了无效方法(HTTP 谓词)"的错误,非常纳闷. 按照错误信息及现象(页面

关于oracle 11g导出数据时 报 ORA 1455错误的处理

由于导出的该用户的表可能存在空数据表,那么可能就会出现此其异常. 首先: 查看: SQL>show parameter deferred_segment_creation; 如果为TRUE,则将该参数改为FALSE: 在sqlplus中,执行如下命令: SQL>alter system set deferred_segment_creation=false; 然后: 可以针对数据表.索引.物化视图等手工分配Extent SQL>Select 'alter table '||table_n

duplicate from active dg 的 run 脚本 sfile 为完整配置可能导致的一些错误

oracle 11g RMAN:Active Database Duplication for standby database 创建dg 命令解读 继上篇如果没有正确配置,理解duplicate from active  dg 的 run 脚本,就会出现以下错误: 1:路径不存在: Oracle instance shut down connected to auxiliary database (not started) RMAN-00571: =======================

Redis解决强制关闭Redis快照导致不能持久化错误

今天在使用composer添加Redis缓存的时候,运行Redis发生错误: 127.0.0.1:6379> set dachou dadachou (error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis

Treat wchar_t as built-in type不一致导致的链接错误

今天用VS2013新建了一个工程,生成时出现很多怪异的链接错误,比如: error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class MTString __cdecl MTString::fromWCharArray(wchar_t const *,int)"([email protected]@@[email protected][email protected]) refe

ubuntu 使用sudo apt-get update 出现 被配置多次导致无法升级错误解决方法

这个周六周末在考虑升级自己GPU开发机,在琢磨使用docker来按转tensorflow环境,在升级软件的时候爆出了如下错误 在 /etc/apt/sources.list.d/sogoupinyin.list:1 和 /etc/apt/sources.list.d/ubuntukylin.list:1 中被配置了多次 错误发生的原因: 1. 包冲突了,导致了无法配置,我们删除掉sogoupinyin.list文件即可.这样问题就得以解决了.