oracle导出表不全解决办法
- 原因
从dba_tables查询导不出的表,会发现他们不占用空间,SEGMENT_CREATED='NO' - 解决办法
查询出来这些表,执行
alert table xxx move;
即可; - 不过如果表里面有long,raw这类的字段,是无法move的,可以在cursor里面把这些表过滤掉。
declare
tbl varchar2(100);
s varchar2(1000);
cursor c is
select t.TABLE_NAME from dba_tables t where t.OWNER='OC' and t.SEGMENT_CREATED = 'NO' ;
begin
open c;
fetch c into tbl;
while(c%FOUND)loop
s := 'alter table ' || tbl || ' move ';
execute immediate s;
fetch c into tbl;
end loop;
close c;
end;