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 <
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 <

本文介绍了在使用Oracle数据库时遇到的错误ORA-01422(精确获取返回了超过请求的行数)和ORA-06512(在指定的行号上执行PL/SQL代码时出现错误)。通过分析错误原因,提供了解决这些问题的策略和预防措施。
3634

被折叠的 条评论
为什么被折叠?



