新聞中心
oracle sql developer如何導(dǎo)出數(shù)據(jù)
打開oracle sql developer工具,連接上數(shù)據(jù)庫服務(wù),然后打開表列表,選擇需要導(dǎo)出的表,然后右擊選擇導(dǎo)出
創(chuàng)新互聯(lián)長期為近1000家客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊(duì)從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為安陸企業(yè)提供專業(yè)的做網(wǎng)站、成都網(wǎng)站設(shè)計,安陸網(wǎng)站改版等技術(shù)服務(wù)。擁有10多年豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開發(fā)。
請點(diǎn)擊輸入圖片描述
在導(dǎo)出向?qū)ы撁?,如圖可以看到,是否需要導(dǎo)出DLL,是否美化顯示等選項(xiàng),可以根據(jù)需要進(jìn)行勾選。最下面選擇編碼和導(dǎo)出的文件目錄
請點(diǎn)擊輸入圖片描述
這一步,需要選擇導(dǎo)出的列字段,可以選擇其中部分字段,默認(rèn)是全部列勾選的,如果不需要修改可以直接點(diǎn)擊下一步
請點(diǎn)擊輸入圖片描述
這一步需要指定過濾的where條件,如圖所示,在where字句中輸入條件,輸入完條件之后可以點(diǎn)擊刷新按鈕查看過濾效果
請點(diǎn)擊輸入圖片描述
到這一步是導(dǎo)出概要,可以查看導(dǎo)出有關(guān)的信息等,沒有問題的話,可以直接點(diǎn)擊完成,即可開始導(dǎo)出數(shù)據(jù)了。
請點(diǎn)擊輸入圖片描述
如果表里的數(shù)據(jù)量比較大,在導(dǎo)出的時候需要等待一段時間,可以選擇后臺運(yùn)行,這樣可以同時做其它的操作。導(dǎo)出程序在后臺導(dǎo)出,完成之后會有提醒。
請點(diǎn)擊輸入圖片描述
導(dǎo)出完成之后,打開剛剛設(shè)置的導(dǎo)出文件目錄,查看導(dǎo)出的文件和數(shù)據(jù)是否正確。
請點(diǎn)擊輸入圖片描述
oracle 數(shù)據(jù)怎么導(dǎo)入?
我給你一些數(shù)據(jù)庫常用的導(dǎo)入導(dǎo)出命令吧:\x0d\x0a該命令在“開始菜單運(yùn)行CMD”中執(zhí)行\(zhòng)x0d\x0a一、數(shù)據(jù)導(dǎo)出(exp.exe)\x0d\x0a1、將數(shù)據(jù)庫orcl完全導(dǎo)出,用戶名system,密碼accp,導(dǎo)出到d:\daochu.dmp文件中\(zhòng)x0d\x0aexp system/accp@orcl file=d:\daochu.dmp full=y\x0d\x0a\x0d\x0a2、將數(shù)據(jù)庫orcl中scott用戶的對象導(dǎo)出\x0d\x0aexp scott/accp@orcl file=d:\daochu.dmp owner=(scott)\x0d\x0a\x0d\x0a3、將數(shù)據(jù)庫orcl中的scott用戶的表emp、dept導(dǎo)出\x0d\x0aexp scott/accp@orcl file= d:\daochu.dmp tables=(emp,dept)\x0d\x0a\x0d\x0a4、將數(shù)據(jù)庫orcl中的表空間testSpace導(dǎo)出\x0d\x0aexp system/accp@orcl file=d:\daochu.dmp tablespaces=(testSpace)\x0d\x0a\x0d\x0a二、數(shù)據(jù)導(dǎo)入(imp.exe)\x0d\x0a1、將d:\daochu.dmp 中的數(shù)據(jù)導(dǎo)入 orcl數(shù)據(jù)庫中。\x0d\x0aimp system/accp@orcl file=d:\daochu.dmp full=y\x0d\x0a\x0d\x0a2、如果導(dǎo)入時,數(shù)據(jù)表已經(jīng)存在,將報錯,對該表不會進(jìn)行導(dǎo)入;加上ignore=y即可,表示忽略現(xiàn)有表,在現(xiàn)有表上追加記錄。\x0d\x0aimp scott/accp@orcl file=d:\daochu.dmp full=y ignore=y\x0d\x0a\x0d\x0a3、將d:\daochu.dmp中的表emp導(dǎo)入\x0d\x0aimp scott/accp@orcl file=d:\daochu.dmp tables=(emp)
如何在oracle中導(dǎo)出,導(dǎo)入數(shù)據(jù)
最近用到Oracle導(dǎo)出導(dǎo)入數(shù)據(jù),在網(wǎng)上看了別人的一些文章,總結(jié)如下:
Oracle導(dǎo)出導(dǎo)出有兩中方式:一、利用exp imp導(dǎo)出導(dǎo)入;二、利用Oracel數(shù)據(jù)泵expdp impdp導(dǎo)出導(dǎo)入。
一、利用exp imp導(dǎo)出導(dǎo)入
exp imp 語法如下:
exp:
1) 將數(shù)據(jù)庫orcl完全導(dǎo)出
exp system/manager@orcl file=d:\orcl_bak.dmp full=y
2) 將數(shù)據(jù)庫中system用戶的表導(dǎo)出
exp system/manager@orcl file=d:\system_bak.dmp owner=system
3) 將數(shù)據(jù)庫中表table1,table2導(dǎo)出
exp system/manager@orcl file=d:\table_bak.dmp tables=(table1,table2)
4) 將數(shù)據(jù)庫中的表customer中的字段mobile以"139"開頭的數(shù)據(jù)導(dǎo)出
exp system/manager@orcl file=d:\mobile_bak.dmp tables=customer query=\"where mobile like '139%' \"
imp:
1) 將備份文件bak.dmp導(dǎo)出數(shù)據(jù)庫
imp system/manager@orcl file=d:\bak.dmp
如果數(shù)據(jù)表中表已經(jīng)存在,會提示錯誤,在后面加上ignore=y就可以了。
2) 將備份文件bak.dmp中的表table1導(dǎo)入
imp system/manager@orcl file=d:\bak.dmp tables=(table1)
exp imp導(dǎo)出導(dǎo)入數(shù)據(jù)方式的好處是只要你本地安裝了Oracle客戶端,你就可以將服務(wù)器中的數(shù)據(jù)導(dǎo)出到你本地計算機(jī)。同樣也可以將dmp文件從你本地導(dǎo)入到服務(wù)器數(shù)據(jù)庫中。但是這種方式在Oracle11g版本中會出現(xiàn)一個問題:不能導(dǎo)出空表。Oracle11g新增了一個參數(shù)deferred_segment_creation,含義是段延遲創(chuàng)建,默認(rèn)是true。當(dāng)你新建了一張表,并且沒用向其中插入數(shù)據(jù)時,這個表不會立即分配segment。
解決辦法:
1、設(shè)置deferred_segment_creation參數(shù)為false后,無論是空表,還是非空表,都分配segment。
在sqlplus中,執(zhí)行如下命令:
SQLalter system set deferred_segment_creation=false;
查看:
SQLshow parameter deferred_segment_creation;
該值設(shè)置后,只對后面新增的表起作用,對之前建立的空表不起作用,并且注意要重啟數(shù)據(jù)庫讓參數(shù)生效。
2、使用 ALLOCATE EXTEN
使用 ALLOCATE EXTEN可以為數(shù)據(jù)庫對象分配Extent,語法如下:
alter table table_name allocate extent
構(gòu)建對空表分配空間的SQL命令:
SQLselect 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0
批量生成要修改的語句。
然后執(zhí)行這些修改語句,對所有空表分配空間。
此時用exp命令,可將包括空表在內(nèi)的所有表導(dǎo)出。
二、利用expdp impdp導(dǎo)出導(dǎo)入
在Oracle10g中exp imp被重新設(shè)計為Oracle Data Pump(保留了原有的 exp imp工具)
數(shù)據(jù)泵與傳統(tǒng)導(dǎo)出導(dǎo)入的區(qū)別;
1) exp和imp是客戶端工具,他們既可以在客戶端使用,也可以在服務(wù)端使用。
2) expdp和impdp是服務(wù)端工具,只能在Oracle服務(wù)端使用。
3) imp只適用于exp導(dǎo)出文件,impdp只適用于expdp導(dǎo)出文件。
expdp導(dǎo)出數(shù)據(jù):
1、為輸出路徑建立一個數(shù)據(jù)庫的directory對象。
create or replace directory dumpdir as 'd:\';
可以通過:select * from dba_directories;查看。
2、給將要進(jìn)行數(shù)據(jù)導(dǎo)出的用戶授權(quán)訪問。
grant read,write on directory dumpdir to test_expdp;
3、將數(shù)據(jù)導(dǎo)出
expdp test_expdp/test_expdp directory=dumpdir dumpfile=test_expdp_bak.dmp logfile=test_expdp_bak.log schemas=test_expdp
注意:這句話在cmd窗口中運(yùn)行,并且最后不要加分號,否則會提示錯誤。因?yàn)檫@句話是操作系統(tǒng)命令而不是SQL。
impdp導(dǎo)入數(shù)據(jù):
1、給將要進(jìn)行數(shù)據(jù)導(dǎo)入的用戶授權(quán)訪問。
grant read,write on directory dumpdir to test_impdp;
2、將數(shù)據(jù)導(dǎo)入
impdp test_impdp/impdp directory=dumpdir dumpfile=test_expdp_bak.dmp remap_schema=test_expdp:test_impdp
最后:這些內(nèi)容是我在查找資料時找到,由于比較雜亂,現(xiàn)在稍作整理,方便以后查閱。同時,如果能給需要的人提供一些幫助,那就再好不過了。
oracle導(dǎo)入導(dǎo)出數(shù)據(jù)怎么弄
導(dǎo)出是exp,導(dǎo)入是imp
具體用法:
1. 獲取幫助
imp help=y
2. 導(dǎo)入一個完整數(shù)據(jù)庫
imp system/manager file=bible_db log=dible_db full=y ignore=y
3. 導(dǎo)入一個或一組指定用戶所屬的全部表、索引和其他對象
imp system/manager file=seapark log=seapark fromuser=seapark
imp system/manager file=seapark log=seapark fromuser=(seapark,amy,amyc,harold)
4. 將一個用戶所屬的數(shù)據(jù)導(dǎo)入另一個用戶
imp system/manager file=tank log=tank fromuser=seapark touser=seapark_copy
imp system/manager file=tank log=tank fromuser=(seapark,amy)
touser=(seapark1, amy1)
5. 導(dǎo)入一個表
imp system/manager file=tank log=tank fromuser=seapark TABLES=(a,b)
6. 從多個文件導(dǎo)入
imp system/manager file=(paycheck_1,paycheck_2,paycheck_3,paycheck_4)
log=paycheck, filesize=1G full=y
7. 使用參數(shù)文件
imp system/manager parfile=bible_tables.par
bible_tables.par參數(shù)文件:
#Import the sample tables used for the Oracle8i Database Administrator's
Bible. fromuser=seapark touser=seapark_copy file=seapark log=seapark_import
8. 增量導(dǎo)入
imp system./manager inctype= RECTORE FULL=Y FILE=A
-------------------------------------------------------------------------------------------------------------------------------------------
1. 獲取幫助
exp help=y
2. 導(dǎo)出一個完整數(shù)據(jù)庫
exp system/manager file=bible_db log=dible_db full=y
3. 導(dǎo)出數(shù)據(jù)庫定義而不導(dǎo)出數(shù)據(jù)
exp system/manager file=bible_db log=dible_db full=y rows=n
4. 導(dǎo)出一個或一組指定用戶所屬的全部表、索引和其他對象
exp system/manager file=seapark log=seapark owner=seapark
exp system/manager file=seapark log=seapark owner=(seapark,amy,amyc,harold)
注意:在導(dǎo)出用戶時,盡管已經(jīng)得到了這個用戶的所有對象,但是還是不能得到這些對象引用的任何同義詞。解決方法是用以下的SQL*Plus命令創(chuàng)建一個腳本文件,運(yùn)行這個腳本文件可以獲得一個重建seapark所屬對象的全部公共同義詞的可執(zhí)行腳本,然后在目標(biāo)數(shù)據(jù)庫上運(yùn)行該腳本就可重建同義詞了。
SET LINESIZE 132
SET PAGESIZE 0
SET TRIMSPOOL ON
SPOOL c:\seapark.syn
SELECT 'Create public synonym '||synonym_name
||' for '||table_owner||'.'||table_name||';'
FROM dba_synonyms
WHERE table_owner = 'SEAPARK' AND owner = 'PUBLIC';
SPOOL OFF
5. 導(dǎo)出一個或多個指定表
exp seapark/seapark file=tank log=tank tables=tank
exp system/manager file=tank log=tank tables=seapark.tank
exp system/manager file=tank log=tank tables=(seapark.tank,amy.artist)
6. 估計導(dǎo)出文件的大小
全部表總字節(jié)數(shù):
SELECT sum(bytes)
FROM dba_segments
WHERE segment_type = 'TABLE';
seapark用戶所屬表的總字節(jié)數(shù):
SELECT sum(bytes)
FROM dba_segments
WHERE owner = 'SEAPARK'
AND segment_type = 'TABLE';
seapark用戶下的aquatic_animal表的字節(jié)數(shù):
SELECT sum(bytes)
FROM dba_segments
WHERE owner = 'SEAPARK'
AND segment_type = 'TABLE'
AND segment_name = 'AQUATIC_ANIMAL';
7. 導(dǎo)出表數(shù)據(jù)的子集(oracle8i以上)
NT系統(tǒng):
exp system/manager query='Where salad_type='FRUIT'' tables=amy.salad_type
file=fruit log=fruit
UNIX系統(tǒng):
exp system/manager query=\"Where salad_type=\'FRUIT\'\" tables=amy.salad_type
file=fruit log=fruit
8. 用多個文件分割一個導(dǎo)出文件
exp system/manager
file=(paycheck_1,paycheck_2,paycheck_3,paycheck_4)
log=paycheck, filesize=1G tables=hr.paycheck
9. 使用參數(shù)文件
exp system/manager parfile=bible_tables.par
bible_tables.par參數(shù)文件:
#Export the sample tables used for the Oracle8i Database Administrator's Bible.
file=bible_tables
log=bible_tables
tables=(
amy.artist
amy.books
seapark.checkup
seapark.items
)
10. 增量導(dǎo)出
“完全”增量導(dǎo)出(complete),即備份整個數(shù)據(jù)庫
exp system/manager inctype=complete file=990702.dmp
“增量型”增量導(dǎo)出(incremental),即備份上一次備份后改變的數(shù)據(jù)
exp system/manager inctype=incremental file=990702.dmp
“累計型”增量導(dǎo)出(cumulative),即備份上一次“完全”導(dǎo)出之后改變的數(shù)據(jù)
exp system/manager inctype=cumulative file=990702.dmp
如何導(dǎo)出oracle數(shù)據(jù)庫數(shù)據(jù)
導(dǎo)出dmp:選擇oracle導(dǎo)出,找到bin下面的imp.exe,設(shè)定導(dǎo)出文件名導(dǎo)出
導(dǎo)出表數(shù)據(jù),查詢?nèi)頂?shù)據(jù)(不帶rowid),全部選中右鍵導(dǎo)出SQL文件
如何把oracle數(shù)據(jù)庫中數(shù)據(jù)導(dǎo)出
1 將數(shù)據(jù)庫TEST完全導(dǎo)出,用戶名system 密碼manager 導(dǎo)出到D:\daochu.dmp中
exp system/manager@TEST file=d:\daochu.dmp full=y
2 將數(shù)據(jù)庫中system用戶與sys用戶的表導(dǎo)出
exp system/manager@TEST file=d:\daochu.dmp owner=(system,sys)
3 將數(shù)據(jù)庫中的表table1 、table2導(dǎo)出
exp system/manager@TEST file=d:\daochu.dmp tables=(table1,table2)
4 將數(shù)據(jù)庫中的表table1中的字段filed1以"00"打頭的數(shù)據(jù)導(dǎo)出
exp system/manager@TEST file=d:\daochu.dmp tables=(table1) query=\" where filed1 like '00%'\"
上面是常用的導(dǎo)出,對于壓縮我不太在意,用winzip把dmp文件可以很好的壓縮。
不過在上面命令后面 加上 compress=y 就可以了
網(wǎng)站題目:oracle導(dǎo)數(shù)據(jù)怎么搞,oracle 導(dǎo)數(shù)據(jù)
分享URL:http://fisionsoft.com.cn/article/dsipeei.html