排除表和query查詢條件的expdp impdp

2021-08-17 13:41:08 字數 2399 閱讀 2498

排除某些表的expdp/impdp

expdp system/123456 directory=data_pump_dir dumpfile=wf.dmp logfile=wf.log schemas=winwf exclude=table:\"in\(\'table_name1\'\)\"

expdp system/123456 directory=data_pump_dir dumpfile=wf.dmp logfile=wf.log schemas=winwf exclude=table:\"in\(\'table_name1\',\'table_name2\',\'table_name3\'\)\"

例子expdp使用者dh,使用者沒有expdp許可權,tablespace為dh,但是排除ierp_wo_sn_material_info等5張表,知道dh使用者密碼,不知道system的密碼,只能使用as system來替代

expdp \"db/dahai_2013 as sysdba\" schemas=dh directory=dumpdir dumpfile=2015dh.dmp exclude=table:\"in\(\'ierp_wo_sn_material_info\',\'ierp_wo_sn_user\',\'wip_sn_collection_info\',\'ierp_error_tracking_info\',\'common_mail_notice\'\)\"

impdp到schema為dahai_demo,tablespace為dahaidata_demo的使用者,已經排除某些表的2015dh.dmp檔案的impdp匯入,和一般的匯入一樣

impdp system/mds_ets.2009 remap_schema=dh:dahai_demo remap_tablespace=dh:dahaidata_demo dumpfile=2015dh.dmp directory=dumpdir

query查詢條件的expdp/impdp

按查詢條件只匯出一張表,發現不需要加schema=的條件,只需要在tables=前面加上schema即可

expdp \"db/dahai_2013 as sysdba\" directory=dumpdir dumpfile=2015table1.dmp tables=dh.ierp_wo_sn_material_info query=dh.ierp_wo_sn_material_info:\" where creation_date\>"'23-sep-15'"\"

按查詢條件也可以同時匯出兩張表,只需要在tables=中逗號隔開兩表,query=中逗號隔開兩張表的查詢條件即可

expdp \"db/dahai_2013 as sysdba\" directory=dumpdir dumpfile=2015table2.dmp tables=dh.ierp_wo_sn_user,dh.wip_sn_collection_info query=dh.ierp_wo_sn_user:\" where creation_date\>"'23-sep-15'"\",dh.wip_sn_collection_info:\" where creation_date\>"'23-sep-15'"\"

例子匯出a伺服器cux使用者下面的兩張表,再匯入到b伺服器cux使用者下同樣的表名,內容追加進去,tablespace不變

expdp \"system/q2o0racl4syst4m as sysdba\" directory=odpdir dumpfile=201611182.dmp tables=cux.cux_msc_woip_supplys,cux.cux_msc_woip_plans query=cux.cux_msc_woip_supplys:\" where request_id = 20852081\",cux.cux_msc_woip_plans:\" where request_id = 20852081\"

按查詢條件的dmp檔案匯入,和一般的匯入一樣(加不加tables=都無所謂)

以下匯入一張表dh.ierp_wo_sn_material_info含有查詢條件的dmp檔案,加tables=dh.ierp_wo_sn_material_info正常匯入

impdp system/mds_ets.2009 remap_schema=dh:dahai_demo remap_tablespace=dh:dahaidata_demo dumpfile=2015table1.dmp directory=dumpdir tables=dh.ierp_wo_sn_material_info

以下匯入兩張張表dh.ierp_wo_sn_user,dh.wip_sn_collection_info含有查詢條件的dmp檔案,不加tables=發現也可以匯入

impdp system/mds_ets.2009 remap_schema=dh:dahai_demo remap_tablespace=dh:dahaidata_demo dumpfile=2015table2.dmp directory=dumpdir

oracle的條件查詢和排序查詢

在查詢中過濾行 過濾使用 where 子句,將不滿足條件的行過濾掉。select from table where condition s where 子句緊隨 from 子句 where 子句 select employee id,last name,job id,department id fr...

Lucene高階 and 和or的條件查詢

param type,資源的型別,其值為news或product param searchkey,搜尋的關鍵字 return hits public hits executesearch string type,string keyword 同時宣告乙個與之對應的字段陣列 string fields...

ABAP SELECT查詢的模糊條件和字段問題

和資料庫的互動是abap語言中很重要的乙個部分,這裡記錄幾個我遇到過的有關select的問題 1.關於abap萬用字元 以及轉義符 和escape 字串操作中的萬用字元 多位字元,一位字元,轉義字元 在字串進行模糊匹配時,用關係運算子cp,如 if str cp sss open sql條件中萬用字...