Oracle資料庫exp/imp 命令使用

來源:互聯網
上載者:User

一、資料庫中的表TRPW_SAMPLE100HZ匯出和匯入方式

1)、匯出

C:\Windows\system32>exp sa/liuxuezong@rtsos file=d:\test.dmp tables=(TRPW_SAMPLE100HZ

)

 

Export: Release 10.2.0.1.0 - Production on 星期五 2月 17 08:59:49 2012

 

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

 

 

串連到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

已匯出 ZHS16GBK 字元集和 AL16UTF16 NCHAR 字元集

 

即將匯出指定的表通過常規路徑...

. . 正在匯出表                TRPW_SAMPLE100HZ匯出了           2 行

成功終止匯出, 沒有出現警告。

 

C:\Windows\system32>

2)、匯入

C:\Windows\system32>imp sa/liuxuezong@rtsos file=d:\test.dmp tables=(TRPW_SAMPLE100HZ

) ignore=y

 

ignore=y功能主要防止資料中已經存在該表,匯入資料時會提示報錯。

Import: Release 10.2.0.1.0 - Production on 星期五 2月 17 08:57:18 2012

 

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

 

 

串連到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

 

經由常規路徑由 EXPORT:V10.02.01 建立的匯出檔案

已經完成 ZHS16GBK 字元集和 AL16UTF16 NCHAR 字元集中的匯入

. 正在將 SA 的對象匯入到 SA

. 正在將 SA 的對象匯入到 SA

. . 正在匯入表              "TRPW_SAMPLE100HZ"匯入了           2 行

成功終止匯入, 沒有出現警告。

 

C:\Windows\system32>

 

二、資料庫中sa使用者的表匯出和匯入方式

1)、匯出

C:\Windows\system32>exp sa/liuxuezong@rtsos file=d:\rtsos.dmp owner=(sa)

 

Export: Release 10.2.0.1.0 - Production on 星期五 2月 17 09:22:09 2012

 

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

 

 

串連到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

已匯出 ZHS16GBK 字元集和 AL16UTF16 NCHAR 字元集

 

即將匯出指定的使用者...

. 正在匯出 pre-schema 過程對象和操作

. 正在匯出使用者 SA 的外部函數庫名

. 匯出 PUBLIC 類型同義字

. 正在匯出專用類型同義字

. 正在匯出使用者 SA 的物件類型定義

即將匯出 SA 的對象...

. 正在匯出資料庫連結

. 正在匯出序號

. 正在匯出簇定義

. 即將匯出 SA 的表通過常規路徑...

. . 正在匯出表                TRPW_SAMPLE100HZ匯出了           2 行

. 正在匯出同義字

. 正在匯出視圖

. 正在匯出預存程序

. 正在匯出運算子

. 正在匯出參考完整性約束條件

. 正在匯出觸發器

. 正在匯出索引類型

. 正在匯出位元影像, 功能性索引和可擴充索引

. 正在匯出後期表活動

. 正在匯出實體化視圖

. 正在匯出快照日誌

. 正在匯出作業隊列

. 正在匯出重新整理組和子組

. 正在匯出維

. 正在匯出 post-schema 過程對象和操作

. 正在匯出統計資訊

成功終止匯出, 沒有出現警告。

 

C:\Windows\system32>

 

2)、匯入

C:\Windows\system32>imp sa/liuxuezong@rtsos file=d:\rtsos.dmp full=y ignore=y

 

Import: Release 10.2.0.1.0 - Production on 星期五 2月 17 09:49:12 2012

 

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

 

 

串連到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

 

經由常規路徑由 EXPORT:V10.02.01 建立的匯出檔案

已經完成 ZHS16GBK 字元集和 AL16UTF16 NCHAR 字元集中的匯入

. 正在將 SA 的對象匯入到 SA

. 正在將 SA 的對象匯入到 SA

. . 正在匯入表              "TRPW_SAMPLE100HZ"匯入了           2 行

成功終止匯入, 沒有出現警告。

 

C:\Windows\system32>

三、說明

         如果您只是想匯出個別表,可以使用第一個方法;如果您想匯出整個使用者表,可以使用第二個方法。在使用imp命令匯入資料時,可能出現拒絕錯誤:ORA-00001: 違反唯一約束條件,您可以忽略該項,要保持匯入表的資料一致性,最簡單的方法是刪除該表全資料,不少情況要先是將該表徹底刪除,然後再匯入備份的資料表檔案。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.