cancel
Showing results for 
Search instead for 
Did you mean: 

Find Last update statistics run

Former Member
0 Kudos
3,226

Hi,

How do I check when was the last update statistics run for a table/index.

Thanks in advance,

Hussain.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mudasir

I use table T000 as an example. You can do it from sqlplus:

SQL> select table_name, last_analyzed from dba_tables where table_name = 'T000';

TABLE_NAME                     LAST_ANALYZED
------------------------------ ---------------
T000                           08-JUL-07

Index is the same, just query dba_indexes.

Alternatively you can do it from SAP in various ways, i always do this:

ST05 -> Enter SQL Statement: select * from t000 -> Explain -> Click on table t000

There you see: Last statistics date 08.07.2007

This does not execute the SQL, it just generates a plan. Be aware that statistics do not need to be actual. <b>There is no such thing like old statistics</b>. As long as the stats are correct, there is no need to recollect them.

Best regards

Michael

Former Member
0 Kudos

Hi,

Thanks for your replies. But I dont have os/db access for the system. Is there any way to find out from the application level.

Regards,

Hussain.

Former Member
0 Kudos

Hi again

As i said use transaction ST05, just check the text above. You can check the logs from statistics runs in DB13 or DB14 -> BRCONNECT.

Regards

Michael

Former Member
0 Kudos

Hi,

Thanks mho for your prompt response. I think this answers my question.

Regards,

Hussain

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

In DB02 -> Detailed analysis -> table name -> Detailed analysis. We can check the 'Last table analyzed' date. I guess, this is the Last update statistics date for the table.

Regards,

Hussain.

Former Member
0 Kudos

SAP recommends to have statistics run daily in db13, just go there and see if you can find the table in question in the logs for the update statistics job

Alternatively, go to /oracle/SID/sapcheck directory and ls -lrt *.sta files. ( I think that the logs for the stats end in .sta, correct me if I am wrong)

then execute

grep <table_name> *.sta and you will see whichlog files contain that table. It is then easy to find which is the most recent

I hope this helps

Andreas