Compilation of database objects is taking time during a patch application in online patching and dba_objects is not showing it.
In this case we need to query ad_objects to get the actual no. of invalids in EBS 12.2 in which a new patch edition is database is created during prepare phase of adop cycle.
While adop is compiling objects and taking time we can use following two queries to get the stub objects which are still need to be compiled.
select count(*)
from ad_objects
where status = ‘INVALID’;
select * from
(
select
eusr.user_name owner
, count(decode(obj.type#,88,NULL,decode(obj.status,1,NULL,1))) Actual
, count(decode(obj.type#,88,decode(obj.status,1,NULL,1),NULL)) Stub
, count(decode(obj.type#,88,decode(obj.status,1,NULL,1),decode(obj.status,1,NULL,1))) Total
from
sys.obj$ obj
, sys.obj$ bobj
, (
select
xusr.user#
, xusr.ext_username user_name
, ed.name edition_name
from
(select * from sys.user$ where type# = 2) xusr
, (select * from sys.obj$ where owner# = 0 and type# = 57) ed
where xusr.spare2 = ed.obj#
union
select
busr.user#
, busr.name user_name
, ed.name edition_name
from
(select * from sys.user$ where type# = 1 or user# = 1) busr
, (select * from sys.obj$ where owner# = 0 and type# = 57) ed
where ed.name = ‘ORA$BASE’
) eusr
where obj.owner# = eusr.user#
and bobj.obj#(+) = obj.dataobj#
and obj.type# not in (0, 10)
and ( obj.type# 88 or (obj.type# = 88 and bobj.type# 10) )
and obj.remoteowner is null
group by eusr.user_name
) x
where total > 0
order by 1;
However you may observe that compilation completes leaving many invalid objects in newly editioned database.
If the patch is completed then remaining invalid stub objects would be compiled when adop cutover phase is executed.