[英]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.