中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

DATAPUMP如何導出時使用exclude排除表

發布時間:2021-11-10 09:50:01 來源:億速云 閱讀:566 作者:小新 欄目:關系型數據庫

這篇文章主要介紹了DATAPUMP如何導出時使用exclude排除表,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

一、問題描述

       有個小小需求,要從生產數據庫上導數據到測試庫,問題是有張大表(30G)不需要導出到測試環境,所以要使用到expdp中’exclude’參數。但是在使用過程中還是碰到一點點question。

二、操作過程

1.根據expdp -help 信息中得知exclude參數的for example如下:

EXCLUDE                                

Exclude specific object types.         

For example, EXCLUDE=SCHEMA:"='HR'”.     

當然 = 也可以替換成 in ( ) 或 like ‘%..%’這種方式,如:exclude=index:”like ‘emp%’" ,也可以只給object types,如: exclude=VIEW,PACKAGE, FUNCTION

官方文檔給出的Syntax是

EXCLUDE=object_type[:name_clause] [, …]

按照上面的例子,我推斷出exclude參數針對表的使用

exclude=table:”=‘table name’”

2.執行語句報錯,此處說明語法有問題,最終查詢到原來是由于沒有加轉義符。

[oracle@rac2 ~]$ expdp cloan/xxxx DIRECTORY=backup DUMPFILE=cloan_20170713.dmp log=cloan_20170713.log  exclude=table:"='WSCT_DATA'" compression=all

LRM-00116: syntax error at 'table:' following '='

3.修改,增加轉義符后執行成功

[oracle@rac2 ~]$ expdp cloan/xxxx DIRECTORY=backup DUMPFILE=cloan_20170713.dmp log=cloan_20170713.log  EXCLUDE=TABLE:\"= \'WSCT_DATA\'\" compression=all

Export: Release 11.2.0.4.0 - Production on Thu Jul 13 10:17:50 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

Legacy Mode Active due to the following parameters:

Legacy Mode Parameter: "log=cloan_20170713.log" Location: Command Line, Replaced with: "logfile=cloan_20170713.log"

Legacy Mode has set reuse_dumpfiles=true parameter.

Starting "CLOAN"."SYS_EXPORT_SCHEMA_02":  cloan/******** DIRECTORY=backup DUMPFILE=cloan_20170713.dmp logfile=cloan_20170713.log EXCLUDE=TABLE:"= 'WSCT_DATA'" compression=all reuse_dumpfiles=true

Estimate in progress using BLOCKS method...

Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA

… … 

Dump file set for CLOAN.SYS_EXPORT_SCHEMA_02 is:

  /backup/cloan_20170713.dmp

Job "CLOAN"."SYS_EXPORT_SCHEMA_02" successfully completed at Thu Jul 13 10:19:18 2017 elapsed 0 00:01:27

4.導入到測試環境成功

[oracle@testdb backup]$  impdp cloancp/xxxx DIRECTORY=backup DUMPFILE=cloan_20170713.dmp remap_schema=cloan:cloancp remap_tablespace=cloan:newcloan;

Import: Release 11.2.0.4.0 - Production on Thu Jul 13 10:45:30 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Master table "CLOANCP"."SYS_IMPORT_FULL_01" successfully loaded/unloaded

Starting "CLOANCP"."SYS_IMPORT_FULL_01":  cloancp/******** DIRECTORY=backup DUMPFILE=cloan_20170713.dmp remap_schema=cloan:cloancp remap_tablespace=cloan:newcloan

Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA

Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE

Processing object type SCHEMA_EXPORT/TABLE/TABLE

Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA

…...

Processing object type SCHEMA_EXPORT/TABLE/COMMENT

Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX

Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT

Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

Processing object type SCHEMA_EXPORT/TABLE/TRIGGER

Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

Job "CLOANCP"."SYS_IMPORT_FULL_01" completed with 4 error(s) at Thu Jul 13 10:46:34 2017 elapsed 0 00:01:04

感謝你能夠認真閱讀完這篇文章,希望小編分享的“DATAPUMP如何導出時使用exclude排除表”這篇文章對大家有幫助,同時也希望大家多多支持億速云,關注億速云行業資訊頻道,更多相關知識等著你來學習!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

长海县| 乐至县| 淳化县| 旬邑县| 萨嘎县| 龙泉市| 通州区| 信宜市| 九江县| 互助| 景德镇市| 东乡| 集安市| 贵定县| 双辽市| 沾化县| 永川市| 张掖市| 阜阳市| 泗洪县| 温州市| 社旗县| 合肥市| 抚顺市| 卢湾区| 浮山县| 康乐县| 桐梓县| 泗水县| 东港市| 密云县| 托克逊县| 桃园县| 衡阳市| 象山县| 壶关县| 永宁县| 沂南县| 青田县| 封丘县| 曲靖市|