ITPub博客

首页 > 数据库 > Oracle > ORA-01422: exact fetch returns more than requested number of rows ORA-06512

ORA-01422: exact fetch returns more than requested number of rows ORA-06512

原创 Oracle 作者:shytodear 时间:2015-11-11 09:23:46 0 删除 编辑
1、环境
 Oracle 10.2.0.5 RAC,AIX系统

2、Oracle统计信息收集,报错:
SQL> BEGIN dbms_stats.gather_table_stats(ownname =>'A_DTB1',tabname =>'TS_ADT_01',degree=>16,cascade => true,estimate_percen
t=>dbms_stats.auto_sample_size); END;


*
ERROR at line 1:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "SYS.DBMS_STATS", line 15027
ORA-06512: at "SYS.DBMS_STATS", line 15049
ORA-06512: at line 1


3、解决办法
--加了GRANULARITY=>'ALL'
exec dbms_stats.gather_table_stats(ownname=>'A_DTB1', tabname=>'TS_ADT_01', degree=>16, cascade=>true, 
estimate_percent=>dbms_stats.auto_sample_size, GRANULARITY=>'ALL');

4、学习
GRANULARITY 参数只适用于分区表:

'ALL' - gathers all (subpartition, partition, and global) statistics
'AUTO'- determines the granularity based on the partitioning type. This is the default value.

'DEFAULT' - gathers global and partition-level statistics. This option is obsolete, and while currently supported, it is included in the documentation for legacy reasons only. You should use the 'GLOBAL AND PARTITION' for this functionality. Note that the default value is now 'AUTO'.
'GLOBAL' - gathers global statistics
'GLOBAL AND PARTITION' - gathers the global and partition level statistics. No subpartition level statistics are gathered even if it is a composite partitioned object.
'PARTITION '- gathers partition-level statistics
'SUBPARTITION' - gathers subpartition-level statistics.


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27126919/viewspace-1828145/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-11-05

  • 博文量
    66
  • 访问量
    238105