Oracle PLSQL 匯出資料table xx contains one or more CLOB columns 解決方案

來源:互聯網
上載者:User

Oracle PLSQL 匯出資料table xx contains one or more CLOB columns 解決方案

Oracle匯出資料時出現Table xx contains one or more CLOB columns錯誤,這個是說表裡面有多個clob類型,不能匯出

PLSQL匯出方式有三種,第一種匯出.dmp檔案,它是二進位檔案,通用性比較好,可以跨平台使用。第二種匯出.sql檔案,它的好處在於可以看見sql語句,適合資料量小的情況,而且不能有大欄位內容(blob、clob、long)。第三種匯出.pde檔案,它是plsql特殊格式,只有plsql認識它,其它編譯器不認識。

遇到上面這個問題可以使用第一種匯出方式匯出內容。

 

匯入的時候可能會遇到外鍵衝突,這時我們需要先屏蔽掉外鍵約束,然後匯入,然後在開啟外鍵約束。

屏蔽外鍵的sql:

select 'alter table ' || table_name || ' disable constraint ' || constraint_name || ';' from user_constraints where constraint_type = 'R'

恢複外鍵約束的sql:

select 'alter table ' || table_name || ' enable constraint ' || constraint_name || ';' from user_constraints where constraint_type = 'R'

上面的指令碼只是拼接出對應的表的外鍵操作,將查詢出的結果運行一下就可以了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.