您的位置:首页 > 数据库 > Oracle

Oracle数据库备份异机恢复(exp/imp)故障案例

2016-03-24 13:44 651 查看
源端: 192.168.6.10 db

目标端:192.168.6.11 db10g

从192.168.6.10中exp导出两张表,其中通过scp将dmp文件拷贝至192.168.6.11服务器后imp导入错误,提示文件头有异常

源端服务器导出如下:

[oracle@db ~]$ exp test/test file='/home/oracle/test.dmp' tables=t1,test

Export: Release 11.2.0.4.0 - Production on Thu Mar 24 12:57:18 2016

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export done in US7ASCII character set and AL16UTF16 NCHAR character set

server uses ZHS16GBK character set (possible charset conversion)

About to export specified tables via Conventional Path ...

. . exporting table T1 1 rows exported

EXP-00091: Exporting questionable statistics.

. . exporting table TEST 6 rows exported

EXP-00091: Exporting questionable statistics.

Export terminated successfully with warnings.

在源端服务器上测试导入正常:(因源端存在该对象,故提示跳过)

[oracle@db ~]$ imp test/test file='/home/oracle/test.dmp' fromuser=test touser=test

Import: Release 11.2.0.4.0 - Production on Thu Mar 24 12:58:54 2016

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V11.02.00 via conventional path

import done in US7ASCII character set and AL16UTF16 NCHAR character set

import server uses ZHS16GBK character set (possible charset conversion)

. importing TEST's objects into TEST

IMP-00015: following statement failed because the object already exists:

"CREATE TABLE "T1" ("ID" NUMBER, "NAME" VARCHAR2(2)) PCTFREE 10 PCTUSED 40 "

"INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 FRE"

"ELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) LOGGING "

"NOCOMPRESS"

IMP-00015: following statement failed because the object already exists:

"CREATE TABLE "TEST" ("ID" NUMBER) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRAN"

"S 255 STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 FREELISTS 1 FREELIST "

"GROUPS 1 BUFFER_POOL DEFAULT) LOGGING NOCOMPRESS"

Import terminated successfully with warnings.

[oracle@db ~]$

将exp的备份dmp文件scp到目标服务器导入失败:

[root@db oracle]# scp test.dmp 192.168.6.11:/home/oracle

root@192.168.6.11's password:

test.dmp 100% 16KB 16.0KB/s 00:00

oracle@db10g:orcl$imp test/test file='/home/oracle/test.dmp' fromuser=test touser=test

Import: Release 10.2.0.5.0 - Production on Thu Mar 24 12:58:36 2016

Copyright (c) 1982, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

IMP-00010: not a valid export file, header failed verification

IMP-00000: Import terminated unsuccessfully

说明:

(1)异机传输备份文件,建议使用bin模式的ftp传输;

(2)要定期验证备份文件的可恢复性;异机恢复时,务必正常恢复后再将主端备份删除或者进行主端硬件维护等风险性操作。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: