Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tables Stats not updating

Status
Not open for further replies.

sa0309

Programmer
Apr 5, 2010
45
0
0
US
I have an Oracle 11g table that I'm attempting to gather stats on.

Thru SQL Developer I exec the following:

EXEC DBMS_STATS.gather_table_stats('OWNER', 'TABLENAME');

However when I go to Statistics tab in SQL Developer; I can see the stats are not updating.

Any thoughts as to why/how this may be occurring would be appreciated.

Thank you.

 
Are you doing this via right-click on tablename -> Statistics-> Gather statistics or via SQL worksheet?

Can you provide a screenshot of what you are actually running/typing in to sqldeveloper.

In order to understand recursion, you must first understand recursion.
 
I've tried multiple ways.

As mentioned above:

From SQL Worksheet - EXEC DBMS_STATS.gather_table_stats('OWNER', 'TABLENAME');
From SQL Worksheet - ANALYZE table HART_MO_ETL.CUST_RMA_DENIAL_MANAGEMENT COMPUTE STATISTICS;

also

via right-click on tablename -> Statistics-> Gather statistics
 
What outputs do you get from your commands

a) EXEC DBMS_STATS.gather_table_stats ...
and
b) ANALYZE table ... ;


In order to understand recursion, you must first understand recursion.
 
Are you running the stats package from a user that has the rights to insert the stats for that table?

Bill
Lead Application Developer
New York State, USA
 
Hi

Please check the below SQL query

SELECT TABLE_NAME,LAST_ANALYZED,NUM_ROWS
FROM ALL_TABLES
WHERE OWNER_NAME=<OWNER_NAME>
AND TABLE_NAME=<TABLE_NAME>

If the LAST_ANALYZED shows today's date and

SELECT COUNT(*) FROM OWNER_NAME.TABLE_NAME IN question matches with NUM_ROWS then your statistics is uptpdate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top