Peng Blog
自我介绍
切换风格
订阅我的Blog
博客日历
文章归档...
最新发表...
博客统计...
网站链接...
资源
===========================================================
为什么shrink后,这234条记录无法存放?
===========================================================
为什么shrink后,这234条记录无法存放?


sys@PENG>create tablespace ts_row datafile 'C:ORACLEPRODUCT10.2.0ORADATAORC
LTS_ROW.DBF' size 1m reuse;

表空间已创建。

sys@PENG>select tablespace_name,block_size,extent_management,SEGMENT_SPACE_MANAG
EMENT from dba_tablespaces;

TABLESPACE_NAME BLOCK_SIZE EXTENT_MAN SEGMEN
------------------------------ ---------- ---------- ------
SYSTEM 8192 LOCAL MANUAL
UNDOTBS1 8192 LOCAL MANUAL
SYSAUX 8192 LOCAL AUTO
TEMP 8192 LOCAL MANUAL
USERS 8192 LOCAL AUTO
EXAMPLE 8192 LOCAL AUTO
PERFSTAT 8192 LOCAL AUTO
TS_ROW 8192 LOCAL AUTO

已选择8行。


sys@PENG>conn scott/tiger@orcl36
已连接。

scott@PENG>create table test_rowid tablespace ts_row as select '1' as a,'2' as b,'3' as c, owner as
2 d from all_objects where 1=2;

表已创建。

scott@PENG>begin
2 for x in (select '1' as a,'2' as b,'3' as c ,owner as d from all_objects)
3 loop
4 insert into test_rowid values(x.a,x.b,x.c,x.d);
5 insert into test_rowid values(x.a,x.b,x.c,x.d);
6 commit;
7 end loop;
8 end;
9 /
begin
*
第 1 行出现错误:
ORA-01653: 表 SCOTT.TEST_ROWID 无法通过 8 (在表空间 TS_ROW 中) 扩展
ORA-06512: 在 line 4

scott@PENG>select count(*) from test_rowid;

COUNT(*)
----------
48284

scott@PENG>select count(*) ,d from test_rowid group by d;

COUNT(*) D
---------- ------------------------------
24610 PUBLIC
12 SYSTEM
23462 SYS
200 WMSYS

scott@PENG>delete from test_rowid where d = 'SYS';

已删除23462行。

scott@PENG>commit;

提交完成。

scott@PENG>alter table test_rowid enable row movement;

表已更改。

scott@PENG>alter table test_rowid shrink space;

表已更改。

scott@PENG>begin
2 for x in (select '1' as a,'2' as b,'3' as c ,owner as d from all_objects)
3 loop
4 insert into test_rowid values(x.a,x.b,x.c,x.d);
5 insert into test_rowid values(x.a,x.b,x.c,x.d);
6 commit;
7 end loop;
8 end;
9 /
begin
*
第 1 行出现错误:
ORA-01653: 表 SCOTT.TEST_ROWID 无法通过 8 (在表空间 TS_ROW 中) 扩展
ORA-06512: 在 line 5

scott@PENG>select count(*) from test_rowid;

COUNT(*)
----------
48050


有个问题:为什么shrink后,这234条记录无法存放?
48284 - 48050 = 234



.
luckysea 发表于:2007.07.27 09:09 ::分类: ( ORACLE ) ::阅读:(140次) :: 评论 (0) :: 引用 (0)

发表评论
标题

在此添加评论

称呼

邮箱地址(可选)

个人主页(可选)