一. expdp命令詳解sql
The available keywords and their descriptions follow. Default values are listed within square brackets.數據庫
ATTACHsession
Attach to an existing job.(附加到一個現有的工做任務上)架構
For example, ATTACH=job_name.oracle
COMPRESSIONapp
Reduce the size of a dump file.(指定導出數據是導出所有仍是隻是數據,或者數據框架)框架
Valid keyword values are: ALL, DATA_ONLY, [METADATA_ONLY] and NONE.ide
CONTENTui
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;
- create user test identified by test
- alter user test account unlock;
- create or replace directory dumpdir as '/test';(事先建立該目錄,並修改屬主,屬組爲oracle.oinstall)
- grant read,write on directory dumpdir to test;
- commit;
2.使用expdp命令導出數據
- expdp test/test@test directory=dumpdir dumpfile=test20130131.dmp
3.使用impdp命令導入數據
- impdp test/test@test directory=dumpdir dumpfile=test201301031.dmp