溫馨提示×

溫馨提示×

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

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

數(shù)據(jù)庫中exp導(dǎo)出方法是什么

發(fā)布時間:2021-11-10 15:35:30 來源:億速云 閱讀:372 作者:iii 欄目:關(guān)系型數(shù)據(jù)庫

本篇內(nèi)容介紹了“數(shù)據(jù)庫中exp導(dǎo)出方法是什么”的有關(guān)知識,在實(shí)際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!

1.功能簡介

Export和import是oracle很常用的數(shù)據(jù)遷移工具(導(dǎo)出/導(dǎo)入)。這種遷移方式采用的是邏輯遷移。實(shí)際進(jìn)行操作時,export/import對應(yīng)的命令是emp/imp(注意小寫)。

2.遷移條件:

exp&imp支持跨版本、跨平臺的遷移,還支持夸字符集的數(shù)據(jù)遷移。最重要的是,在遷移之前不需要做任何的準(zhǔn)備工作,只需要執(zhí)行exp/imp命令,指定相關(guān)參數(shù)即可完成導(dǎo)出/導(dǎo)入任務(wù)

3.查看幫助

可以通過help=y命令來調(diào)出幫助信息

[oracle@localhost u01]$ exp help=y

Export: Release 11.2.0.4.0 - Production on Tue Oct 23 02:43:45 2018

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

USERID must be the first parameter on the command line.

Keyword    Description (Default)      Keyword      Description (Default)

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

USERID     username/password          FULL         export entire file (N)

BUFFER     size of data buffer        OWNER        list of owner usernames

FILE       output files (EXPDAT.DMP)  TABLES       list of table names

COMPRESS   import into one extent (Y) RECORDLENGTH length of IO record

GRANTS     export grants (Y)          INCTYPE      incremental export type

INDEXES    export indexes (Y)         RECORD       track incr. export (Y)

DIRECT     direct path (N)            TRIGGERS     export triggers (Y)

LOG        log file of screen output  STATISTICS   analyze objects (ESTIMATE)

ROWS       export data rows (Y)       PARFILE      parameter filename

CONSISTENT cross-table consistency(N) CONSTRAINTS  export constraints (Y)

OBJECT_CONSISTENT    transaction set to read only during object export (N)

FEEDBACK             display progress every x rows (0)

FILESIZE             maximum size of each dump file

FLASHBACK_SCN        SCN used to set session snapshot back to

FLASHBACK_TIME       time used to get the SCN closest to the specified time

QUERY                select clause used to export a subset of a table

RESUMABLE            suspend when a space related error is encountered(N)

RESUMABLE_NAME       text string used to identify resumable statement

RESUMABLE_TIMEOUT    wait time for RESUMABLE

TTS_FULL_CHECK       perform full or partial dependency check for TTS

VOLSIZE              number of bytes to write to each tape volume

TABLESPACES          list of tablespaces to export

TRANSPORT_TABLESPACE export transportable tablespace metadata (N)

TEMPLATE             template name which invokes iAS mode export

Export terminated successfully without warnings.

注:執(zhí)行imp時支持的參數(shù)與上述類似,不完全相同,可以可以通過命令imp help=y進(jìn)行查看

4.Exp/imp的處理模式

Exp/imp工具在使用的時候支持4中操作模式:

(1)    整庫模式:導(dǎo)出導(dǎo)入整個數(shù)據(jù)庫,對應(yīng)FULL參數(shù);

(2)    表空間模式:導(dǎo)出導(dǎo)入指定表空間中的對象數(shù)據(jù),對應(yīng)tablespace參數(shù);

(3)    用戶模式:導(dǎo)出導(dǎo)入用戶自有對象,對應(yīng)owner參數(shù);

(4)    表模式:導(dǎo)出導(dǎo)入指定的表或分區(qū)表,對應(yīng)tables參數(shù)。

5.Exp調(diào)用方式

(1)    命令行方式調(diào)用

直接執(zhí)行命令

例如:$ exp scott/tiger tables=emp file=scott_emp.dmp log=scott_emp.log

(2)    參數(shù)文件方式調(diào)用

第一步,編輯一個文件

$ vi scott_emp.dat

           Tables=emp

           Buffer=20480

log=scott_emp.log

第二步,然后在執(zhí)行命令時調(diào)用這個文件

$ exp scott/tiger parfile=scott_emp.dat

6.Exp導(dǎo)出例子說明

(1)    導(dǎo)出scott用戶的emp表

$ exp scott/tiger tables=emp file=scott_emp.dmp log=scott_emp.log            

(2)    導(dǎo)出scott用戶emp表中empno>100的數(shù)據(jù)

$ exp scott/tiger tables=emp query="'where empno>100'" file=scott_emp100.dmp log=scott_emp100.log

(3)    導(dǎo)出scott用戶所有的表

$ exp scott/tiger owner=scott file=scott_tables.dmp log=scott_tables.log

(4)    全庫導(dǎo)出

$ exp system/oracle full=y file=fulldb.dmp log=fulldb.log

7.重要參數(shù)說明

TABLES:   指定要導(dǎo)出那些表

QUERY:    對要導(dǎo)出的數(shù)據(jù)進(jìn)行篩選

      SCHEMA:  指定schema(寫成用戶名)

      LOG:        指定產(chǎn)生日志文件名

      FULL:       FULL=y時,代表全庫導(dǎo)出

      FILESIZE: 指定導(dǎo)出單一文件的大小

      索引、約束、授權(quán)

      GRANTS:指定對象的授權(quán)信息(訪問、操作權(quán)限),默認(rèn)為Y

      INDEXES:指定是否導(dǎo)出表的索引,默認(rèn)為Y

      CONSTRAINTS:指定是否導(dǎo)出表的約束,默認(rèn)為Y

      TRIGGERS:指定是否導(dǎo)出與表相關(guān)的觸發(fā)器,默認(rèn)為Y

“數(shù)據(jù)庫中exp導(dǎo)出方法是什么”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注億速云網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI