Home » SQL & PL/SQL » SQL & PL/SQL » Table statistics (11g)
Table statistics [message #618629] Mon, 14 July 2014 08:05 Go to next message
andrewscharles89
Messages: 25
Registered: July 2014
Junior Member
Is there any way that I could find how many tables has statistics on them,and how many tables which doesn't have statistics on them.

I want to ensure all tables in the database has stats on them.there are 2k tables should I check manually whether this table exists in dba_tab_stats_history view.


[EDITED by LF: fixed topic title typo]

[Updated on: Wed, 16 July 2014 14:27] by Moderator

Report message to a moderator

Re: table statstics [message #618631 is a reply to message #618629] Mon, 14 July 2014 08:13 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
query ALL_TABLES

It is trivial to differentiate between table which has statistics & table which has no statistics,
but how do you differentiate between table with goods, valid & current statistics & table with old, outdated, & incorrect statistics?

[Updated on: Mon, 14 July 2014 08:46]

Report message to a moderator

Re: table statstics [message #618900 is a reply to message #618631] Wed, 16 July 2014 06:28 Go to previous messageGo to next message
andrewscharles89
Messages: 25
Registered: July 2014
Junior Member
How about checking the global_stats column in dba_tables.if global_stats column set to NO(for non partitioned table) ,can we conclude the table has no statistics.
Re: table statstics [message #618901 is a reply to message #618900] Wed, 16 July 2014 06:33 Go to previous messageGo to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member
Last_analyzed should tell you about stats status.

You can check the explanation for all_tables view for more details.

http://docs.oracle.com/cd/B12037_01/server.101/b10755/statviews_1190.htm#i1592091

[Updated on: Wed, 16 July 2014 06:38]

Report message to a moderator

Re: table statstics [message #619184 is a reply to message #618901] Fri, 18 July 2014 14:15 Go to previous message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
you should gather statistics on all tables (except SYS) on a regular schedule. On most of our databases above 8i, we do it at 5am every morning.
Previous Topic: Searching a string and replacing with value
Next Topic: why use BETWEEN? BETWEEN vs. <= and >=
Goto Forum:
  


Current Time: Sat Apr 20 05:57:01 CDT 2024