1.table
匯出:
expdp userid=用戶名/密碼@服務器名:DB服務器埠/資料庫名 tables=表名 directory=匯出檔案路徑 dump file=匯出檔案名 logfile=log檔案名
如果想匯出全部的表,表名用%代替。
匯入:
impdp userid=用戶名/密碼@服務器名:DB服務器埠/資料庫名 directory=需要匯入的檔案路徑 dump file=需要匯入的檔案名 logfile=log檔案名 remap_schema="變更元schema:變更先schema" tables=變更元schema的表名 table_exist_action=replace
table_exist_action:匯入前想洗掉資料用匯入前想洗掉資料用truncate,表結構也想重做用replace。
content:只登錄資料時用。content=DATA_ONLY
2.view
匯出:
expdp userid=用戶名/密碼@服務器名:DB服務器埠/資料庫名 directory=匯出檔案路徑 dump file=匯出檔案名 logfile=log檔案名 include=view:\"in('view表1名','view表2名')\"
如果全部的如果全部的view匯出,可換成include=view
匯入:
匯入view之前,要先洗掉該view。
drop view view名;
impdp userid=用戶名/密碼@服務器名:DB服務器埠/資料庫名 directory=需要匯入的檔案路徑 dump file=需要匯入的檔案名 logfile=log檔案名 remap_schema="變更元schema:變更先schema"
3.materialized view
匯出:
expdp userid=用戶名/密碼@服務器名:DB服務器埠/資料庫名 directory=匯出檔案路徑 dump file=匯出檔案名 logfile=log檔案名 include=materialized_view:\"in('mview表1名','mview表2名')\" include=table:\"in('mview表1名','mview表2名')\"
匯入:
匯入mview之前,要先洗掉該mview和table。
drop materialized view mview名;
drop table mview名;
impdp userid=用戶名/密碼@服務器名:DB服務器埠/資料庫名 directory=需要匯入的檔案路徑 dump file=需要匯入的檔案名 logfile=log檔案名 remap_schema="變更元schema:變更先schema"
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/46510.html
標籤:基礎和管理
上一篇:plsql查詢陳述句條數太多報錯ora-03113,求解決!
下一篇:手工建庫執行腳本
