Question: I have a slow data dictionary query,
and I wonder if analyzing the data dictionary with dbms_stats
will help the SQL performance. How do I gather statistics on my
v$ views?
Answer:
Before tuning any v$ query, make sure that you have
gathered fixed statistics on the data dictionary. See these notes on details for analyzing the fixed Oracle tables;
Getting
statistics for the v$ views is easy, you can gather fixed
object statistics by using the dbms_stats gather_database_stats
procedure and setting the gather_fixed argument to TRUE
(the default is FALSE). You can also invoke the
gather_fixed_object_stats procedure:
DBMS_STATS.GATHER_FIXED_OBJECTS_STATS('ALL')