analyze the work of the table but dbms_stats does not work

Hi all

I have a very simple question, although analyze command became obsolete for many years, when I use analyze, command, I get the result of empty_blocks (user_tables) but when I use the dbms_stat package I get nothing.

SQL > select * from v version $;

BANNER
----------------------------------------------------------------
Oracle Database 10 g Express Edition Release 10.2.0.1.0 - product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
AMT for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

SQL > create table deneme2 in select * from object;

table created


SQL > exec dbms_stats.gather_table_stats (USER, 'DENEME2');

PL/SQL procedure successfully completed.

SQL > select blocks, empty_blocks from user_tables where table_name = 'DENEME2;

BLOCKS EMPTY_BLOCKS
---------- ------------
13            0

SQL > analyze table deneme2 calculating statistics;

Parsed table.

SQL > select blocks, empty_blocks from user_tables where table_name = 'DENEME2;

BLOCKS EMPTY_BLOCKS
---------- ------------
13            3

Which is wrong with dbms_stats? I missed somewhere? Does anyone have any idea who why dbms_stat can't work?

Thanks in advance.

Hello

That's what said ORACLE. See the link below:

http://docs.Oracle.com/CD/B28359_01/server.111/b28310/general002.htm

«Oracle is recommended to use the most versatile DBMS_STATS package for gathering statistics for the optimizer, but you must use the ANALYZE instruction to collect statistics that are not related to the optimizer, such as empty blocks, spatial average and so on.»

Tags: Database

Similar Questions

Maybe you are looking for