Database Reference
In-Depth Information
15:32:07 SQL> select stats_update_time from user_tab_stats_history where table_name='T1' order
by 1 desc;
STATS_UPDATE_TIME
---------------------------------------------------------------------------
08-JUN-13 03.31.57.612000 PM +02:00
08-JUN-13 03.31.47.379000 PM +02:00
08-JUN-13 03.31.06.850000 PM +02:00
15:32:07 SQL> select stats_update_time stats_update_time from (select stats_update_time,
rownum rr from user_tab_stats_history where table_name='T1' order by 1 desc) where rr = 3;
STATS_UPDATE_TIME
---------------------------------------------------------------------------
08-JUN-13 03.31.57.612000 PM +02:00
15:32:07 SQL> exec dbms_stats.restore_table_stats(user, 'T1', '&stats_update_time')
PL/SQL procedure successfully completed.
15:32:08 SQL>
15:32:08 SQL> select last_analyzed from user_tables where table_name='T1';
LAST_ANALYZED
-------------------
08.06.2013 15:31:57
15:32:08 SQL> select index_name,last_analyzed from user_indexes where table_name='T1';
INDEX_NAME LAST_ANALYZED
------------------------------ -------------------
I1_T1 08.06.2013 15:31:47
I2_T1 08.06.2013 15:31:47
15:32:08 SQL> select stats_update_time stats_update_time from (select stats_update_time,
rownum rr from user_tab_stats_history where table_name='T1' order by 1 desc) where rr = 2;
STATS_UPDATE_TIME
---------------------------------------------------------------------------
08-JUN-13 03.31.47.379000 PM +02:00
15:32:08 SQL> exec dbms_stats.restore_table_stats(user, 'T1', '&stats_update_time')
PL/SQL procedure successfully completed.
15:32:08 SQL> select last_analyzed from user_tables where table_name='T1';
LAST_ANALYZED
-------------------
08.06.2013 15:31:47
15:32:08 SQL> select index_name,last_analyzed from user_indexes where table_name='T1';
INDEX_NAME LAST_ANALYZED
------------------------------ -------------------
I1_T1 08.06.2013 15:31:27
I2_T1 08.06.2013 15:31:37
15:32:08 SQL>
15:32:08 SQL> select stats_update_time stats_update_time from (select stats_update_time,
rownum rr from user_tab_stats_history where table_name='T1' order by 1 desc) where rr = 1;
STATS_UPDATE_TIME
---------------------------------------------------------------------------
08-JUN-13 03.31.06.850000 PM +02:00
15:32:08 SQL> exec dbms_stats.restore_table_stats(user, 'T1', '&stats_update_time')
PL/SQL procedure successfully completed.
15:32:08 SQL> select last_analyzed from user_tables where table_name='T1';
LAST_ANALYZED
-------------------
08.06.2013 15:31:06
15:32:08 SQL> select index_name,last_analyzed from user_indexes where table_name='T1';
INDEX_NAME LAST_ANALYZED
------------------------------ -------------------
I1_T1 08.06.2013 15:31:06
I2_T1 08.06.2013 15:31:06
Search WWH ::




Custom Search