web analytics

Table statistics Oracle SQL query

To see statistics of a table in Oracle create any table and insert data, search the table in that view:

 select * from all_tables where TABLE_NAME = ‘TABLE’; 

You will see how this view has not been updated, then run the statistics for the created table: 

DBMS_STATS.GATHER_TABLE_STATS (ownname => ‘OWNER’, tabname => ‘TABLE’);

In the case of wanting to take the statistics at partition level: 

DBMS_STATS.GATHER_TABLE_STATS (ownname => ‘OWNER’, tabname => ‘TABLE’, partname => ‘NAME_PARTITION’, estimate_percent => null, granularity => ‘PARTITION’, cascade => TRUE);

You may also like...

error: Content is protected !!