简体   繁体   English

Oracle 19C dbms_stats.gather_table_stats 缓慢并返回无效标识符错误

[英]Oracle 19C dbms_stats.gather_table_stats Slowness and return invalid identifier error

I'm are using Oracle 19C db and used to gather table stats.我正在使用 Oracle 19C db 并用于收集表统计信息。 dbms_stats.gather_table_stats(ownname =>'xx', tabname =>'yyy', cascade=>true, no_invalidate=>false); dbms_stats.gather_table_stats(ownname =>'xx', tabname =>'yyy', cascade=>true, no_invalidate=>false);

it is too slow and some tables return following error as well.它太慢了,一些表也返回以下错误。

ORA-00904 : invalid identifier. ORA-00904: 无效的标识符。

Can assist find solution for this ?可以帮助找到解决方案吗? Row count around 80Millions行数约为 8000 万

Can you try this script.你可以试试这个脚本。 With my 19c Db it requires 50s for a table of 140milions rows and 30columns:使用我的 19c Db,1.4 亿行和 30 列的表需要 50 秒:

DBMS_STATS.GATHER_TABLE_STATS (
   ownname=> 'xx',
   tabname=> 'yyy',
   estimate_percent=> DBMS_STATS.AUTO_SAMPLE_SIZE,
   block_sample=> FALSE,
   method_opt=> 'FOR ALL COLUMNS SIZE AUTO',
   degree=> DBMS_STATS.DEFAULT_DEGREE,
   granularity=> 'ALL',
   cascade=> DBMS_STATS.AUTO_CASCADE,
   no_invalidate=> DBMS_STATS.AUTO_INVALIDATE
   );

If it takes more time then you need verify indexes, triggers and constraints on your table.如果需要更多时间,那么您需要验证表上的索引、触发器和约束。

Thank you.谢谢你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 DBMS_STATS.GATHER_TABLE_STATS如何在Oracle中工作 - How DBMS_STATS.GATHER_TABLE_STATS works in oracle Postgresql与Oracle中的dbms_stats.gather_table_stats等效什么? - what is equivalent of Postgresql to dbms_stats.gather_table_stats in Oracle? 有关dbms_stats.gather_table_stats的问题 - Question regarding dbms_stats.gather_table_stats 在Oracle过程中交换分区后的Dbms_Stats.Gather_Table_Stats吗? - Dbms_Stats.Gather_Table_Stats after partition exchange in Oracle procedure? LAST_ANALYZE null 在 dbms_stats.gather_table_stats 之后 - LAST_ANALYZE null after dbms_stats.gather_table_stats 为什么在 SSB 模式中的表上运行 dbms_stats.gather_table_stats 时会出现 ORA-20000? - Why do I get ORA-20000 when I run dbms_stats.gather_table_stats on a table in SSB Schema? 如何解决存储过程在通过 EXECUTE IMMEDIATE 作为字符串执行时不执行 dbms_stats.gather_table_stats() 的问题 - How to resolve issue of stored proc not executing dbms_stats.gather_table_stats() when executing as it string via EXECUTE IMMEDIATE Oracle PLSQL,在 DBMS_STATS.GATHER_SCHEMA_STATS 中选择 - Oracle PLSQL, select in DBMS_STATS.GATHER_SCHEMA_STATS 使用dbms_stats.gather_schema_stats [oracle] - Using dbms_stats.gather_schema_stats [oracle] Oracle 19C - 尝试在 DBMS_LOCK 上授予执行权限时出错 - Oracle 19C - Error trying to grant execute on DBMS_LOCK
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM