imp,exp实例说明,及导出数据库时报ORA-1455解决办法

数据导出:
1 将数据库TEST完全导出,用户名system 密码password 导出到/home/oracle/databackup中
   exp
system/password@TEST  file=/home/oracle/databack/test.dmp full=y
2 将数据库中system用户与sys用户的表导出
   exp
system/password@TEST  file=/home/oracle/databack/system_sys.dmp  owner=(system,sys)
3 将数据库中的表table1,table2,table3导出
    exp
system/password@TEST file=/home/oracle/databack/tables.dmp tables=(table1,table2,table3)

4 将数据库中的表table1中的字段filed1以"xh"打头的数据导出
   exp
system/password@TEST file=/home/oracle/databack/table1_xh.dmp tables=(table1) query=" where filed1 like 'xh%'"

  上面是常用的导出,对于压缩,既用gzip或者bzip2把dmp文件可以很好的压缩。
  也可以在上面命令后面 加上 compress=y 来实现。

数据的导入
1 将/home/oracle/databack/test.dmp中的数据导入 TEST数据库中。
   imp
system/password@test  file=/home/oracle/databack/test.dmp
   imp
system/password@test full=y   file=/home/oracle/databack/test.dmp ignore=y
   上面可能有点问题,因为有的表已经存在,然后它就报错,对该表就不进行导入。
   在后面加上 ignore=y 就可以了,忽略错误信息,正确表可正常导入。
2 将/home/oracle/databack/tables.dmp中的表table1 导入
imp
system/password@TEST  /home/oracle/databack/test.dmp  tables=(table1)

3.如果是某个用户的所有数据导入,可以先将这个用户从数据库中删除,并删除其所有数据,重建用户。

再导入数据,避免已存在的信息导致导入失败。

 

 

注:ORA-1455 可能是导出工具的客户端版本低于服务器版本所致,只需将ORACLE客户端升级到与服务器相同版本或更高版本即可。
oracle 11.2.0.1.0 版本客户端导出11g数据时可能遇到 ORA-01455: 转换列溢出整数数据类型
这个错误可能时这个版本客户端的BUG,下载11.2.0.3.0客户端,即可解决问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值