ORA-39346: data loss in character set conversion for object TABLE_STATISTICS:"GBO_DB"."DESPATCH_HEADER"
As a workaround, re-gather histogram data after executing impdp, e.g.
SQL> exec dbms_stats.gather_table_stats ('<OWNER>', '<TABLE NAME>', 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 <USER>/<PASSWORD> tables=<TABLE NAME> directory=<DIRECTORY NAME> exclude=table_statistics
SQL> exec dbms_stats.gather_table_stats ('<OWNER>', '<TABLE NAME>', method_opt => 'FOR ALL COLUMNS');
exec dbms_stats.gather_table_stats ('<OWNER>', '<TABLE NAME>', method_opt => 'FOR ALL COLUMNS');
exec dbms_stats.gather_table_stats ('GBO_DB', 'DESPATCH_HEADER', method_opt => 'FOR ALL COLUMNS');
exec dbms_stats.gather_table_stats ('GBO_DB', 'INVENTORY_ADJUST_LINE', method_opt => 'FOR ALL COLUMNS');
As a workaround, re-gather histogram data after executing impdp, e.g.
SQL> exec dbms_stats.gather_table_stats ('<OWNER>', '<TABLE NAME>', 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 <USER>/<PASSWORD> tables=<TABLE NAME> directory=<DIRECTORY NAME> exclude=table_statistics
SQL> exec dbms_stats.gather_table_stats ('<OWNER>', '<TABLE NAME>', method_opt => 'FOR ALL COLUMNS');
exec dbms_stats.gather_table_stats ('<OWNER>', '<TABLE NAME>', method_opt => 'FOR ALL COLUMNS');
exec dbms_stats.gather_table_stats ('GBO_DB', 'DESPATCH_HEADER', method_opt => 'FOR ALL COLUMNS');
exec dbms_stats.gather_table_stats ('GBO_DB', 'INVENTORY_ADJUST_LINE', method_opt => 'FOR ALL COLUMNS');
Thank You for the tip!
ReplyDeleteIt fixed a similar issue for me.
Fredrik