用exp命令不能匯出Oracle 11g空表的解決方案

來源:互聯網
上載者:User

最近用Oracle 11g的exp命令備份資料庫,然後恢複,發現匯出前表中還從沒插入過資料的表並沒有匯出。以前用9i、10g的時候都沒發現過類似問題,著實被坑了一把,google一查發現11g中有個新特性,當表無資料時,不分配segment以節省空間的。為了使空表也能匯出需要如下處理:

1) 用以下這句尋找空表

select 'alter table '||table_name||' allocate extent;' from user_tables where segment_created='NO';

把查詢結果匯出,執行匯出的語句

2) 然後再使用exp命令匯出資料庫即可

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.