Select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0 or num_rows is null
然后执行查询语句 再导出数据
一个语句搞定:
declare stmt varchar2(200);
begin
for tb in (select table_name from user_tables where segment_created = 'NO') loop
stmt := 'alter table ' || tb.table_name || ' allocate extent';
begin
execute immediate stmt;
exception
when others then
dbms_output.put_line(stmt);
end;
end loop;
end;