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!

Last date and time of rebuild and analyze

A. UyanikMar 29 2013 — edited Mar 29 2013
Dear all,

i was wondering if any of you got an script a newbie like me could use to see the last analyze/rebuild date
(ps: version = 11g2)

for the analyze i use the following at the moment:

=======================

set pages 200

col index_owner form a10
col table_owner form a10
col owner form a10

spool checkstat.lst

PROMPT Regular Tables

select owner,table_name,last_analyzed, global_stats
from dba_tables
where owner not in ('SYS','SYSTEM')
order by owner,table_name
/

PROMPT Partitioned Tables

select table_owner, table_name, partition_name, last_analyzed, global_stats
from dba_tab_partitions
where table_owner not in ('SYS','SYSTEM')
order by table_owner,table_name, partition_name
/

PROMPT Regular Indexes

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

PROMPT Partitioned Indexes

select index_owner, index_name, partition_name, last_analyzed, global_stats
from dba_ind_partitions
where index_owner not in ('SYS','SYSTEM')
order by index_owner, index_name, partition_name
/

spool off

=================

but i dont have any script to check the rebuild as of yet, so if anyone out there could help me i would be very thankfull,
Also an better version of the analyze script or adjustments are also welcome offcourse !

Thank all of you in advance

Edited by: 994141 on 29-mrt-2013 16:12
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 26 2013
Added on Mar 29 2013
2 comments
1,011 views