ITPub博客

首页 > 数据库 > Oracle > 关于USER_TABLES中的BLOCKS

关于USER_TABLES中的BLOCKS

原创 Oracle 作者:sunwgneuqsoft 时间:2007-12-25 16:37:16 0 删除 编辑

我们知道数据库中的表分析后,查询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博客 ” ,链接:https://blog.itpub.net/8394333/viewspace-995755/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 学习oracle的度
请登录后发表评论 登录
全部评论
  • 博文量
    56
  • 访问量
    777633