exp匯出操作結果判斷
在日常的匯出exp操作中,在自動的計劃操作指令碼中執行命令,有時候需要判斷匯出操作是否成功執行,以便做下一步的操作,這個時候就需要獲取得到exp操作的結果返回值了,對此,oracle提供了3個返回值:
操作結果 返回值
Export terminated successfully without warnings EX_SUCC 0
Export terminated successfully with warnings EX_OKWARN linux 0 win 3
Export terminated unsuccessfully EX_FAIL 1
下面針對linux和win平臺進行測試下。
0. linux平臺測試
0.0. EX_SUCC
[oracle@localhost ~]$ exp gtlions/gtlions tables=test
Export: Release 10.2.0.4.0 - Production on Thu Dec 15 11:01:43 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table TEST 1 rows exported
Export terminated successfully without warnings.
[oracle@localhost ~]$ echo $?
0
0.1. EX_OKWARN
[oracle@localhost ~]$ exp gtlions/gtlions tables=test1,test5
Export: Release 10.2.0.4.0 - Production on Thu Dec 15 10:53:20 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
EXP-00011: GTLIONS.TEST1 does not exist
EXP-00011: GTLIONS.TEST5 does not exist
Export terminated successfully with warnings.
[oracle@localhost ~]$ echo $?
0
0.2. EX_FAIL
[oracle@localhost ~]$ exp gtlions/gtlions tables=test1,test5 full=y
Export: Release 10.2.0.4.0 - Production on Thu Dec 15 10:53:35 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
EXP-00026: conflicting modes specified
EXP-00000: Export terminated unsuccessfully
[oracle@localhost ~]$ echo $?
1
1. win平臺
1.0. EX_SUCC
D:\>exp gtlions/gtlions@test2.4 tables=test
Export: Release 10.2.0.1.0 - Production on 星期四 12月 15 11:05:16 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
已匯出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
即將匯出指定的表通過常規路徑...
. . 正在匯出表 TEST匯出了 1 行
成功終止匯出, 沒有出現警告。
D:\>echo %errorlevel%
0
1.1. EX_OKWARN
D:\>exp gtlions/gtlions@test2.4 tables=test,test5
Export: Release 10.2.0.1.0 - Production on 星期四 12月 15 11:05:40 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
已匯出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
即將匯出指定的表通過常規路徑...
. . 正在匯出表 TEST匯出了 1 行
EXP-00011: GTLIONS.TEST5 不存在
匯出成功終止, 但出現警告。
D:\>echo %errorlevel%
3
1.2. EX_FAIL
D:\>exp gtlions/gtlions@test2.4 tables=test full=y
Export: Release 10.2.0.1.0 - Production on 星期四 12月 15 11:05:56 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
EXP-00026: 指定了衝突模式
EXP-00000: 匯出終止失敗
D:\>echo %errorlevel%
1
-The End-
操作結果 返回值
Export terminated successfully without warnings EX_SUCC 0
Export terminated successfully with warnings EX_OKWARN linux 0 win 3
Export terminated unsuccessfully EX_FAIL 1
下面針對linux和win平臺進行測試下。
0. linux平臺測試
0.0. EX_SUCC
[oracle@localhost ~]$ exp gtlions/gtlions tables=test
Export: Release 10.2.0.4.0 - Production on Thu Dec 15 11:01:43 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table TEST 1 rows exported
Export terminated successfully without warnings.
[oracle@localhost ~]$ echo $?
0
0.1. EX_OKWARN
[oracle@localhost ~]$ exp gtlions/gtlions tables=test1,test5
Export: Release 10.2.0.4.0 - Production on Thu Dec 15 10:53:20 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
EXP-00011: GTLIONS.TEST1 does not exist
EXP-00011: GTLIONS.TEST5 does not exist
Export terminated successfully with warnings.
[oracle@localhost ~]$ echo $?
0
0.2. EX_FAIL
[oracle@localhost ~]$ exp gtlions/gtlions tables=test1,test5 full=y
Export: Release 10.2.0.4.0 - Production on Thu Dec 15 10:53:35 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
EXP-00026: conflicting modes specified
EXP-00000: Export terminated unsuccessfully
[oracle@localhost ~]$ echo $?
1
1. win平臺
1.0. EX_SUCC
D:\>exp gtlions/gtlions@test2.4 tables=test
Export: Release 10.2.0.1.0 - Production on 星期四 12月 15 11:05:16 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
已匯出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
即將匯出指定的表通過常規路徑...
. . 正在匯出表 TEST匯出了 1 行
成功終止匯出, 沒有出現警告。
D:\>echo %errorlevel%
0
1.1. EX_OKWARN
D:\>exp gtlions/gtlions@test2.4 tables=test,test5
Export: Release 10.2.0.1.0 - Production on 星期四 12月 15 11:05:40 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
已匯出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
即將匯出指定的表通過常規路徑...
. . 正在匯出表 TEST匯出了 1 行
EXP-00011: GTLIONS.TEST5 不存在
匯出成功終止, 但出現警告。
D:\>echo %errorlevel%
3
1.2. EX_FAIL
D:\>exp gtlions/gtlions@test2.4 tables=test full=y
Export: Release 10.2.0.1.0 - Production on 星期四 12月 15 11:05:56 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
連線到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
EXP-00026: 指定了衝突模式
EXP-00000: 匯出終止失敗
D:\>echo %errorlevel%
1
-The End-
相關文章
- 【ASK_ORACLE】一眼判斷出Oracle的dmp檔案是用expdp匯出還是exp匯出Oracle
- navicat 匯出查詢結果
- mysql匯出查詢結果MySql
- python中如何判斷all函式輸出結果為true?Python函式
- html靜態頁面迴圈輸出後臺結果,帶if判斷HTML
- eCognition易康匯出分割結果
- MySQL查詢結果匯出方式總結MySql
- 【EXP/IMP】使用EXP /IMP工具“模糊”匯出和匯入
- 資料匯入匯出EXP/IMP
- exp/imp匯出匯入資料
- Oracle匯入(imp )與匯出(exp )Oracle
- 【ORACLE 匯入匯出】exp 錯誤Oracle
- ORACLE匯入匯出命令exp/impOracle
- 判斷 Eloqument 模型查詢資料結果是否為空模型
- mysql匯出select結果到檔案MySql
- QTP小技巧 - 自動匯出HTML結果QTHTML
- DBeaver 匯出多個查詢結果集
- oracle資料匯出匯入(exp/imp)Oracle
- Oracle 遠端匯出匯入 imp/expOracle
- 【匯入匯出】EXP-00068分析
- exp/imp匯出匯入工具的使用
- exp/imp之@遠端匯出操作
- exp 分檔案大小匯出
- Oracle exp/imp匯出匯入工具的使用Oracle
- Oracle資料匯入匯出imp/exp命令Oracle
- oracle資料的匯入匯出imp/expOracle
- 利用資料泵匯出查詢結果(二)
- 利用資料泵匯出查詢結果(一)
- Oracle資料庫匯入匯出。imp匯入命令和exp匯出命令Oracle資料庫
- Exp匯出報錯EXP-00091分析解決
- Oracle資料匯入匯出imp/exp命令(轉)Oracle
- linux下exp自動匯出Linux
- Oracle exp只匯出部分資料Oracle
- EXP 邊匯出邊壓縮打包(原)
- exp 匯出 全庫,全使用者
- 【EXP】使用EXP的QUERY選項匯出表中部分資料
- EXP COMPRESS以及EXP/IMP EXPDP/IMPDP匯入表結構注意
- 判斷ViewController push、pop操作ViewController