当前位置:网站首页>Oracle advanced (VI) Oracle expdp/impdp details
Oracle advanced (VI) Oracle expdp/impdp details
2022-07-07 21:57:00 【InfoQ】
One 、ORACLE Data pump
ORCALE10G
- Support parallel processing import 、 Export task ;
- Support pause and restart import 、 Export task ;
- Supported by
Database Link
To export or import objects in a remote database ;
- Support to import through
Remap_schema、Remap_datafile、Remap_tablespace
Several parameters are used to automatically modify the owner of the object during the import process 、 Data file or table space where data resides ;
- Import / Export provides very fine-grained object control . adopt
Include、Exclude
Two parameters , You can even specify whether to include or not to include an object .
Two 、 What is? Directory object
Directory
Oracle10g
- Besides using
network_link
Unexpected parameter ,expdp
The generated files are all on the server (Directory Designated location )
2.1 How to call
- The simplest call in the command line mode , But the parameters written are limited ,It is recommended to use parameter files.
- Parameter file is the most commonly used method . Usually you need to write a parameter file first . Specify various parameters required for export . Then call .
expdp user/pwd parfile=xxx.par
expdp user/pwd parfile=xxx.par logfile=a.log
expdp user/pwd logfile=a.log parfile=xxx.par
- Interactive mode
Data Pump
Import and export tasks support stopping , Restart and other state operations . For example, users perform import or export tasks , Half way through , Use Crtl+C Interrupted the task ( Or other reasons ), At this time, the task is not cancelled , Instead, it was transferred to the backstage . It can be used again expdp/impdp command , additional attach Parameter to reconnect to the interrupted task , And select the subsequent operation . This is the way of interaction .
2.2 What is? attach Parameters
Starting “BAM”.”SYS_EXPORT_SCHEMA_01″:bam/******** parfile=expdp_tbs.par
SYS_EXPORT_SCHEMA_01
3、 ... and 、 Operation mode
- Full library modeImport or export the entire database , Corresponding
impdp/expdp
In the command full Parameters , Only have dba perhapsexp_full_database
andimp_full_database
Only authorized users can execute .
- Schema PatternExport or import Schema I have my own object , Corresponding
impdp/expdp
In the command Schema Parameters , This is the default mode of operation . If you have dba perhapsexp_full_database
andimp_full_database
If the user with permission executes , You can export or import multipleSchema
Objects in the .
- Table modeExport the specified table or table partition ( If there are partitions ) And objects that depend on the table ( As the index of the table , Constraints etc. , But only if these objects are in the same
Schema
in , Or the executing user has the corresponding permission ). Correspondingimpdp/expdp
In the command Table Parameters .
- Tablespace modeExport the contents of the specified tablespace . Corresponding
impdp/expdp
MediumTablespaces
Parameters , This pattern is similar to table pattern and Schema Pattern supplement .
- Transfer tablespace modeCorresponding
impdp/expdp
MediumTransport_tablespaces
Parameters . The most significant difference between this mode and the previous modes is generated Dump The file does not contain specific logical data , Only the metadata of related objects is exported ( That is, the definition of the object , It can be understood as the creation statement of a table ), The logical data is still in the data file of the tablespace , When exporting, you need to copy metadata and data files to the target server at the same time . This export method is very efficient , The time cost is mainly generated by copying data files I/O On .expdp Perform export of transport tablespace pattern , User must Have exp_full_database Role or DBA role . When importing through transport tablespace mode , The user must have imp_full_database Role or DBA horn color .
- Filtering dataFiltering data mainly depends on Query and Sample Two parameters . among Sample The parameters are mainly for expdp Export function .
- QueryAnd exp In the command Query The function is similar to , however Expdp in , This parameter function has been enhanced , Finer granularity of control .Expdp Medium Query It is also specified similar where Statement to limit records . The grammar is as follows :
Query = [Schema.][Table_name:] Query_clause
Schema.table_name
Query_clause
Query_clause
Query=A:”Where id<5″,B:”Where name=’a’”
Where
Schema
Query=Where id <5
- SampleThis parameter is used to specify the percentage of exported data , The range of values that can be specified is from 0.000001 To 99.999999, The grammar is as follows :
Sample=[[Schema_name.]Table_name:]sample_percent
Four 、 Filter objects
- Exclude Against the rules
- Include Just the rules
Exclude
exclude/include
EXCLUDE=[object_type]:[name_clause],[object_type]:[name_clause] -- Exclude specific objects
INCLUDE=[object_type]:[name_clause],[object_type]:[name_clause] -- Contains specific objects
object_type
table,sequence,view,procedure,package
name_clause
name_clause
object_type
expdp <other_parameters> SCHEMAS=scott EXCLUDE=SEQUENCE,TABLE:"IN ('EMP','DEPT')"
impdp <other_parameters> SCHEMAS=scott INCLUDE=PACKAGE,FUNCTION,PROCEDURE,TABLE:"='EMP'"
EXCLUDE=SEQUENCE,VIEW -- Filter all SEQUENCE,VIEW
EXCLUDE=TABLE:"IN ('EMP','DEPT')" -- Filter table objects EMP,DEPT
EXCLUDE=SEQUENCE,VIEW,TABLE:"IN ('EMP','DEPT')" -- Filter all SEQUENCE,VIEW And table objects EMP,DEPT
EXCLUDE=INDEX:"= 'INDX_NAME'" -- Filter the specified index object INDX_NAME
INCLUDE=PROCEDURE:"LIKE 'PROC_U%'" -- Include with PROC_U All stored procedures at the beginning (_ The symbol represents any single character )
INCLUDE=TABLE:"> 'E' " -- Contains characters larger than E All table objects of `
Parameter file:exp_scott.par
DIRECTORY = dump_scott
DUMPFILE = exp_scott_%U.dmp
LOGFILE = exp_scott.log
SCHEMAS = scott
PARALLEL= 2
EXCLUDE = TABLE:"IN ('EMP', 'DEPT')"
D:\> expdp system/manager DIRECTORY=my_dir DUMPFILE=exp_tab.dmp LOGFILE=exp_tab.log SCHEMAS=scott
INCLUDE=TABLE:\"IN ('EMP', 'DEPT')\"
\
expdp system/manager DIRECTORY=my_dir DUMPFILE=exp_tab.dmp LOGFILE=exp_tab.log SCHEMAS=scott
INCLUDE=TABLE:\"IN \(\'EMP\', \'DEP\'\)\"
- ORA-39001: invalid argument value
- ORA-39071: Value for INCLUDE is badly formed.
- ORA-00936: missing expression
- ORA-39071: Value for EXCLUDE is badly formed.
- ORA-00904: “DEPT”: invalid identifier
- ORA-39041: Filter “INCLUDE” either identifies all object types or no object types.
- ORA-39041: Filter “EXCLUDE” either identifies all object types or no object types
- ORA-39038: Object path “USER” is not supported for TABLE jobs.
5、 ... and 、 Advanced filtering
ALL
: export / Import object definitions and data , The default value of this parameter is ALL
DATA_ONLY
: Export only / Import data .
METADATA_ONLY
: Export only / Import object definitions .
5.1 Filtering existing data
Table_exists_action
SKIP
: Skip this table , Proceed to the next object . This parameter defaults toSKIP
. It is worth noting that , If you also specifyCONTENT
Parameter isData_only
Words ,SKIP
Invalid parameter , The default isAPPEND
.
APPEND
: Add data to an existing table .
TRUNCATE
:TRUNCATE
Current table , Then add records . Use this parameter with caution , Unless you confirm that the data in the current table is really useless . Otherwise, data may be lost .
REPLACE
: Delete and rebuild table objects , Then add data to it . It is worth noting that , If you also specifyCONTENT
Parameter isData_only
Words ,REPLACE
Invalid parameter .
5.2 Redefine the Schema Or table space
Remap_Schema
Remap_tablespace
REMAP_SCHEMA
: Redefine the object's ownership Schema The function of this parameter is similar to IMP Medium Fromuser+Touser, Support multiple Schema Transformation , The grammar is as follows :
REMAP_SCHEMA=Source_schema:Target_schema[,Source_schema:Target_schema]
Remap_schema=a:b,c:d
remap_schema=a:b,a:c.
REMAP_TABLESPACE
: Redefine the tablespace in which the object resides . This parameter is used to remap the table space of the imported object , Support simultaneous conversion of multiple tablespaces , Separate each other with commas . The grammar is as follows :
REMAP_TABLESPACE=Source_tablespace:Target_tablespace[,Source_tablespace:Target_tablespace]
Remap_tablespace
5.3 Optimize import / Export efficiency
Oracle Data Pump technology enables Very High-Speed movement of data and metadata from one database to another.
Parallel
- For exported
parallel
dump
DUMP
DUMP
EXPDP
FILESIZE
DUMP
parallel
filesize
expdp user/pwd directory=dump_file dumpfile=expdp_20100820_%U.dmp logfile=expdp_20100820.log filesize=500M parallel=4
- For imported
parallel
parallel
parallel
impdp user/pwd directory=dump_file dumpfile=expdp_20100820_%U.dmp logfile=impdp_20100820.log parallel=10
边栏推荐
- Cv2.resize function reports an error: error: (-215:assertion failed) func= 0 in function ‘cv::hal::resize‘
- Wechat official account oauth2.0 authorizes login and displays user information
- The new version of onespin 360 DV has been released, refreshing the experience of FPGA formal verification function
- Focusing on safety in 1995, Volvo will focus on safety in the field of intelligent driving and electrification in the future
- The maximum number of meetings you can attend [greedy + priority queue]
- Solve the problem of uni in uni app Request sent a post request without response.
- L2: current situation, prospects and pain points of ZK Rollup
- Talk about relational database and serverless
- 2022 how to evaluate and select low code development platforms?
- 建立自己的网站(18)
猜你喜欢
Why can't win11 display seconds? How to solve the problem that win11 time does not display seconds?
三元表达式、各生成式、匿名函数
Solve the problem of using uni app mediaerror mediaerror errorcode -5
L2: current situation, prospects and pain points of ZK Rollup
Jerry's test box configuration channel [chapter]
解决uni-app中uni.request发送POST请求没有反应。
Qt编写物联网管理平台39-报警联动
Validutil, "Rethinking the setting of semi supervised learning on graphs"
大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
Win11U盘不显示怎么办?Win11插U盘没反应的解决方法
随机推荐
Meta force force meta universe system development fossage model
cv2.resize函数报错:error: (-215:Assertion failed) func != 0 in function ‘cv::hal::resize‘
The little money made by the program ape is a P!
Matplotlib drawing interface settings
Actual combat: sqlserver 2008 Extended event XML is converted to standard table format [easy to understand]
An overview of the latest research progress of "efficient deep segmentation of labels" at Shanghai Jiaotong University, which comprehensively expounds the deep segmentation methods of unsupervised, ro
Code of "digital image processing principle and Practice (matlab version)" part2[easy to understand]
Kirin Xin'an operating system derivative solution | storage multipath management system, effectively improving the reliability of data transmission
强化学习-学习笔记9 | Multi-Step-TD-Target
Develop those things: go plus c.free to free memory, and what are the reasons for compilation errors?
L'enregistreur de disque dur NVR est connecté à easycvr par le Protocole GB 28181. Quelle est la raison pour laquelle l'information sur le canal de l'appareil n'est pas affichée?
【JDBC Part 1】概述、获取连接、CRUD
Jerry's about TWS channel configuration [chapter]
用语雀写文章了,功能真心强大!
Jerry's key to initiate pairing [chapter]
Goal: do not exclude yaml syntax. Try to get started quickly
Open source OA development platform: contract management user manual
你可曾迷茫?曾经的测试/开发程序员,懵懂的小菜C鸟升级......
EasyCVR配置中心录像计划页面调整分辨率时的显示优化
[JDBC Part 1] overview, get connection, CRUD