Utl_recomp.Recomp_parallel Fails With Ora-20005 when SYS user stats is locked

(Doc ID 846407.1)

Last updated on MAY 08, 2018

Applies to:

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

Symptoms

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 10.2.0.4 and 11.1.0.7


Changes

exec dbms_stats.lock_schema_stats('SYS')

Cause

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 hundreds of Community platforms