Q1. Can we get old statistics restored for an object for example for a index or a table ?
Yes we can get the old statistics restored from Oracle version 10g onwards.However, if you use ANALYZE for statistics collection in 10g, automatic saving is not possible.
Q2. If so, where do the statistics history stored in and what is the retention?
DBA_OPTSTAT_OPERATIONS contain history of statistics operations performed.The retention period default value is 31 days.You would be able to restore the optimizer statistics to any time in last 31 days.
Select * from dba_optstat_operations where target like ‘%’;
DBA_TAB_STATS_HISTORY view contain a history of table statistics modifications.
Q3. Is it possible to restore a index statistics and where can I find the information?
RESTORE_TABLE_STATS procedure restores the statistics of a table along with this it also restores the index statistics associated with the table.However, the index statistics is not restored in case index is rebuild just before issuing restore_table_stats in 10g.This bug 5519322 is fixed in 11g release 2.Instead we can use DBMS_STATS.EXPORT_*_STATS and DBMS_STATS.IMPORT_*_STATS procedures, but before this we need to create a table to hold this statistics "DBMS_STATS.CREATE_STAT_TABLE".
-Thanks
Follow Me!!!