【EXP】使用EXP的QUERY選項匯出表中部分資料
簡單演示一下使用EXP的QUERY選項匯出表中部分資料(具有where限制條件的匯出)。
1.建立實驗表T,並初始化4條記錄
sec@secooler> create table t (x int ,y varchar2(20));
Table created.
sec@secooler> insert into t values (1,'sec1');
1 row created.
sec@secooler> insert into t values (2,'sec2');
1 row created.
sec@secooler>
sec@secooler> insert into t values (3,'sec3');
1 row created.
sec@secooler> insert into t values (4,'sec4');
1 row created.
sec@secooler> commit;
Commit complete.
sec@secooler> select * from t;
X Y
---------- ------------------------------------------------------------
1 sec1
2 sec2
3 sec3
4 sec4
2.按照“x<3”條件匯出T表中的部分資料
secooler@secDB /exp$ exp sec/sec file=sec.dmp log=sec.log tables=t query=\"where x\<3\"
Export: Release 11.2.0.1.0 - Production on Sun Mar 7 20:19:43 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing option
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
server uses ZHS16GBK character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table T 2 rows exported
Export terminated successfully without warnings.
OK,匯出成功,滿足“x<3”條件的T表資料有兩條。
3.小結
EXP工具的每一個選項都有其重要的應用場合。
當僅需要備份表中部分資料時,您也不妨使用一下QUERY選項,注意這個選項要與TABLES選項一同使用,同時注意在命令列中特殊字元的轉義方法。
Good luck.
secooler
10.03.07
-- The End --
1.建立實驗表T,並初始化4條記錄
sec@secooler> create table t (x int ,y varchar2(20));
Table created.
sec@secooler> insert into t values (1,'sec1');
1 row created.
sec@secooler> insert into t values (2,'sec2');
1 row created.
sec@secooler>
sec@secooler> insert into t values (3,'sec3');
1 row created.
sec@secooler> insert into t values (4,'sec4');
1 row created.
sec@secooler> commit;
Commit complete.
sec@secooler> select * from t;
X Y
---------- ------------------------------------------------------------
1 sec1
2 sec2
3 sec3
4 sec4
2.按照“x<3”條件匯出T表中的部分資料
secooler@secDB /exp$ exp sec/sec file=sec.dmp log=sec.log tables=t query=\"where x\<3\"
Export: Release 11.2.0.1.0 - Production on Sun Mar 7 20:19:43 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing option
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
server uses ZHS16GBK character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table T 2 rows exported
Export terminated successfully without warnings.
OK,匯出成功,滿足“x<3”條件的T表資料有兩條。
3.小結
EXP工具的每一個選項都有其重要的應用場合。
當僅需要備份表中部分資料時,您也不妨使用一下QUERY選項,注意這個選項要與TABLES選項一同使用,同時注意在命令列中特殊字元的轉義方法。
Good luck.
secooler
10.03.07
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-628841/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- exp匯出表中特定條件的表
- oracle資料匯出匯入(exp/imp)Oracle
- exp匯出報錯EXP-00106問題處理
- Oracle資料庫匯入匯出。imp匯入命令和exp匯出命令Oracle資料庫
- 能select的表,可以exp嗎?有exp_full_database就能exp其他使用者的表嗎?Database
- 使用Exp和Expdp匯出資料的效能對比與最佳化
- exp匯出遭遇IMP-00020
- 【exp/imp不同版本】Oracle不同版本的exp/imp使用注意事項Oracle
- 不同版本exp/imp使用注意事項
- 正規表示式之(exp),(?:exp),(?=exp) 理解
- exp和expdp的filesize引數的使用--匯出多個檔案
- 識別exp匯出檔案所用的字符集
- 如何確定一個dmp檔案是exp匯出的還是expdp匯出的?
- 細緻入微:如何使用資料泵匯出表的部分列資料
- 7.84 EXP
- exp&imp的使用方法
- 【ASK_ORACLE】一眼判斷出Oracle的dmp檔案是用expdp匯出還是exp匯出Oracle
- opencv中的exp32f函式OpenCV函式
- oracle exp和impOracle
- JavaScript Math.exp()JavaScript
- Oracle OCP(54):EXPOracle
- EXP增量備份
- Oracle-exp命令Oracle
- 使用imp/exp遇到兩個問題
- 使用exp進行SQL報錯注入SQL
- oracle資料庫備份之exp增量備份Oracle資料庫
- vue+element + table將選中的資料匯出為excel(匯出的是當前頁選中的資料)VueExcel
- exp和imp詳解
- 用exp、imp遷移包含物化檢視日誌的資料
- HTB_pwn_pet_companion_exp
- abc369D Bonus EXP
- abc369 D - Bonus EXP
- exp: docker配置國內映象Docker
- 測試分割槽表部分匯出
- Sql多個表部分資料匯入匯出(臨時想的,暫沒想到其他辦法)SQL
- Oracle 資料匯出注意事項Oracle
- 再探URLDNS鏈(手搓exp)DNS
- HTB_pwn_rocket_blaster_xxx_expAST
- EXP時遭遇ORA-00600 [729]