SQL Performance (MOSC)

MOSC Banner

DBMS_STATS.gather_table_stats

edited Dec 21, 2018 10:57AM in SQL Performance (MOSC) 9 commentsAnswered

Hi,

We are building a gather stats job and want to know..

Does DBMS_STATS.GATHER_TABLE_STATS checks for stale statistics before it processes the table? or do we have to check for stale statistics and run the command on them?

If we need to manually check for stale stats, would this SQL be enough?

select owner, table_name from dba_tab_statistics where stale_stats='YES' or last_analyzed is null;

Thanks

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center