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

标题: 从11.2.0.4倒入12c报错:ORA-39346 [打印本页]

作者: 郑全    时间: 2017-6-2 23:58
标题: 从11.2.0.4倒入12c报错:ORA-39346
[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:
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');





欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2