我们知道数据库中的表分析后,查询USER_TABLES中的BLOCKS可以得到该表所占用的数据块的数量。那么,这个BLOCKS究竟是表中数据块的个数,还上表中所有块(数据块,位图块等)的个数呢?
[@more@]SQL> create table sunwg_test (id varchar2(10));
Table created.
SQL> analyze table sunwg_test compute statistics;
Table analyzed.
SQL> select NUM_ROWS,BLOCKS,EMPTY_BLOCKS from user_tables where table_name='SUNWG_TEST';
0 0 7
可以看出来此是表中没有数据,BLOCKS为0,说明这个BLOCKS是表中数据块的个数。从EMPTY_BLOCKS 等于7也可以说明表头占用了一个块。那么插入一条记录来做个测试就会更加的清晰了 。
SQL> insert into sunwg_test values('a');
1 row created.
SQL> commit;
Commit complete.
SQL> analyze table sunwg_test compute statistics;
Table analyzed.
SQL> select NUM_ROWS,BLOCKS,EMPTY_BLOCKS from user_tables where table_name='SUNWG_TEST';
1 1 6
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8394333/viewspace-995755/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8394333/viewspace-995755/