您的位置:首页 > Web前端

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

2015-11-11 09:23 357 查看
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博客 ” ,链接:http://blog.itpub.net/27126919/viewspace-1828145/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/27126919/viewspace-1828145/

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: