1、select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0
用該語句查詢數據庫的空表,同時生產分配空間的語句,把導出結果保存到文件中tsv格式的,樣例數據如下:
alter table TBL_PORTALWB_LINK allocate extent;
alter table TBL_VEHICLE_STORES_RELATION allocate extent;
alter table TBL_VEHICLE_STORES allocate extent;
alter table TBL_VEHICLE_PRIVATE_DETAIL allocate extent;
1.補充,若不行改用下面這個
select 'alter table '||table_name||' allocate extent(size 64k);'
from tabs t
where not exists (select segment_name from user_segments s where s.segment_name=t.table_name);
2、打開導出的文件,執行裏邊的sql;執行完後可對數據庫進行導出