今天测试部门的同事问从10r2客户端导出11gr2的数据库时遇到了下面的错误怎么办?下面把过程记录一下,相信有不少同学遇到这样的问题.
MOS Note
实际上如果无特殊对象10g exp 是可以导出11g database的,如果你必须使用老版本的客户端且遇到了上面的错误,有时使用 INDEXES=n STATISTICS=none parameters是可以正常导出,原因是当表的统计信息如行数超过了2^31-1的数据限制,导出时用statistics=none或手动清除统计信息的方法解决.
还有一个原因exp 时因为空表(未分配segment)而导致的失败,这是因为11g的新特性叫做deferred segment creation(延迟段创建), 这表空表不会在dba_segments中列出的表.这个新特性受deferred_segment_creation参数的控制,默认值是true,如果设置为false可以禁用了该特性,还有一个方法就是可以手动为空表分配段.
ALTER TABLE <empty table name> ALLOCATE EXTENT;
select 'alter table '|| TABLE_NAME||'ALLOCATE EXTENT;' from user_tables where SEGMENT_CREATED='NO';
TIP:
To have a better performance and more flexibility when exporting from and importing into Oracle10g and higher release databases, we recommend the usage of the Export Data Pump (expdp) and Import Data Pump (impdp) clients
Don't forget: the deferred segment creation applies also to indexes and lobs and Indexes inherit table characteristics.
You can also query the SEGMENT_CREATED column of the USER_TABLES, USER_INDEXES, or USER_LOBS views. For non-partitioned tables, indexes and lobs, this column shows YES, if the segment is created.
However you should not take care of LOBs and LOB indexes extent allocations since they will be allocated automatically by the database once you allocate the corresponding table extent.
Summary
Export/Import compatibility:
1. Export the data with the Export utility of the lowest database version involved.
2. Import the data with the Import utility of the target database.
3. Dump files generated by the Export Data Pump are not compatible with dump files generated by the original Export utility.
4. Exporting with an Oracle7 Export utility from an Oracle9i or higher database is not supported.
回答另一个问题,如何知道导出时的用户名,指写fromuser,给一种方法
references:
MOS note.553377.1 and Kirill Loifman 's note
[oracle@testdb ~]$ exp jsfy/jsfy@devdb file=jsfy11g.dmp
Export: Release 10.2.0.4.0 - Production on Tue Aug 13 11:16:58 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified users ...
. . exporting table NOTICE_INFO_INDEX 6 rows exported
EXP-00008: ORACLE error 1455 encountered
ORA-01455: converting column overflows integer datatype
EXP-00000: Export terminated unsuccessfully复制
MOS Note
Import data into Oracle8i or higher release database.
Matrix 2: Which Export client to use when importing into an Oracle8i 8.1.7
or a higher release target database
(always use the Import client of the target database):
+-----------+--------------------------------------------------------------+
| EXPORT | IMPORT into: |
| from +--------+--------+--------+--------+--------+-----------------+
| \\/ | 8.1.7 | 9.2.0 | 10.1.0 | 10.2.0 | 11.1.0 | 11.2.0 | |
+-----------+--------+--------+--------+--------+--------+--------+--------+
| 5.x 1)2)| EXP5x | EXP5x | EXP5x | EXP5x | EXP5x | EXP5x | |
| 6.x 2)| EXP6x | EXP6x | EXP6x | EXP6x | EXP6x | EXP6x | |
| 7.x 3)| EXP7x | EXP7x | EXP7x | EXP7x | EXP7x | EXP7x | |
+-----------+--------+--------+--------+--------+--------+--------+--------+
| 8.0.3 | EXP803 | EXP803 | EXP803 | EXP803 | EXP803 | EXP803 | |
| 8.0.4 | EXP804 | EXP804 | EXP804 | EXP804 | EXP804 | EXP804 | |
| 8.0.5 | EXP805 | EXP805 | EXP805 | EXP805 | EXP805 | EXP805 | |
| 8.0.6 | EXP806 | EXP806 | EXP806 | EXP806 | EXP806 | EXP806 | |
+-----------+--------+--------+--------+--------+--------+--------+--------+
| 8.1.5 | EXP815 | EXP815 | EXP815 | EXP815 | EXP815 | EXP815 | |
| 8.1.6 | EXP816 | EXP816 | EXP816 | EXP816 | EXP816 | EXP816 | |
| 8.1.7 | EXP817 | EXP817 | EXP817 | EXP817 | EXP817 | EXP817 | |
+-----------+--------+--------+--------+--------+--------+--------+--------+
| 9.0.1 | EXP817 | EXP901 | EXP901 | EXP901 | EXP901 | EXP901 | |
| 9.2.0 | EXP817 | EXP920 | EXP920 | EXP920 | EXP920 | EXP920 | |
+-----------+--------+--------+--------+--------+--------+--------+--------+
| 10.1.0 4)| EXP817 | EXP920 | 4) | |
| 10.2.0 4)| N/S | EXP920 | 4) | |
+-----------+--------+--------+--------+--------+--------+--------+--------+
| 11.1.0 4)| N/S | EXP920*| 4) | 5) | |
| 11.2.0 4)| N/S | EXP920*| 4) | 5) | |
+-----------+--------+--------+--------+--------+--------+--------+--------+复制
实际上如果无特殊对象10g exp 是可以导出11g database的,如果你必须使用老版本的客户端且遇到了上面的错误,有时使用 INDEXES=n STATISTICS=none parameters是可以正常导出,原因是当表的统计信息如行数超过了2^31-1的数据限制,导出时用statistics=none或手动清除统计信息的方法解决.
还有一个原因exp 时因为空表(未分配segment)而导致的失败,这是因为11g的新特性叫做deferred segment creation(延迟段创建), 这表空表不会在dba_segments中列出的表.这个新特性受deferred_segment_creation参数的控制,默认值是true,如果设置为false可以禁用了该特性,还有一个方法就是可以手动为空表分配段.
ALTER TABLE <empty table name> ALLOCATE EXTENT;
select 'alter table '|| TABLE_NAME||'ALLOCATE EXTENT;' from user_tables where SEGMENT_CREATED='NO';
TIP:
To have a better performance and more flexibility when exporting from and importing into Oracle10g and higher release databases, we recommend the usage of the Export Data Pump (expdp) and Import Data Pump (impdp) clients
Don't forget: the deferred segment creation applies also to indexes and lobs and Indexes inherit table characteristics.
You can also query the SEGMENT_CREATED column of the USER_TABLES, USER_INDEXES, or USER_LOBS views. For non-partitioned tables, indexes and lobs, this column shows YES, if the segment is created.
However you should not take care of LOBs and LOB indexes extent allocations since they will be allocated automatically by the database once you allocate the corresponding table extent.
Summary
Export/Import compatibility:
1. Export the data with the Export utility of the lowest database version involved.
2. Import the data with the Import utility of the target database.
3. Dump files generated by the Export Data Pump are not compatible with dump files generated by the original Export utility.
4. Exporting with an Oracle7 Export utility from an Oracle9i or higher database is not supported.
回答另一个问题,如何知道导出时的用户名,指写fromuser,给一种方法
[oracle@testdb ~]$ imp system/oracle file=jsfy11g.dmp fromuser=xxx touser=jsfy
Import: Release 10.2.0.4.0 - Production on Tue Aug 13 11:32:17 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V10.02.01 via conventional path
Warning: the objects were exported by JSFY, not by you
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
IMP-00034: Warning: FromUser "XXX" not found in export file
Import terminated successfully with warnings.复制
references:
MOS note.553377.1 and Kirill Loifman 's note
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
Oracle DataGuard高可用性解决方案详解
孙莹
552次阅读
2025-03-26 23:27:33
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
515次阅读
2025-04-15 17:24:06
XTTS跨版本迁移升级方案(11g to 19c RAC for Linux)
zwtian
419次阅读
2025-04-08 09:12:48
墨天轮个人数说知识点合集
JiekeXu
417次阅读
2025-04-01 15:56:03
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
415次阅读
2025-04-18 14:18:38
Oracle SQL 执行计划分析与优化指南
Digital Observer
412次阅读
2025-04-01 11:08:44
Oracle数据库一键巡检并生成HTML结果,免费脚本速来下载!
陈举超
376次阅读
2025-04-20 10:07:02
Oracle 19c RAC更换IP实战,运维必看!
szrsu
357次阅读
2025-04-08 23:57:08
【活动】分享你的压箱底干货文档,三篇解锁进阶奖励!
墨天轮编辑部
334次阅读
2025-04-17 17:02:24
oracle定时任务常用攻略
virvle
324次阅读
2025-03-25 16:05:19
热门文章
移除DataGuard Standby配置导致Primary启动失败
2023-08-17 21290浏览
使用dblink产生的”SELECT /*+ FULL(P) +*/ * FROM XXXXX P ” 解析
2023-06-20 20891浏览
Troubleshooting 'ORA-28041: Authentication protocol internal error' change password 12c R2 DB
2020-04-08 13637浏览
浅谈ORACLE免费数据库Oracle Database XE (Express Edition) 版
2018-10-31 7585浏览
High wait event ‘row cache mutex’ in 12cR2、19c
2020-08-14 5564浏览