Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How and when the table will go STALE ?

rahulrasJan 18 2008 — edited Jun 2 2009
Hi,

I want to check how and when a table will be marked as STALE.

I have done following steps

---- Created a table --------------------

SQL> create table t1 (id number, name varchar2(100)) ;

Table created.

---- Inserted decent amount of data --------------

SQL> declare v1 number; begin for i in 1..25 loop
2 insert into t1 select object_id, object_name from all_objects ; commit; end loop;
3 end;
4 /

PL/SQL procedure successfully completed.

SQL> select table_name, status, num_rows, last_analyzed, monitoring from user_tables where table_name='T1';

TABLE_NAME STATUS NUM_ROWS LAST_ANAL MON
------------------------------ -------- ---------- --------- ---
T1 VALID YES

---- Gather stats -----------------

SQL> exec dbms_stats.gather_table_stats( user, 'T1', METHOD_OPT => 'FOR ALL COLUMNS SIZE 1');

PL/SQL procedure successfully completed.

SQL> select table_name, status, num_rows, last_analyzed, monitoring from user_tables where table_name='T1';

TABLE_NAME STATUS NUM_ROWS LAST_ANAL MON
------------------------------ -------- ---------- --------- ---
T1 VALID 115544 18-JAN-08 YES

---- Insert more data ---------------------------
SQL> declare v1 number; begin for i in 1..25 loop
2 insert into t1 select object_id, object_name from all_objects ; commit; end loop;
3 end;
4 /

PL/SQL procedure successfully completed.


Now, after I have analyzed the table and get the stats in, I loaded good amount of data. So, in theory, this table should be marked as STALE.

Where can I check if this table has been marked STALE? when ?

Please guide.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 30 2009
Added on Jan 18 2008
13 comments
20,074 views