正德厚生,臻于至善

ORA-20005: Object Statistics Are Locked (stattype = ALL) ORA-06512: At "APPS.FND_STATS"

set timing on;
exec fnd_stats.gather_schema_statistics ('GL',estimate_percent => dbms_stats.auto_sample_size,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('XLA,estimate_percent => dbms_stats.auto_sample_size',degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('AP',estimate_percent => dbms_stats.auto_sample_size,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('FA',estimate_percent => dbms_stats.auto_sample_size,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('AR',estimate_percent => dbms_stats.auto_sample_size,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('CE',estimate_percent => dbms_stats.auto_sample_size,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('PA',estimate_percent => dbms_stats.auto_sample_size,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('CUX',estimate_percent => dbms_stats.auto_sample_size,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('ALL',estimate_percent => dbms_stats.auto_sample_size,degree=>8,options=>'GATHER AUTO');

exec fnd_stats.gather_schema_statistics ('GL',estimate_percent => 100,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('XLA,estimate_percent => 100',degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('AP',estimate_percent => 100,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('FA',estimate_percent => 100,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('AR',estimate_percent => 100,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('CE',estimate_percent => 100,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('PA',estimate_percent => 100,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('CUX',estimate_percent => 100,degree=>8,options=>'GATHER AUTO');
exec fnd_stats.gather_schema_statistics ('ALL',estimate_percent => 100,degree=>8,options=>'GATHER AUTO');

11g建议使用DBMS_STATS.AUTO_SAMPLE_SIZE,维护窗口内,尽可能按照100%完成自动采样,若100%的方式不适合,则会at least采用30%的采样比例。并且强调了11g采用了HASH算法,计算统计信息,因此几乎在所有场景下,性能都不是问题。

1. 9i中ESTIMATE_PERCENT默认100%。
2. 10g中ESTIMATE_PERCENT默认为DBMS_STATS.AUTO_SAMPLE_SIZE,一个非常非常小的数,通常会造成poor的统计信息,因此并不建议使用AUTO。
3. 11g中ESTIMATE_PERCENT默认为DBMS_STATS.AUTO_SAMPLE_SIZE,但由于其采用了一种新的HASH算法,倾向于默认100%采样,其性能要比9i和10g中更优,因此一般情况下,建议使用DBMS_STATS.AUTO_SAMPLE_SIZE,由Oracle来自主选择采样比例。

GATHER AUTO重新分析当前没有统计的对象,以及统计数据过期(变脏)的对象。注意,使用GATHER AUTO类似于组合使用GATHER STALE和GATHER EMPTY。 注意,无论GATHER STALE还是GATHER AUTO,都要求进行监视。如果执行一个alter table xxx monitoring命令,Oracle会用dba_tab_modifications视图来跟踪发生变动的表。这样一来,就确切地知道,自从上一次分析统计数据以来,发生了多少次插入、更新和删除操作。

ORA-20005 WHEN GATHERING STATISTICS FOR EBS <APPS> schema 11i or R12 IN Database 10G or 11G (Doc ID 375351.1)
ORA-20005: Object Statistics Are Locked (stattype = ALL) ORA-06512: At "APPS.FND_STATS" (Doc ID 2431009.1)

set lines 200 pages 5000
col owner for a15
col table_name for a45
select owner, table_name, stattype_locked from dba_tab_statistics where stattype_locked is not null; 

select owner, table_name, stattype_locked from dba_tab_statistics where owner = 'APPLSYS' and stattype_locked is not null;

--SQL> exec dbms_stats.unlock_schema_stats ('AR');
--SQL> exec dbms_stats.unlock_table_stats('AR', 'AR_REV_REC_QT'); 

exec dbms_stats.unlock_table_stats('APPLSYS','AQ$_WF_CONTROL_P');
exec dbms_stats.unlock_table_stats('APPLSYS','FND_CP_GSM_IPC_AQTBL');
exec dbms_stats.unlock_table_stats('APPLSYS','FND_SOA_JMS_IN');
exec dbms_stats.unlock_table_stats('APPLSYS','FND_SOA_JMS_OUT');
exec dbms_stats.unlock_table_stats('ASO','ASO_ORDER_FEEDBACK_T');
exec dbms_stats.unlock_table_stats('OKC','OKC_AQ_EV_TAB');
exec dbms_stats.unlock_table_stats('WMS','WMS_WCS_AQ_QUEUE_TBL');
exec dbms_stats.unlock_table_stats('ODM','DMS_QUEUE_TABLE');

https://blog.csdn.net/bisal/article/details/74931933
https://blog.csdn.net/viviliving/article/details/103739400
赞(0) 打赏
未经允许不得转载:徐万新之路 » ORA-20005: Object Statistics Are Locked (stattype = ALL) ORA-06512: At "APPS.FND_STATS"

评论 抢沙发

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫

微信扫一扫

登录

找回密码

注册