DUMP 導入導出


Oracle數據庫dump導入和導出

版權聲明:本文為博主原創文章,未經博主允許不得轉載。原創不易,轉載請注明出處。 https://blog.csdn.net/sinat_27933301/article/details/80101108

1、建立dump文件存放目錄,並授權給Oracle用戶。

mkdir /data/sharedata/mydump chown -R oracle:oinstall /data/sharedata/mydump
  • 1
  • 2

2、配置Oracle環境變量

ORACLE_HOME=/oralce/product/11.2.0.4/dbhome PATH=$ORACLE_HOME:$PATH
  • 1
  • 2

3、啟動Oracle監聽器

打開監聽器:lsnrctl start 查看監聽器運行狀態:lsnrctl status
  • 1
  • 2

4、啟動Oracle實例

sqlplus / as sysdba startup
  • 1
  • 2

5、建立共享目錄

create directory mydump as '/data/sharedata/mydump'
  • 1

6、建立Oracle表空間

7、dump導入命令

impdp \'/ as sysdba\' directory=mydump dumpfile=mydb.dmp table_exists_action=replace
  • 1

8、dump導出命令

expdp \'/ as sysdba\' SCHEMAS=TEST directory=mydump dumpfile=mydb.dmp logfile=mydb.log
  • 1

 

數據庫dump導入

數據庫dump導入

一、導入命令介紹:

Oracle dump數據導入導出有兩種方式:imp/expimpdp/expdp。兩者區別:

1、exp/imp客戶端程序,受網絡,磁盤的影響;impdp/expdp服務器端程序,只受磁盤的影響。

2、exp常規方式是使用SELECT的方式查詢數據庫中的數據,是需要通過buffer cache並通過sql的語句處理層再轉移至exp的導出文件。這個過程的數據流向是:(1)數據通過select的方式,將數據由文件系統加載至buffer cache(數據庫緩存)(2)由pga(用戶進程,每一個連接都會對應一個pga)將緩存的數據通過網絡傳輸到客戶端生成文件。Exp直接路徑模式則是直接從磁盤上將數據轉移至exp的導出文件,所以速度更快expdp是exp的升級版,對文件進行了壓縮和並行處理,所以速度最快。

二、數據導入步驟

1、創建用戶

    create user res_xj identified by q1w2e3R$ default tablespace general;

     grant dba to res_xj;

2、創建表空間

create tablespace INDX_GEN

  datafile 'E:\oradata\resdb\INDX_GEN01.dbf' size 5000M

  autoextend on

  next 5000M

  maxsize 30000M

  extent management local;

 

3、建文件目錄 create or replace directory dump_dir as 'H:\cq_resdata_dump';

 

4、導入語句

impdp res_xj/q1w2e3R$ DIRECTORY=dump_dir dumpfile=expdp_20161014_xj.dmp logfile=imp_20161108.log FULL=Y TABLE_EXISTS_ACTION=replace

具體參數,請上網搜索。

三、注意事項

1、注意表空間大小。

2、導入時,注意導出的數據庫和導入的數據庫的版本。

3、如果第一次導入有問題,終止了導入,第二次導入請加上TABLE_EXISTS_ACTION=replace,不然數據庫已經存在的對象,此次導入將忽略。沒有導完的數據也將忽略。

 

 

 

What is Oracle dump?

 

Oracle dump file (.DMP) is a binary storage used by Oracle users and database administrators to backup data. ... The problem is that Oracle dump file is a "black box" and there is no way to extract data from such files except the standard IMP tool. However, this utility can import data to Oracle server only.

Direct export from Oracle dump files

 

 

Oracle dump file (.DMP) is a binary storage used by Oracle users and database administrators to backup data. Oracle distribution pack includes the standard tool EXP for this purpose. The problem is that Oracle dump file is a "black box" and there is no way to extract data from such files except the standard IMP tool. However, this utility can import data to Oracle server only. But what if you just need to access the data without Oracle database server? Or maybe you want to migrate Oracle dump file into another data format? Definitely, Oracle IMP tool is not a convenient solution for these tasks.

 

Even if you have live instance of Oracle server, there are a lot of possible issues you may experience when importing a dump file:

 

  • upward/backward compatibility of different Oracle versions
  • character set conversion when NLS_LANG parameter of the dump file is not the same as Oracle server settings
  • mapping data into another schema (it's necessary if structure of source Oracle database is different from the one stored in dump file)

 

Intelligent Converters have investigated Oracle dump format and released a collection of tools to read and export data to the most popular data sources. This is OraDump Export Kit, product to convert Oracle dump files into Microsoft SQL, Microsoft Access, Microsoft Excel, MySQL and CSV. It does direct reading from dump file, so Oracle components are not required. The product supports all versions of Oracle and has no limitations on file size. Fast algorithm of direct reading can process more than 5 GB per hour on average modern system.

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM