- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
3#
发表于 2013-8-13 20:32:10
见下面测试:
select banner from v$version where rownum=1;
SQL> create table maclean_shrink_test1 tablespace users as select rownum t1,'MACLEAN' t2 from dual connect by level<=900000;
表已创建。
SQL>
SQL> select max(t1) from maclean_shrink_test1;
MAX(T1)
----------
900000
SQL> select rowid,dbms_rowid.rowid_block_number(rowid),dbms_rowid.rowid_relative_fno(rowid) from maclean_shrink_test1 where t1=900000;
ROWID DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
------------------ ------------------------------------
DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID)
------------------------------------
AAAcg9AAGAABpzpACy 433385
6
SQL> select count(*) from dba_extents where segment_name='MACLEAN_SHRINK_TEST1';
COUNT(*)
----------
33
SQL> alter table maclean_shrink_test1 enable row movement;
表已更改。
SQL> delete maclean_shrink_test1 where t1<900000;
已删除 899999 行。
SQL> commit;
提交完成。
SQL> select rowid,dbms_rowid.rowid_block_number(rowid),dbms_rowid.rowid_relative_fno(rowid) from maclean_shrink_test1 where t1=900000;
ROWID DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
------------------ ------------------------------------
DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID)
------------------------------------
AAAcg9AAGAABpzpACy 433385
6
SQL> alter table maclean_shrink_test1 shrink space;
表已更改。
SQL> select rowid,dbms_rowid.rowid_block_number(rowid),dbms_rowid.rowid_relative_fno(rowid) from maclean_shrink_test1 where t1=900000;
ROWID DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
------------------ ------------------------------------
DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID)
------------------------------------
AAAcg9AAGAABoxbAAA 429147
6
|
|