一. expdp命令详解

The available keywords and their descriptions follow. Default values are listed within square brackets.

ATTACH

Attach to an existing job.(附加到一个现有的工作任务上)

For example, ATTACH=job_name.

COMPRESSION

Reduce the size of a dump file.(指定导出数据是导出全部还是只是数据,或者数据框架)

Valid keyword values are: ALL, DATA_ONLY, [METADATA_ONLY] and NONE.

CONTENT

Specifies data to unload.(指定要卸载的数据)

Valid keyword values are: [ALL], DATA_ONLY and METADATA_ONLY.

DATA_OPTIONS

Data layer option flags.数据选项

Valid keyword values are: XML_CLOBS.

DIRECTORY

Directory object to be used for dump and log files.(存储导出文件和日志文件的目录)

DUMPFILE

Specify list of destination dump file names [expdat.dmp].(导出文件名)

For example, DUMPFILE=scott1.dmp, scott2.dmp, dmpdir:scott3.dmp.

ENCRYPTION

Encrypt part or all of a dump file.(加密)

Valid keyword values are: ALL, DATA_ONLY, ENCRYPTED_COLUMNS_ONLY, METADATA_ONLY and NONE.

ENCRYPTION_ALGORITHM

Specify how encryption should be done.(加密方法,默认为aes128)

Valid keyword values are: [AES128], AES192 and AES256.

ENCRYPTION_MODE

Method of generating encryption key.(加密模块)

Valid keyword values are: DUAL, PASSWORD and [TRANSPARENT].

ENCRYPTION_PASSWORD

Password key for creating encrypted data within a dump file.(加密密码)

ESTIMATE

Calculate job estimates.(对工作任务进行估算)

Valid keyword values are: [BLOCKS] and STATISTICS.

ESTIMATE_ONLY

Calculate job estimates without performing the export.(只估算不导出)

EXCLUDE

Exclude specific object types.(排除,排除还有指定对象的不导出)

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

FILESIZE

Specify the size of each dump file in units of bytes.(指定每个转储文件的大小)

FLASHBACK_SCN

SCN used to reset session snapshot.

FLASHBACK_TIME(即在导出时制定一个scn号,在导出时,只导出当时的数据)

Time used to find the closest corresponding SCN value.

FULL

Export entire database [N].(导出整个数据库)

HELP

Display Help messages [N].(调出帮助菜单)

INCLUDE

Include specific object types.(包含指定对象)

For example, INCLUDE=TABLE_DATA.

JOB_NAME

Name of export job to create.(指定当前任务名)

LOGFILE

Specify log file name [export.log].(指定日志文件名)

NETWORK_LINK

Name of remote database link to the source system.(链接到源系统的远程数据库的名称)

NOLOGFILE

Do not write log file [N].(不写入日志文件)

PARALLEL

Change the number of active workers for current job.(多个并行操作)

PARFILE

Specify parameter file name.(指定参数文件名)

QUERY

Predicate clause used to export a subset of a table.(按查询导出)

For example, QUERY=employees:"WHERE department_id > 10".

REMAP_DATA

Specify a data conversion function.(指定数据转换)

For example, REMAP_DATA=EMP.EMPNO:REMAPPKG.EMPNO.

REUSE_DUMPFILES

Overwrite destination dump file if it exists [N].(如果转储目录已有同名文件,是否覆盖)

SAMPLE

Percentage of data to be exported. (样品,指定导出样品的百分比)

SCHEMAS

List of schemas to export [login schema].(只导出架构)

SOURCE_EDITION

Edition to be used for extracting metadata.(提取元数据)

STATUS

Frequency (secs) job status is to be monitored where(已秒为单位监控)

the default [0] will show new status when available.

TABLES

Identifies a list of tables to export.(指定表导出)

For example, TABLES=HR.EMPLOYEES,SH.SALES:SALES_1995.

TABLESPACES(指定表空间导出)

Identifies a list of tablespaces to export.

TRANSPORTABLE

Specify whether transportable method can be used.(指定是否传出表空间)

Valid keyword values are: ALWAYS and [NEVER].

TRANSPORT_FULL_CHECK

Verify storage segments of all tables [N].(检查所有表)

TRANSPORT_TABLESPACES

List of tablespaces from which metadata will be unloaded.(指定的表空间将不会被导出)

VERSION

Version of objects to export.

Valid keyword values are: [COMPATIBLE], LATEST or any valid database version.(版本)

------------------------------------------------------------------------------

The following commands are valid while in interactive mode.

Note: abbreviations are allowed.

ADD_FILE

Add dumpfile to dumpfile set.(添加转储到转储文件集)

CONTINUE_CLIENT

Return to logging mode. Job will be restarted if idle.(返回到记录模式。暂挂的工作任务将会被重启)

EXIT_CLIENT

Quit client session and leave job running.(推出客户端并后台运行)

FILESIZE

Default filesize (bytes) for subsequent ADD_FILE commands.(默认文件大小(字节)的后续ADD_FILE命令)

HELP

Summarize interactive commands.(帮助)

KILL_JOB

Detach and delete job.(删除任务)

PARALLEL

Change the number of active workers for current job.(更改当前并行进程数)

REUSE_DUMPFILES

Overwrite destination dump file if it exists [N]. 

START_JOB

Start or resume current job.

Valid keyword values are: SKIP_CURRENT.

STATUS

Frequency (secs) job status is to be monitored where

the default [0] will show new status when available.

STOP_JOB

Orderly shutdown of job execution and exits the client.

