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