日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

Oracle 客户端 使用 expdp/impdp 示例 说明

發布時間:2023/12/13 综合教程 26 生活家
生活随笔 收集整理的這篇文章主要介紹了 Oracle 客户端 使用 expdp/impdp 示例 说明 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一.客戶端使用expdp/impdp說明

有關Oracle expdp/impdp 命令之前也整理了一些文檔,鏈接如下:

exp/imp 與 expdp/impdp 對比 及使用中的一些優化事項

http://blog.csdn.net/tianlesoftware/article/details/6093973

Oracle 10g Data Pump Expdp/Impdp 詳解

http://blog.csdn.net/tianlesoftware/article/details/4674224

Oracle expdp/impdp 使用示例

http://blog.csdn.net/tianlesoftware/article/details/6260138

Oracle expdp/impdp 從高版本 到 低版本 示例

http://blog.csdn.net/tianlesoftware/article/details/6533421

此篇文章主要說明一個觀點:可以客戶端使用expdp/impdp 命令。網上的很多文章都說expdp/impdp 是服務端命令,只能在服務端使用。實際上這種說法有一定的問題,先看官網的一段文字說明:

http://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_overview.htm

Oracle Data Pump is made up of three distinct parts:

(1)The command-lineclients,expdpandimpdp

(2)TheDBMS_DATAPUMPPL/SQLpackage (also known as the Data Pump API)

(3)TheDBMS_METADATAPL/SQLpackage (also known as the Metadata API)

The Data Pumpclients,expdpandimpdp, invoke the Data Pump Export utilityand Data Pump Import utility, respectively.

--Data Pump 客戶端(exdp/impdp)調用Data Pump Export/import工具。

Theexpdpandimpdpclientsuse the procedures provided in theDBMS_DATAPUMPPL/SQL package toexecute export and import commands, using the parameters entered at the commandline. These parameters enable the exporting and importing of data and metadatafor a complete database or for subsets of a database.

--expdp/impdp 客戶端使用DBMS_DATAPUMP 包來執行導出導入操作。

When metadata ismoved, Data Pump uses functionality provided bytheDBMS_METADATAPL/SQL package. TheDBMS_METADATApackageprovides a centralized facility for the extraction, manipulation, andre-creation of dictionary metadata.

TheDBMS_DATAPUMPandDBMS_METADATAPL/SQLpackages can be used independently of the Data Pump clients.

All Data Pump Export and Import processing,including the reading and writing of dump files, is done on the system (server)selected by the specified database connect string.

--所有的dump 文件都會保存在server 上指定的目錄里。

This means thatfor unprivileged users, the database administrator (DBA) must create directoryobjects for the Data Pump files that are read and written on that server filesystem.

以上的文字總結如下:

DataPump 客戶端命令(expdp/impdp)會調用DBMS_DATAPUMPPL/SQLpackage 和DBMS_METADATAPL/SQL包,這2個包是在server 上的,我們在客戶端上執行expdp/impdp。 但是所生成的dump 文件還是存在與server 上指定的directory上。

因此,并不是網上傳說的,expdp/impdp 只能在服務端使用。

二.客戶端使用expdp/impdp示例

服務端版本:

SQL> select * from v$version;

BANNER

--------------------------------------------------------------------------------

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

PL/SQL Release 11.2.0.3.0 - Production

CORE11.2.0.3.0 Production

TNS for Linux: Version 11.2.0.3.0 -Production

NLSRTL Version 11.2.0.3.0 - Production

在服務端創建directory:

SQL> create directory backup as'/u01/backup';

Directory created.

SQL> grant read,write on directory backupto dave;

Grant succeeded.

在客戶端的tnsnames.ora里配置如下:

DG =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.3.11)(PORT = 1521))

)

(CONNECT_DATA =

(SID = dg)

(SERVER = DEDICATED)

)

)

在安裝server 版本的windows 平臺執行expdp命令:

C:\Users\Administrator.DavidDai>expdp dave/dave@dg directory=backup dumpfile=dave.dmp logfile=dave.log schemas=dave

Export: Release11.2.0.1.0 - Production on Thu Dec 15 16:41:56 2011

--注意使用的是11g的expdp

Copyright (c) 1982, 2009, Oracle and/or itsaffiliates. All rights reserved.

Connected to: Oracle Database 11gEnterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Miningand Real Application Testing options

