My Oracle Support Banner

Utl_recomp.Recomp_parallel Fails With Ora-20005 when SYS user stats is locked (Doc ID 846407.1)

Last updated on AUGUST 04, 2018

Applies to:

Oracle Server - Enterprise Edition - Version: to - Release: 10.2 to 11.1
Information in this document applies to any platform.


When statistics are locked with :

exec dbms_stats.lock_schema_stats('SYS')

before running

exec sys.utl_recomp.recomp_parallel

this package will fail with

ERROR at line 1:
ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: at "SYS.UTL_RECOMP", line 596
ORA-06512: at line 1

If the statistics are unlocked, then the procedure completes ok.

This can easily be reproduced using a simple script:

exec dbms_stats.lock_schema_stats('SYS')
exec sys.utl_recomp.recomp_parallel
exec dbms_stats.unlock_schema_stats('SYS')
exec sys.utl_recomp.recomp_parallel

This reproduces on and


exec dbms_stats.lock_schema_stats('SYS')


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.