如何解決Oracle11g使用dmp命令無法導出空表問題
導出:exp username/password@orcl file=路徑 tables=(tb1) //tables=(tb1)可有可無,方便導出指定表
導入:imp username/password@orcl file=路徑 tables=(tb1) full=y
在用plsql導出dmp的時候,沒有數據的表顯示沒有導出成功
解決
1執行 alter system set deferred_segment_creation=false;
2 查詢一下當前用戶下的所有空表
select table_name from user_tables where NUM_ROWS=0;
3 然后用以下SQL語句組裝得到查詢結果
select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0
3 把上一步得到的查詢結果,一一執行
注意喔:一一執行
重新exp命令就能成功導出空表了