现象:
Trying to drop tablespace but the command hangs every time, Applied patch 9841075 but the issue still occurring.
When get error stack dump it stopped in the below statement:
----- Current SQL Statement for this session (sql_id=cgcsnk9j6cuha) -----
select NULL from (select obj# objnum# from tab$ where ts#=:1 and bitand(property, 32) = 0 union all select bo# objnum# from tabpart$ where ts#=:1 union all select tcp.bo# objnum
# from tabcompart$ tcp,tabsubpart$ tsp where tsp.ts#=:1 and tsp.pobj#=tcp.obj# union all select t.obj# objnum# from tab$ t, ind$ i where i.ts#=:1 and i.type#=4 and i.bo#=t.obj# an
d bitand(t.property, 32) = 0 union all select t.obj# objnum# from indpart$ ip,ind$ i,tab$ t where ip.ts#=:1 and i.type#=4 and i.bo#=t.obj# and ip.bo#=i.obj# union all sele
ct t.obj# objnum# from indcompart$ icp,indsubpart$ isp,ind$ i,tab$ t where isp.ts#=:1 and isp.pobj#=icp.obj# and i.type#=4 and i.bo#=t.obj# and icp.bo#=i.obj# ) tin, cdef$ cdef where tin.o
bjnum# = cdef.robj# and cdef.obj# in (select obj# objnum# from tab$ where ts#<>:1 and bitand(property, 32) = 0 union all select distinct bo# objnum# from tabpart$ where ts#<>:1 un
ion all select distinct tcp.bo# objnum# from tabcompart$ tcp,tabsubpart$ tsp where tsp.ts#<>:1 and tsp.pobj#=tcp.obj# union all select t.obj# objnum# from tab$ t,ind$ i where i.ts#<>:1
and i.type#=4 and i.bo#=t.obj# and bitand(t.property, 32) = 0 union all select distinct t.obj# objnum# from indpart$ ip,ind$ i,tab$ t where ip.ts#<>:1 and i.type#=4 and
i.bo#=t.obj# and ip.bo#=i.obj# union all select distinct t.obj# objnum# from indcompart$ icp,indsubpart$ isp,ind$ i,tab$ t where isp.ts#<>:1 and isp.pobj#=icp.obj# and i.type
#=4 and i.bo#=t.obj# and icp.bo#=i.obj# )
原因:
Stale statistics for data dictionary and the fixed tables is the reason
处理方法:
Run the below to gather dictionary and fixed objects statistics:
SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS ('SYS');
SQL> EXEC DBMS_STATS.GATHER_DATABASE_STATS (gather_sys=>TRUE);
SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
SQL> EXEC DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
|