使用Oacle資料泵命令列互動模式

來源:互聯網
上載者:User

通過ctrl+c退出當前的狀態輸出模式。可以使用命令:expdp userid/password attach=job_name 串連到當前正在執行的匯入/匯出任務。可以通過job_name指定任務名字。

1.add_file=test_%U.pmp 追加dump檔案
2.continue_client 退出互動模式,進入記錄模式
3.exit_client 退出互動模式,進入作業系統命令列,任務轉為後台運行
4.filesize=1G 指定產生dump檔案的大小
5.help 列出支援的命令協助資訊
6.kill_job 中斷正在執行的任務
7.parallel=4 增加並行度
8.stop_job 停止當前的任務
9.start_job 啟動停止的任務
10.status 查看任務的狀態資訊

首先執行一個全庫匯出任務

  1. [Oracle@linux exp]$ ll  
  2. 總計 0  
  3. [oracle@linux exp]$ expdp system/oracle@orcl directory=exp full=y job_name=expfull         --這裡指定了此任務的名字。   
  4.   
  5. Export: Release 10.2.0.4.0 - Production on 星期三, 05 10月, 2011 19:09:08  
  6.   
  7. Copyright (c) 2003, 2007, Oracle.  All rights reserved.  
  8.   
  9. 串連到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production  
  10. With the Partitioning, OLAP, Data Mining and Real Application Testing options  
  11. 啟動 "SYSTEM"."EXPFULL":  system/********@orcl directory=exp full=y job_name=expfull   
  12. 正在使用 BLOCKS 方法進行估計...  
  13. 處理物件類型 DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA  
  14.                           --通過ctrl+c退出當前的狀態輸出模式。   
  15. Export> status            --查看任務的狀態資訊。   
  16.   
  17. 作業: EXPFULL  
  18.   操作: EXPORT                           
  19.   模式: FULL                             
  20.   狀態: EXECUTING                        
  21.   處理的位元組: 0  
  22.   當前並行度: 1  
  23.   作業錯誤計數: 0  
  24.   轉儲檔案: /u01/exp/expdat.dmp  
  25.     寫入的位元組: 4,096  
  26.     
  27. Worker 1 狀態:  
  28.   狀態: EXECUTING                        
  29.   
  30. Export> stop_job           --停止任務   
  31. 是否確實要停止此作業 ([Y]/N): yes  
  32.   
  33. [oracle@linux exp]$ ll  
  34. 總計 120  
  35. -rw-r----- 1 oracle oinstall 114688 10-05 19:09 expdat.dmp   
  36. -rw-r--r-- 1 oracle oinstall   1551 10-05 19:09 export.log  

進入資料庫可以看見執行匯出任務所建立的表

  1. SQL> show user  
  2. USER 為 "SYSTEM"  
  3. SQL> select * from tab where tname = 'EXPFULL';  
  4.   
  5. TNAME                          TABTYPE  CLUSTERID  
  6. ------------------------------ ------- ----------   
  7. EXPFULL                        TABLE  

再次串連到停止的任務

  1. [oracle@linux exp]$ expdp system/oracle@orcl attach=expfull        --串連到停止的使用者。   
  2.   
  3. Export: Release 10.2.0.4.0 - Production on 星期三, 05 10月, 2011 19:13:14  
  4.   
  5. Copyright (c) 2003, 2007, Oracle.  All rights reserved.  
  6.   
  7. 串連到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production  
  8. With the Partitioning, OLAP, Data Mining and Real Application Testing options  
  9.   
  10. 作業: EXPFULL  
  11.   所有者: SYSTEM                           
  12.   操作: EXPORT                           
  13.   建立者許可權: FALSE                            
  14.   GUID: AE8C3CC6E83C634BE040007F010011B4  
  15.   起始時間: 星期三, 05 10月, 2011 19:13:15  
  16.   模式: FULL                             
  17.   執行個體: orcl  
  18.   最大並行度: 1  
  19.   EXPORT 個作業參數:  
  20.   參數名      參數值:  
  21.      CLIENT_COMMAND        system/********@orcl directory=exp full=y job_name=expfull   
  22.   狀態: IDLING                           
  23.   處理的位元組: 0  
  24.   當前並行度: 1  
  25.   作業錯誤計數: 0  
  26.   轉儲檔案: /u01/exp/expdat.dmp  
  27.     寫入的位元組: 114,688  
  28.     
  29. Worker 1 狀態:  
  30.   狀態: UNDEFINED                        
  31.   
  32. Export> start_job              --啟動任務。   
  33.   
  34. Export> continue_client        --退出互動模式,進入記錄模式。   
  35. 作業 EXPFULL 已在 星期三, 05 10月, 2011 19:16  重新開啟  
  36. 重新啟動 "SYSTEM"."EXPFULL":  system/********@orcl directory=exp full=y job_name=expfull   
  37. 處理物件類型 DATABASE_EXPORT/SYSTEM_PROCOBJACT/PROCOBJ  
  38. ... ...  
  39. ... ...  
  40. ... ...  
  41. . . 匯出了 "SYSTEM"."SYS_EXPORT_FULL_01"               13.20 MB    8951 行  
  42. 已成功載入/卸載了主表 "SYSTEM"."EXPFULL"   
  43. ******************************************************************************  
  44. SYSTEM.EXPFULL2 的轉儲檔案集為:  
  45.   /u01/exp/expdat.dmp  
  46. 作業 "SYSTEM"."EXPFULL" 已經完成, 但是有 2 個錯誤 (於 19:17:38 完成)  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.