question

Savinda1995 avatar image
Savinda1995 asked

I need to know the query statement for this

Display INDEX_NAME, LAST_ANALYZED and DAYS_AGO by having the difference between the last analyzed date and the current date from the all_indexes view.


sql2000
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

anthony.green avatar image
anthony.green answered

ALL_INDEXES is an Oracle, thing, you would just get the information you need by selecting the right pieces from the view along with using date math (lookup DATEDIFF) for this.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

harbingergroup avatar image
harbingergroup answered

select owner, index_name, last_analyzed, global_stats
from dba_indexes
where owner not in (‘SYS’,’SYSTEM’)
order by owner, index_name

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.