[重庆思庄每日技术分享]-ORA-01760 当表中出现物化视图时,收集索引统计信息失败

来源:这里教程网 时间:2026-03-03 17:32:39 作者:

日志文件中出现ORA-01760报错(参考官方文档 ID317254.1)

现象:

Collecting

Index stats using dbms_stats.gather_index_stats might fail with

ORA-1760 when a materialized view is present on the base table.

The error can also happen when we use cascade=> TRUE option with either gather_schema_stats ot gather_table_stats.

当表中出现有物化视图时,使用dbms_stats.gather_index_stats收集索引统计信息可能会以报ORA-01760失败

当使用gather_schema_stats ot gather_table_stats,并且cascade=> TRUE选项开启时,也会发生这个错误

导致的原因是出现了查询重写,解决方法则是禁用查询重写

- alter session set query_rewrite_enabled=false;

- run your dbms_stats command

相关推荐