Linux下导入dmp文件进oracle数据库

一.导入exp导出的.dmp文件

Linux环境下导入oracle备份数据.dmp文件

  1. 切换至oracle用户下。

2.[oracle@mophee ~]$ imp

  1. Import: Release 11.2.0.1.0 - Production on Fri Jun 29 22:47:10 2018
  2.  
  3. Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
  4.  
  5. Username: INDBADMIN      //输入用户名和密码
  6. Password:
  7.  
  8. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  9. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  10.  
  11. Import data only (yes/no): no > no   //是否只导入数据,建议选no
  12.  
  13. Import file: expdat.dmp > /var/app/finall_dmp/indbadmin.dmp   //数据备份文件路径
  14.  
  15. Enter insert buffer size (minimum is 8192) 30720>     //回车即可
  16.  
  17. Export file created by EXPORT:V11.02.00 via conventional path
  18. import done in US7ASCII character set and UTF8 NCHAR character set
  19. import server uses AL32UTF8 character set (possible charset conversion)
  20. export client uses ZHS16GBK character set (possible charset conversion)
  21. export server uses AL16UTF16 NCHAR character set (possible ncharset conversion)
  22. List contents of import file only (yes/no): no > no   // 只列出倒入文件的内容
  23.  
  24. Ignore create error due to object existence (yes/no): no > no  //由于对象已存在,忽略创建错误
  25.  
  26. Import grants (yes/no): yes > yes  //导入权限
  27.  
  28. Import table data (yes/no): yes > yes   //导入表数据
  29.  
  30. Import entire export file (yes/no): no > yes  //导入整个导出文件

..........

二.导入expdp导出的.dmp文件

//创建oracle用户

create user gzTab identified by gzTab;

//创建表空间

create tablespace ACS_GZHS datafile '/opt/app/oradata/orcl/ACS_GZHS.dbf' size 5000m;

//分配表空间给指定用户

alter user gzTab default tablespace ACS_GZHS;

//创建目标目录

create directory data_dir as '/home/oracle/dmp/user';

//给用户授权

grant create session,create table,create view,create sequence,unlimited tablespace,read,write on directory data_dir to gzTab;

可分为两步

grant create session,create table,create view,create sequence,unlimited tablespace,read,write on directory data_dir to gzTab;

grant read,write on directory data_dir to gzTab;

//上传备份.dmp文件至目标目录,并修改红色部分

impdp gzTab/gzTab@10.10.90.54:1521/orcl EXCLUDE=STATISTICS transform=segment_attributes:n DIRECTORY=data_dir DUMPFILE=ACS_GZHS.DMP  REMAP_SCHEMA=ACS_GZHS:gzTab  full=y

//注意:ACS_GZHS:gzTab  是  表空间:用户名

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值