重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1291|回复: 0
打印 上一主题 下一主题

[Oracle] ORA-20000: Unable to gather statistics concurrently: Resource manager plan is...

[复制链接]
跳转到指定楼层
楼主
发表于 2023-8-23 09:35:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
一、现象

    While attempting to gathering statistics on Oracle 12c, receive ORA-20000 error as follows:

SQL> begin dbms_stats.gather_schema_stats(  ownname=> 'CS',cascade=> DBMS_STATS.AUTO_CASCADE, estimate_percent=> DBMS_STATS.AUTO_SAMPLE_SIZE,
2  degree=> 8,no_invalidate=> DBMS_STATS.AUTO_INVALIDATE,  granularity=> 'AUTO',method_opt=> 'FOR ALL INDEXED COLUMNS SIZE AUTO',  options=> 'GATHER
');end;
3
4  /
begin dbms_stats.gather_schema_stats(  ownname=> 'CS',cascade=> DBMS_STATS.AUTO_CASCADE, estimate_percent=> DBMS_STATS.AUTO_SAMPLE_SIZE,
*

ERROR at line 1:
ORA-20000: Unable to gather statistics concurrently: Resource manager plan is
not active or is not managing CPU usage
ORA-06512: at "SYS.DBMS_STATS", line 35991
ORA-06512: at line 1

    Database was recently upgraded from 11.2 to 12c with concurrent setting to true in both versions

SQL> select dbms_stats.get_prefs ('CONCURRENT') from dual;

DBMS_STATS.GET_PREFS('CONCURRENT')
--------------------------------------------------------------------------------
TRUE

    Statistics Gathering worked fine on the earlier version

二、解决方法

To avoid the error, either Enable Resource Manager OR Disable concurrent statistics gathering by setting the CONCURRENT preference to OFF. You will need to restart the database to enable these changes.

以下方法二选一:

Enable Resource Manager:

SQL> alter system set resource_manager_plan = 'DEFAULT_PLAN' scope=spfile;

Disable concurrent statistics gathering by setting the CONCURRENT preference to OFF:

SQL> exec dbms_stats.set_global_prefs('CONCURRENT', 'FALSE');


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-25 08:52 , Processed in 0.087996 second(s), 21 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表