❶ oracle exp命令如何批量導出在資料庫中開頭為XX的所有表
oracle exp命令批量導出資料庫的方法:
1 假如資料庫名為:TEST 、,用戶名system 密碼manager 導出到D:/chu.dmp中
exp system/manager@TEST file=d:/chu.dmp full=y
如果要導出指定的表,方法如下:
假如要導出資料庫中的表'CHA%'導出
exp aichannel/aichannel@TESTDB2 file= d:/data/newsmgnt.dmp owner=(PRO) tables=(PRO.CHA%
)
❷ 遠程oracle資料庫導出本地
遠程Oracle資料庫導出到本地用exp命令。
導出一個完整資料庫:
1、win鍵+R鍵,輸入cmd,打開命令提示符。
❸ 如何用exp導出oracle資料庫並壓縮
1. 它是一個可執行的文件 存放目錄/ORACLE_HOME/bin
exp導出工具將資料庫中數據備份壓縮成一個二進制系統文件. 它有三種模式:
a. 用戶模式:導出用戶所有對象以及對象中的數據;
b. 表模式: 導出用戶所有表或者指定的表;
c. 整個資料庫: 導出資料庫中所有對象。
2. 導出工具exp互動式命令行方式的使用的例子
$exp test/test123@appd
Enter array fetch buffer size: 4096 > 回車
Export file: expdat.dmp > m.dmp 生成導出的文件名
(1)E(ntire database), (2)U(sers), or (3)T(ables): (2)U > 3
Export table data (yes/no): yes > 回車wQeLin
Compress extents (yes/no): yes > 回車
❹ 如何用EXP導出oracle資料庫中沒有記錄的表
使用pl/sql,很方便導出。
選擇菜單項的「tools」-「export
tables」;
會顯示當前賬號的所有表格,選擇一個需要導出的表名(也可以選多個);
在output
file設置導出文件的路徑和格式;
點擊「export」按鈕,導出表格,同時會跳出來dos提示窗口,待執行完畢就成功。
❺ orcl exp導出命令怎樣將大數據的表不導出數據 只導出表的欄位
exp h1/h1 file=D:\h1.dmp log=D:\h1.log tables=(h1.table1,h1.table2,h1.table3,h1.table4) rows=n
主要就是後邊rows=n 這個代表只導出表結構,而不導出數據
tables=(h1.table1,h1.table2,h1.table3,h1.table4) 就是導出某些指定的表
❻ oracle怎麼導出數據
Oracle導出導出有兩中方式:一、利用exp imp導出導入;二、利用Oracel數據泵expdp impdp導出導入。
一、利用exp imp導出導入
exp imp 語法如下:
exp:
1) 將資料庫orcl完全導出
exp system/manager@orcl file=d:\orcl_bak.dmp full=y
2) 將資料庫中system用戶的表導出
exp system/manager@orcl file=d:\system_bak.dmp owner=system
3) 將資料庫中表table1,table2導出
exp system/manager@orcl file=d:\table_bak.dmp tables=(table1,table2)
4) 將資料庫中的表customer中的欄位mobile以"139"開頭的數據導出
exp system/manager@orcl file=d:\mobile_bak.dmp tables=customer query=\"where mobile like '139%' \"
imp:
1) 將備份文件bak.dmp導出資料庫
imp system/manager@orcl file=d:\bak.dmp
如果數據表中表已經存在,會提示錯誤,在後面加上ignore=y就可以了。
2) 將備份文件bak.dmp中的表table1導入
imp system/manager@orcl file=d:\bak.dmp tables=(table1)
exp imp導出導入數據方式的好處是只要你本地安裝了Oracle客戶端,你就可以將伺服器中的數據導出到你本地計算機。同樣也可以將dmp文件從你本地導入到伺服器資料庫中。但是這種方式在Oracle11g版本中會出現一個問題:不能導出空表。Oracle11g新增了一個參數deferred_segment_creation,含義是段延遲創建,默認是true。當你新建了一張表,並且沒用向其中插入數據時,這個表不會立即分配segment。
解決辦法:
1、設置deferred_segment_creation參數為false後,無論是空表,還是非空表,都分配segment。
在sqlplus中,執行如下命令:
SQL>alter system set deferred_segment_creation=false;
查看:
SQL>show parameter deferred_segment_creation;
該值設置後,只對後面新增的表起作用,對之前建立的空表不起作用,並且注意要重啟資料庫讓參數生效。
2、使用 ALLOCATE EXTEN
使用 ALLOCATE EXTEN可以為資料庫對象分配Extent,語法如下:
alter table table_name allocate extent
構建對空表分配空間的SQL命令:
SQL>select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0
批量生成要修改的語句。
然後執行這些修改語句,對所有空表分配空間。
此時用exp命令,可將包括空表在內的所有表導出。
二、利用expdp impdp導出導入
在Oracle10g中exp imp被重新設計為Oracle Data Pump(保留了原有的 exp imp工具)
數據泵與傳統導出導入的區別;
1) exp和imp是客戶端工具,他們既可以在客戶端使用,也可以在服務端使用。
2) expdp和impdp是服務端工具,只能在Oracle服務端使用。
3) imp只適用於exp導出文件,impdp只適用於expdp導出文件。
expdp導出數據:
1、為輸出路徑建立一個資料庫的directory對象。
create or replace directory mpdir as 'd:\';
可以通過:select * from dba_directories;查看。
2、給將要進行數據導出的用戶授權訪問。
grant read,write on directory mpdir to test_expdp;
3、將數據導出
expdp test_expdp/test_expdp directory=mpdir mpfile=test_expdp_bak.dmp logfile=test_expdp_bak.log schemas=test_expdp
注意:這句話在cmd窗口中運行,並且最後不要加分號,否則會提示錯誤。因為這句話是操作系統命令而不是SQL。
impdp導入數據:
1、給將要進行數據導入的用戶授權訪問。
grant read,write on directory mpdir to test_impdp;
2、將數據導入
impdp test_impdp/impdp directory=mpdir mpfile=test_expdp_bak.dmp remap_schema=test_expdp:test_impdp
❼ Oracle 資料庫導出 exp命令,報錯:
那就要針對情況具體分析,一般可參考如下方法:
1. 獲取幫助
exp help=y
2. 導出一個完整資料庫
exp system/manager file=bible_db log=dible_db full=y
3. 導出資料庫定義而不導出數據
exp system/manager file=bible_db log=dible_db full=y rows=n
4. 導出一個或一組指定用戶所屬的全部表、索引和其他對象
exp system/manager file=seapark log=seapark owner=seapark
exp system/manager file=seapark log=seapark owner=(seapark,amy,amyc,harold)
注意:在導出用戶時,盡管已經得到了這個用戶的所有對象,但是還是不能得到這些對象引用的任何同義詞。解決方法是用以下的SQL*Plus命令創建一個腳本文件,運行這個腳本文件可以獲得一個重建seapark所屬對象的全部公共同義詞的可執行腳本,然後在目標資料庫上運行該腳本就可重建同義詞了。
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. 導出一個或多個指定表
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. 估計導出文件的大小
全部表總位元組數:
SELECT sum(bytes) FROM dba_segments WHERE segment_type = 'TABLE';
seapark用戶所屬表的總位元組數:
SELECT sum(bytes) FROM dba_segments WHERE owner = 'SEAPARK' AND segment_type = 'TABLE';
seapark用戶下的aquatic_animal表的位元組數:
SELECT sum(bytes) FROM dba_segments WHERE owner = 'SEAPARK' AND segment_type = 'TABLE' AND segment_name = 'AQUATIC_ANIMAL';
7. 導出表數據的子集(oracle8i以上)
NT系統:
exp system/manager query='Where salad_type='FRUIT'' tables=amy.salad_type file=fruit log=fruit
UNIX系統:
exp system/manager query=\"Where salad_type=\'FRUIT\'\" tables=amy.salad_type file=fruit log=fruit
8. 用多個文件分割一個導出文件
exp system/manager file=(paycheck_1,paycheck_2,paycheck_3,paycheck_4) log=paycheck, filesize=1G tables=hr.paycheck
9. 使用參數文件
exp system/manager parfile=bible_tables.par
bible_tables.par參數文件:
#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. 增量導出
「完全」增量導出(complete),即備份整個資料庫
exp system/manager inctype=complete file=990702.dmp
「增量型」增量導出(incremental),即備份上一次備份後改變的數據
exp system/manager inctype=incremental file=990702.dmp
「累計型」增量導出(cumulative),即備份上一次「完全」導出之後改變的數據
exp system/manager inctype=cumulative file=990702.dmp
❽ Oracle的導入導出命令是什麼
用exp、imp試試
導出全庫>>>>>>
導入:導入之前需創造一個空庫(可以和前一個庫名不一樣)、一個一樣的用戶
cmd>>
imp username/password@資料庫名稱 file=文件路徑 full=Y
導出:
exp username/password@資料庫名稱 file=文件路徑(生成的文件)
我導出的時候文件直接設成.sql,蠻好
導出部分表>>>>
打開cmd
導出表,確定監聽是否開啟,資料庫服務是否開啟
exp scott/tiger@orcl file=F:sign.sql tables=表名,表名 grants=y
導入表,確定新資料庫服務是否開啟
imp scott/tiger@資料庫名 file=F:sign.sql fromuser=scott ignore=y commit=y grants=y
❾ 如何讓exp按指定字元集導出數據
oracle exp命令批量導出資料庫的方法:1 假如資料庫名為:TEST 、,用戶名system 密碼manager 導出到D:/chu.dmp中exp system/manager@TEST file=d:/chu.dmp full=y如果要導出指定的表,方法如下:假如要導出資料庫中的表'CHA%'導出exp aichannel/aichannel@TESTDB2 file= d:/data/newsmgnt.dmp owner=(PRO) tables=(PRO.CHA%)