解決Oracle11g空表無法匯出的問題,oracle11g空表匯出

來源:互聯網
上載者:User

解決Oracle11g空表無法匯出的問題,oracle11g空表匯出

Oracle11g 新增參數deferred_segment_creation  ,建庫的時候預設值為true,意思是延時載入,當表中不存在資料的時候,不為這個表建立空間,當你匯出的時候會發現很多表不存在


使用show parameter deferred deferred_segment_creation; 命令可以查看deferred_segment_creation的值,如果想讓空表匯出

方法一:像庫表中插入值

方法二:1、執行sql修改deferred_segment_creation的值 :alter system set deferred_segment_creation=false;

                  2、執行sql:    select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0;

                                               用pl/sql將結果 ——右鍵  —— 複製到Excel...   將結果複製到sql視窗中運行  然後就可以匯出了

 


oracle11g執行了網上所說的那些步驟之後,為何空表還是不匯出?球解

建議你用expdp匯出吧 別用oracle 11G 對於空表預設是不分配段的,所以用exp匯出的時候就沒有匯出。用法參照help,網上一大把命令。

使用expdp要先在資料庫中建立directory,並給相應的使用者read,write許可權.
SQL>create directory dmpdir as '/u01/dmdir';
SQL>grant read,write on directory to system;
expdp system/pw schemas=test directory=dmpdir dumpfile=test_1.dmp,test-2t.dmp logfile=exp-2012-11-testt.log exclude=STATISTICS parallel=2
可以並行匯出
 
oracle11g匯出資料庫時怎設定把空表也匯出

1 將資料庫TEST完全匯出,使用者名稱system 密碼manager 匯出到D:\daochu.dmp中
exp system/manager@TEST file=d:\daochu.dmp full=y
2 將資料庫中system使用者與sys使用者的表匯出
exp system/manager@TEST file=d:\daochu.dmp owner=(system,sys)
 

相關文章

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.