Oracle Gather stats on database level
Gather stats in Database level:- EXEC DBMS_STATS.GATHER_DATABASE_STATS( ESTIMATE_PERCENT=>100,METHOD_OPT=>'FOR ALL COLUMNS SIZE SKEWONLY', CASCADE => TRUE, degree => 4, OPTIONS => 'GATHER STALE', GATHER_SYS => TRUE, STATTAB => PROD_STATS); ======================================================================= CASCADE => TRUE :Gather statistics on the indexes as well. If not used Oracle will decide whether to collect index statistics or not. DEGREE => 4 :Degree of parallelism. OPTIONS : =>’GATHER’ :Gathers statistics on all objects in the schema. =>’GATHER AUTO’ :Oracle determines which objects need new statistics, and determines how to gather those statistics. =>’GATHER STALE’:Gathers statistics on stale objects. will return a list of stale objects. =>’GATHER EMPTY’:Gathers statistics on objects have no statistics.will return a list of no stats objects.