DATAPUMP如何導(dǎo)出時(shí)使用exclude排除表-創(chuàng)新互聯(lián)

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

創(chuàng)新互聯(lián)自2013年創(chuàng)立以來(lái),先為市中等服務(wù)建站,市中等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢(xún)服務(wù)。為市中企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問(wèn)題。

一、問(wèn)題描述

       有個(gè)小小需求,要從生產(chǎn)數(shù)據(jù)庫(kù)上導(dǎo)數(shù)據(jù)到測(cè)試庫(kù),問(wèn)題是有張大表(30G)不需要導(dǎo)出到測(cè)試環(huán)境,所以要使用到expdp中’exclude’參數(shù)。但是在使用過(guò)程中還是碰到一點(diǎn)點(diǎn)question。

二、操作過(guò)程

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

EXCLUDE                                

Exclude specific object types.         

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

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

官方文檔給出的Syntax是

EXCLUDE=object_type[:name_clause] [, …]

按照上面的例子,我推斷出exclude參數(shù)針對(duì)表的使用

exclude=table:”=‘table name’”

2.執(zhí)行語(yǔ)句報(bào)錯(cuò),此處說(shuō)明語(yǔ)法有問(wèn)題,最終查詢(xún)到原來(lái)是由于沒(méi)有加轉(zhuǎn)義符。

[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.修改,增加轉(zhuǎn)義符后執(zhí)行成功

[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.導(dǎo)入到測(cè)試環(huán)境成功

[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

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“DATAPUMP如何導(dǎo)出時(shí)使用exclude排除表”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來(lái)學(xué)習(xí)!

本文題目:DATAPUMP如何導(dǎo)出時(shí)使用exclude排除表-創(chuàng)新互聯(lián)
網(wǎng)站路徑:http://bm7419.com/article14/cdiide.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、App開(kāi)發(fā)、網(wǎng)站設(shè)計(jì)商城網(wǎng)站、網(wǎng)站營(yíng)銷(xiāo)、面包屑導(dǎo)航

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)