Oracle空表無法匯出的解決方法

2021-09-26 05:05:51 字數 539 閱讀 9435

由於oracle 11g的新特性,表資料如果為空,則延遲分配表空間,所以匯出的資料不全

1、-設定立刻分配表空間(設定後,後續新增的表即使沒有資料會自動建立表空間,不再延遲建立)

alter system set deferred_segment_creation=false;

2、--查詢當前使用者下的所有空表

select table_name from user_tables where num_rows=0; 

3、-- 根據上述查詢,可以構建針對空表分配空間的命令語句,再把下列查詢結果語句執行即可

select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0 or num_rows is null;

通過以上3步操作後便能正常匯出所有空表

4、--後續直接exp匯出資料即可

exp 使用者名稱/密碼@資料庫ip:1521/資料庫名  file=c:\sheyin.dump log=c:\sheyin.log

oracle 匯出空表

資料庫備份 空表不能匯出的問題處理 設定deferred segment creation 引數 設定deferred segment creation 引數為false來禁用 段推遲建立 也就是直接建立segment 無論是空表還是非空表,都分配segment。在sqlplus中,執行如下命令 s...

oracle11g無法匯出空表問題

產生原因 oracle11g為了節約空間,對空表不分配segment 解決方法 方法1.用如下語句設定空表可匯出 alter system set deferred segment creation false注意 該值設定後需重新啟動資料庫,讓引數生效。並且該值只對後面新增的表產生作用,對之前建立...

解決oracle中如何匯出空表的問題

匯出oracle的dmp檔案,再重新進行匯入時,會有很多警告 可能是沒有匯出空表,導致dmp檔案中缺失了一部分表結構,可能對已存在的表產生了影響 方法一在圖形工具中,如sqldeveloper,pl sqldeveloper執行 在當前使用者下 1 select alter table table ...