重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 9898|回复: 0
打印 上一主题 下一主题

从11.2.0.4倒入12c报错:ORA-39346

[复制链接]
跳转到指定楼层
楼主
发表于 2017-6-2 23:58:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[size=130%]Histogram Data is Corrupted After Importing Data Using Impdp or ORA-39346 is Raised While Executing Impdp (文档 ID 2105130.1)

Applies to:   Oracle Database - Enterprise Edition - Version 11.1.0.7 to 11.2.0.4 [Release 11.1 to 11.2]
Information in this document applies to any platform.

SymptomsHistogram data is corrupted after importing data using impdp or ORA-39346 is raised while importing data (in Oracle 12c) under following conditions:
  • Table has NVARCHAR2 column or NCHAR column, and multibyte data is inserted in.
  • Above columns have histogram data.
  • Expdp is done in Oracle 11.2.0.4 or prior release.
Version matrix of the reproducibility for this problem:
Source DBTarget DBHistogram corrupted?ORA-39346 raised?
11.1.0.711.1.0.7YesNo
11.1.0.711.2.0.4YesNo
11.1.0.712.1.0.2YesYes
11.2.0.411.2.0.4YesNo
11.2.0.412.1.0.2YesYes
12.1.0.112.1.0.1NoNo
12.1.0.212.1.0.2NoNo

NOTE:
The error ORA-39346 was introduced in Oracle 12c to check the data.
CauseThis problem was investigated in unpublished Bug 22095029 - ORA-39346 WHILE IMPORTING DATA WHICH IS INCLUDING NVARCHAR2 DATA and concluded that it is a restriction in 12c.
The documentation Bug 23722728 was created to correct the 12c documentation. In the "Exporting and Importing Between Different Database Releases" section of chapter 1, the following bullet item has been added:

"Importing Oracle Database 11g dump files that contain table statistics into Oracle Database 12c Release 1 (12.1) or later results in an Oracle ORA-39346 error.
This is because Oracle Database 11g dump files contain table statistics as metadata, whereas Oracle Database 12c Release 1 (12.1) and later expect table statistics to be presented as table data.
The workaround is to ignore the error and after the import operation completes, regather table statistics."


SolutionAs a workaround, re-gather histogram data after executing impdp, e.g.
SQL> exec dbms_stats.gather_table_stats ('TEST', 'TEST_TAB', method_opt => 'FOR ALL COLUMNS');
To avoid the corruption or ORA-39346 error, you can use exclude=table_statistics option while executing impdp, then re-gather histogram data.
> impdp test/test tables=test_tab directory=exp_dir exclude=table_statistics

SQL> exec dbms_stats.gather_table_stats ('TEST', 'TEST_TAB', method_opt => 'FOR ALL COLUMNS');
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-5-5 13:55 , Processed in 0.076212 second(s), 19 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表