新聞中心
Oracle數(shù)據(jù)庫是當(dāng)前更流行的關(guān)系型數(shù)據(jù)庫之一,它不僅擁有強(qiáng)大的功能,還支持多種操作系統(tǒng),是企業(yè)級應(yīng)用系統(tǒng)的首選數(shù)據(jù)庫。但是,在實(shí)際的應(yīng)用過程中,我們常常需要將一些數(shù)據(jù)進(jìn)行導(dǎo)入導(dǎo)出,這就需要我們掌握一些基本的導(dǎo)入導(dǎo)出操作技巧。

本文將從以下幾個方面詳細(xì)介紹oracle數(shù)據(jù)庫的導(dǎo)入導(dǎo)出操作。
1. 導(dǎo)出數(shù)據(jù)
在Oracle數(shù)據(jù)庫中,導(dǎo)出數(shù)據(jù)的方法有多種,其中最常用的是使用exp工具。使用exp工具導(dǎo)出數(shù)據(jù)非常簡單,只需要按照以下步驟進(jìn)行操作即可。
打開命令行窗口,輸入以下命令:
exp userid=/ file=.dmp
其中,和是你要導(dǎo)出的數(shù)據(jù)庫的用戶名和密碼,.dmp是你要導(dǎo)出的數(shù)據(jù)文件名。執(zhí)行以上命令后,系統(tǒng)會提示輸入要導(dǎo)出的對象名稱,例如:
Export: Release 10.2.0.3.0 – Production on Wednesday, 23 June, 2023 16:17:41
Copyright (c) 2023, 2023, Oracle. All rights reserved.
Username:sys/manager as SYSDBA
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
With the Partitioning, OLAP and Data Mining options
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)
About to export specified users …
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SYS
. exporting public type synonyms
. exporting private type synonyms
. exporting object type definitions for user SYS
About to export system procedural objects and actions
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SYSTEM’s tables via Conventional Path …
. . exporting table ABOUT
. . exporting table AUD$
. . exporting table ….
在提示符后輸入要導(dǎo)出的對象名稱,回車即可完成導(dǎo)出。
2. 導(dǎo)入數(shù)據(jù)
與導(dǎo)出數(shù)據(jù)不同,導(dǎo)入數(shù)據(jù)需要使用imp工具。使用imp工具導(dǎo)入數(shù)據(jù)同樣非常簡單,只需要按照以下步驟進(jìn)行操作即可。
在命令行窗口輸入以下命令:
imp userid=/ file=.dmp
其中,和是你要導(dǎo)入的數(shù)據(jù)庫的用戶名和密碼,.dmp是你要導(dǎo)入的數(shù)據(jù)文件名。執(zhí)行以上命令后,系統(tǒng)會提示輸入要導(dǎo)入的對象名稱,例如:
Import: Release 10.2.0.3.0 – Production on Wednesday, 23 June, 2023 16:21:02
Copyright (c) 2023, 2023, Oracle. All rights reserved.
Username: sys as SYSDBA
Password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
. importing SYS’s objects into SYS
. importing SYS’s objects into SYS
. importing SYS’s objects into SYS
. importing SYS’s objects into SYS
. importing SYS’s objects into SYS
. importing SYS’s objects into SYS
. importing SYS’s objects into SYS
. importing SYS’s objects into SYS
. importing SYS’s objects into SYS
. importing SYS’s objects into SYS
. importing SYS’s objects into SYS
. importing SYS’s objects into SYS
在提示符后輸入要導(dǎo)入的對象名稱,回車即可完成導(dǎo)入。
3. 導(dǎo)出表數(shù)據(jù)
如果只需要導(dǎo)出表數(shù)據(jù)而無需導(dǎo)出整個數(shù)據(jù)庫,可以使用以下命令:
exp userid=/ file=.dmp tables=
其中,是要導(dǎo)出的表名,可以同時指定多個表名,多個表名之間用逗號分隔。
4. 導(dǎo)出指定條件的數(shù)據(jù)
如果只需要導(dǎo)出滿足指定條件的數(shù)據(jù),可以使用以下命令:
exp userid=/ file=.dmp query=””
其中,是要導(dǎo)出的數(shù)據(jù)的查詢語句。
5. 導(dǎo)入指定表數(shù)據(jù)
如果只需要導(dǎo)入指定表數(shù)據(jù)而無需導(dǎo)入整個數(shù)據(jù)庫,可以使用以下命令:
imp userid=/ file=.dmp tables=
其中,是要導(dǎo)入的表名,可以同時指定多個表名,多個表名之間用逗號分隔。
6. 導(dǎo)入指定條件的數(shù)據(jù)
如果只需要導(dǎo)入滿足指定條件的數(shù)據(jù),可以使用以下命令:
imp userid=/ file=.dmp query=””
其中,是要導(dǎo)入的數(shù)據(jù)的查詢語句。
相關(guān)問題拓展閱讀:
- 關(guān)于oracle數(shù)據(jù)庫的導(dǎo)入和導(dǎo)出
關(guān)于oracle數(shù)據(jù)庫的導(dǎo)入和導(dǎo)出
原因出現(xiàn)在full
=
y
這個參數(shù)上
,
full
=
y
這個參數(shù)用來導(dǎo)出全庫所有數(shù)據(jù)
.
當(dāng)你把db.dmp文件判沒告導(dǎo)入到第二個數(shù)據(jù)庫后
,
第二個庫也就有了sa這個用戶,密碼為bcd
,且第二個庫的system用戶密碼也會變成之一個庫中system用戶的密碼.
導(dǎo)出某個用戶下表的語句:
exp
system/123
file=d:\db.dmp
owner=sa
grants=y
參數(shù)owner指明了要導(dǎo)出哪個用戶下的數(shù)據(jù).
使用這個掘明參數(shù)的時候,必須使用具備DBA權(quán)察滑限的用戶做導(dǎo)出操作,比如system.
之一個問題:因高晌為你做導(dǎo)入時使用了FULL=Y這個參數(shù),只全部導(dǎo)入。
第二個冊指問題:
導(dǎo)出表:exp
用戶名/密碼
file=”
log=”
tables=(table1,table2);
導(dǎo)入表州念配:imp
用戶名/密碼
file=”
log=”
tables=(table1,table2);
imp
system/manager
file=bible_db
log=dible_db
full=y
ignore=y
system/manager是用戶名和密碼
file=bible_db
是芹碼要導(dǎo)入的文件
log=dible_db是生成日志的名稱
full=y是導(dǎo)入整個文件
ignore=y是忽略創(chuàng)建錯誤
數(shù)據(jù)旁消庫是a.dmp我想導(dǎo)入的運(yùn)首知時候,數(shù)據(jù)庫是b
oracle數(shù)據(jù)庫的導(dǎo)入導(dǎo)出的介紹就聊到這里吧,感謝你花時間閱讀本站內(nèi)容,更多關(guān)于oracle數(shù)據(jù)庫的導(dǎo)入導(dǎo)出,簡單易學(xué)的Oracle數(shù)據(jù)庫導(dǎo)入導(dǎo)出教程,關(guān)于oracle數(shù)據(jù)庫的導(dǎo)入和導(dǎo)出的信息別忘了在本站進(jìn)行查找喔。
創(chuàng)新互聯(lián)成都網(wǎng)站建設(shè)公司提供專業(yè)的建站服務(wù),為您量身定制,歡迎來電(028-86922220)為您打造專屬于企業(yè)本身的網(wǎng)絡(luò)品牌形象。
成都創(chuàng)新互聯(lián)品牌官網(wǎng)提供專業(yè)的網(wǎng)站建設(shè)、設(shè)計(jì)、制作等服務(wù),是一家以網(wǎng)站建設(shè)為主要業(yè)務(wù)的公司,在網(wǎng)站建設(shè)、設(shè)計(jì)和制作領(lǐng)域具有豐富的經(jīng)驗(yàn)。
新聞名稱:簡單易學(xué)的Oracle數(shù)據(jù)庫導(dǎo)入導(dǎo)出教程(oracle數(shù)據(jù)庫的導(dǎo)入導(dǎo)出)
網(wǎng)站URL:http://www.5511xx.com/article/cosdgde.html


咨詢
建站咨詢
