DBMS_STATS Save Statistics before Gather |
set timing on -- Create the table to save the stats begin dbms_stats.create_stat_table( ownname => 'DBSTAR', stattab => 'save_dbms_stats' --, tblspace => 'USERS' ); end; / -- Save stats and Gather begin DBMS_STATS.GATHER_SCHEMA_STATS(OWNNAME => 'DBSTAR', ESTIMATE_PERCENT => 100, METHOD_OPT => 'FOR ALL COLUMNS SIZE 1', GRANULARITY => 'ALL', CASCADE => TRUE, OPTIONS => 'GATHER', DEGREE => DBMS_STATS.AUTO_DEGREE, stattab => 'save_dbms_stats', statid =>'stats20150205', statown =>'DBSTAR'); end; / |