| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Analyzing partitioned tables
Here is what we use which also incorporates using our own definition
of STALE with monitoring on. It includes indexes as well as
partitioned and non-partitioned tables as well as non-monitored tables.
HTH
select 'analyze table ' || '${SCHEMA}.' ||
a.table_name ||
' compute statistics;' from
dba_tables a, all_tab_modifications
b where a.owner =
upper('${SCHEMA}')
and b.table_owner =
a.owner
and a.table_name =
b.table_name
and a.partitioned =
'NO' and
(a.num_rows is
null
((b.inserts+b.deletes+b.updates)*100)/ decode(a.num_rows,0,1,a.num_rows) >
${PERCENTAGE}
b.table_name and a.partition_name = b.partition_name and (a.num_rowsis
||
index_namefrom
dba_part_indexeswhere
owner=upper('${SCHEMA}')
and locality = 'LOCAL') and
b.table_name and a.partition_name = b.partition_name and (a.num_rowsis
Lists--------------------------------------------------------------------ToREMOVE yourself from this mailing list, send an E-Mail messageto: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and inthe message BODY, include a line containing: UNSUB ORACLE-L(or the name of mailing list you want to be removed from). You mayalso send the HELP command for other information (like subscribing). Received on Thu Jan 03 2002 - 09:29:32 CST
![]() |
![]() |