Rollback statistics
                                                 Last update (2014-05-05 23:02:13)
                                                                                                                   Date added (2013-12-20 06:01:03)

Summary
Usually the database keeps a history of the statistics for one table for 31 days.

The following sql will return the number of days statistics are currently retained for.
SELECT DBMS_STATS.GET_STATS_HISTORY_RETENTION FROM dual;
The following sql will show the dates statistics were regathered for a given table.
SELECT TABLE_NAME, STATS_UPDATE_TIME 
FROM dba_tab_stats_history
WHERE table_name LIKE 'OM_ORDER_HEADER%'
ORDER BY STATS_UPDATE_TIME DESC;
In case you want to rollback specific statistics in the past use the procedure.
BEGIN
DBMS_STATS.restore_table_stats('PROVISIONING6','OM_ORDER_HEADER', TO_DATE('18/12/2013','dd/mm/rrrr')); 
END;
/
Reviews
Categories
Filters
Search