Starting"DAVE"."SYS_EXPORT_SCHEMA_01": dave/********@dg directory=backupdumpfile=dave.dmp logfile=dave.log schemas=dave

Estimate in progress using BLOCKS method...

Processing object typeSCHEMA_EXPORT/TABLE/TABLE_DATA

Total estimation using BLOCKS method: 64 KB

Processing object typeSCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA

Processing object typeSCHEMA_EXPORT/TABLE/TABLE

Processing object typeSCHEMA_EXPORT/TABLE/COMMENT

Processing object typeSCHEMA_EXPORT/TABLE/INDEX/INDEX

Processing object typeSCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT

Processing object typeSCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

. . exported"DAVE"."DAVE" 6.539 KB 31 rows

Master table"DAVE"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded

******************************************************************************

Dump file set for DAVE.SYS_EXPORT_SCHEMA_01is:

/u01/backup/dave.dmp

Job"DAVE"."SYS_EXPORT_SCHEMA_01" successfully completed at16:44:11

成功導出。我們查看一下/u01/backup 目錄:

[root@DG1 u01]# cd /u01/backup/

[root@DG1 backup]# ll

total 168

-rw-r----- 1 oracle oinstall 163840 Dec 1516:44 dave.dmp

-rw-r--r-- 1 oracle oinstall 1322 Dec 15 16:44 dave.log

--清空目錄,為下次expdp 準備:

[root@DG1 backup]# rm -rf *

切換到只安裝了oracle 10g的客戶端的機器上執行expdp:

C:\Users\Administrator>expdp dave/dave@dg directory=backup dumpfile=dave.dmp logfile=dave.log schemas=dave

Export: Release10.2.0.3.0 - Production on 星期四, 15 12月, 2011 16:56:09

--注意expdp 版本:

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

連接到: OracleDatabase 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Produc

tion

With the Partitioning, OLAP, Data Miningand Real Application Testing options

啟動"DAVE"."SYS_EXPORT_SCHEMA_01": dave/********@dg directory=backup dumpfile=

dave.dmp logfile=dave.log schemas=dave

正在使用 BLOCKS 方法進行估計...

處理對象類型SCHEMA_EXPORT/TABLE/TABLE_DATA

使用 BLOCKS 方法的總估計: 64 KB

處理對象類型SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA

處理對象類型SCHEMA_EXPORT/TABLE/TABLE

處理對象類型SCHEMA_EXPORT/TABLE/COMMENT

處理對象類型SCHEMA_EXPORT/TABLE/INDEX/INDEX

處理對象類型 SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT

處理對象類型SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

. . 導出了 "DAVE"."DAVE" 6.539 KB 31 行

已成功加載/卸載了主表"DAVE"."SYS_EXPORT_SCHEMA_01"

******************************************************************************

DAVE.SYS_EXPORT_SCHEMA_01 的轉儲文件集為:

/u01/backup/dave.dmp

作業"DAVE"."SYS_EXPORT_SCHEMA_01" 已于 16:57:58 成功完成

查看備份文件:

[root@DG1 backup]# ll -h

total 168K

-rw-r----- 1 oracle oinstall 160K Dec 1516:57 dave.dmp

-rw-r--r-- 1 oracle oinstall 1.2K Dec 1516:57 dave.log

至此,我們有了一個用10g的expdp 導出了11g的Oracledump文件。現在我們用11g的impdp 導入該dump:

C:\Users\Administrator.DavidDai>impdp dave/dave@dg directory=backup dumpfile=dave.dmp logfile=imp.log schemas=davetable_exists_action=replace

Import: Release 11.2.0.1.0 - Production on Thu Dec 15 17:28:43 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real ApplicationTesting options

Master table "DAVE"."SYS_IMPORT_SCHEMA_01"successfully loaded/unloaded

Starting "DAVE"."SYS_IMPORT_SCHEMA_01": dave/********@dg directory=backupdumpfile=dave.dmp logfile=imp.log schemas=dave table_exists_action=replace

Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA

Processing object type SCHEMA_EXPORT/TABLE/TABLE

Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA

. . imported "DAVE"."DAVE" 6.539 KB 31 rows

Job "DAVE"."SYS_IMPORT_SCHEMA_01" successfullycompleted at 17:29:03

導入成功。 這個說明expdp 從低到高的兼容性是沒有問題,如果從高到低,在expdp時就需要執行version 參數。 這個在之前的鏈接有說明。

小結:

Expdp/impdp可以在客戶端使用,使用時用@指定service Name 就可以了。

-------------------------------------------------------------------------------------------------------

版權所有,文章允許轉載,但必須以鏈接方式注明源地址,否則追究法律責任!

Blog: http://blog.csdn.net/tianlesoftware

Weibo: http://weibo.com/tianlesoftware

Email: tianlesoftware@gmail.com

Skype: tianlesoftware

-------加群需要在備注說明Oracle表空間和數據文件的關系,否則拒絕申請----

DBA1 群:62697716(滿); DBA2 群:62697977(滿)DBA3 群:62697850(滿)

DBA 超級群:63306533(滿); DBA4 群:83829929 DBA5群: 142216823

DBA6 群:158654907 DBA7 群:172855474

道森Oracle,國內最早、最大的網絡語音培訓機構,我們提供專業、優質的Oracle技術培訓和服務!

我們的官方網站:http://www.daosenoracle.com
官方淘寶店:http://daosenpx.taobao.com/

總結

以上是生活随笔為你收集整理的Oracle 客户端 使用 expdp/impdp 示例 说明的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。