Example: Oracle Statistics Commands

Note: In the following examples, the schema owner name is 'MODELMART'

To collect statistics for the mart (does not include the index statistics):

    EXEC DBMS_STATS.gather_schema_stats ('MODELMART',DBMS_STATS.AUTO_SAMPLE_SIZE); 

To collect statistics for the mart (includes the index statistics):

    EXEC DBMS_STATS.gather_schema_stats (ownname => 'MODELMART', 
    cascade =>true, estimate_percent => dbms_stats.auto_sample_size); 

To delete the statistics:

    EXEC DBMS_STATS.delete_schema_stats ('MODELMART');