Valid keyword values are: IMMEDIATE.

二.impdp命令详解

The available keywords and their descriptions follow. Default values are listed within square brackets.

ATTACH

Attach to an existing job.

For example, ATTACH=job_name.

CONTENT

Specifies data to load.

Valid keywords are: [ALL], DATA_ONLY and METADATA_ONLY.

DATA_OPTIONS

Data layer option flags.

Valid keywords are: SKIP_CONSTRAINT_ERRORS.

DIRECTORY

Directory object to be used for dump, log and sql files.

DUMPFILE

List of dumpfiles to import from [expdat.dmp].

For example, DUMPFILE=scott1.dmp, scott2.dmp, dmpdir:scott3.dmp.

ENCRYPTION_PASSWORD

Password key for accessing encrypted data within a dump file.

Not valid for network import jobs.

ESTIMATE

Calculate job estimates.

Valid keywords are: [BLOCKS] and STATISTICS.

EXCLUDE

Exclude specific object types.

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

FLASHBACK_SCN

SCN used to reset session snapshot.

FLASHBACK_TIME

Time used to find the closest corresponding SCN value.

FULL

Import everything from source [Y].

HELP

Display help messages [N].

INCLUDE

Include specific object types.

For example, INCLUDE=TABLE_DATA.

JOB_NAME

Name of import job to create.

LOGFILE

Log file name [import.log].

NETWORK_LINK

Name of remote database link to the source system.

NOLOGFILE

Do not write log file [N].

PARALLEL

Change the number of active workers for current job.

PARFILE

Specify parameter file.

PARTITION_OPTIONS

Specify how partitions should be transformed.

Valid keywords are: DEPARTITION, MERGE and [NONE].

QUERY

Predicate clause used to import a subset of a table.

For example, QUERY=employees:"WHERE department_id > 10".

REMAP_DATA

Specify a data conversion function.

For example, REMAP_DATA=EMP.EMPNO:REMAPPKG.EMPNO.

REMAP_DATAFILE

Redefine datafile references in all DDL statements.

REMAP_SCHEMA

Objects from one schema are loaded into another schema.

REMAP_TABLE

Table names are remapped to another table.

For example, REMAP_TABLE=EMP.EMPNO:REMAPPKG.EMPNO.

REMAP_TABLESPACE

Tablespace object are remapped to another tablespace.

REUSE_DATAFILES

Tablespace will be initialized if it already exists [N].

SCHEMAS

List of schemas to import.

SKIP_UNUSABLE_INDEXES

Skip indexes that were set to the Index Unusable state.

SOURCE_EDITION

Edition to be used for extracting metadata.

SQLFILE

Write all the SQL DDL to a specified file.

STATUS

Frequency (secs) job status is to be monitored where

the default [0] will show new status when available.

STREAMS_CONFIGURATION

Enable the loading of Streams metadata

TABLE_EXISTS_ACTION

Action to take if imported object already exists.

Valid keywords are: APPEND, REPLACE, [SKIP] and TRUNCATE.

TABLES

Identifies a list of tables to import.

For example, TABLES=HR.EMPLOYEES,SH.SALES:SALES_1995.

TABLESPACES

Identifies a list of tablespaces to import.

TARGET_EDITION

Edition to be used for loading metadata.

TRANSFORM

Metadata transform to apply to applicable objects.

Valid keywords are: OID, PCTSPACE, SEGMENT_ATTRIBUTES and STORAGE.

TRANSPORTABLE

Options for choosing transportable data movement.

Valid keywords are: ALWAYS and [NEVER].

Only valid in NETWORK_LINK mode import operations.

TRANSPORT_DATAFILES

List of datafiles to be imported by transportable mode.

TRANSPORT_FULL_CHECK

Verify storage segments of all tables [N].

TRANSPORT_TABLESPACES

List of tablespaces from which metadata will be loaded.

Only valid in NETWORK_LINK mode import operations.

VERSION

Version of objects to import.

Valid keywords are: [COMPATIBLE], LATEST or any valid database version.

Only valid for NETWORK_LINK and SQLFILE.

------------------------------------------------------------------------------

The following commands are valid while in interactive mode.

Note: abbreviations are allowed.

CONTINUE_CLIENT

Return to logging mode. Job will be restarted if idle.

EXIT_CLIENT

Quit client session and leave job running.

HELP

Summarize interactive commands.

KILL_JOB

Detach and delete job.

PARALLEL

Change the number of active workers for current job.

START_JOB

Start or resume current job.

Valid keywords are: SKIP_CURRENT.

STATUS

Frequency (secs) job status is to be monitored where

the default [0] will show new status when available.

STOP_JOB

Orderly shutdown of job execution and exits the client.

Valid keywords are: IMMEDIATE.

附:以上汉语注释,根据平时使用或谷歌翻译得出,如有出入敬请指出

 

三.一个简单的导入导出例子

1.事前准备

以管理员用户登录数据库,搭建好环境

sqlplus sys/oracle@test as sysdba;

 

 
  
  1. create user test identified by test 
  2. alter user test account unlock; 
  3. create or replace directory dumpdir as '/test';(事先创建该目录,并修改属主,属组为oracle.oinstall) 
  4. grant read,write on directory dumpdir to test; 
  5. commit

2.使用expdp命令导出数据

 
  
  1. expdp test/test@test directory=dumpdir dumpfile=test20130131.dmp 

3.使用impdp命令导入数据

 
  
  1. impdp test/test@test directory=dumpdir dumpfile=test201301031.dmp