1. 程式人生 > >oracle匯出含有空表匯入失敗處理

oracle匯出含有空表匯入失敗處理

批量處理空表

1、首先使用下面的sql語句查詢一下當前使用者下的所有空表
select table_name from user_tables where NUM_ROWS=0;

2、然後用一下SQL語句執行查詢
select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0

3、假設我們這裡有空表TBL_1,TBL_2,TBL_3,TBL_4,則查詢結果如下:

alter table TBL_1 allocate extent;
alter table TBL_2 allocate extent;
alter table TBL_3 allocate extent;
alter table TBL_4 allocate extent;
最後我們把上面的SQL語句執行就可以了。