Monday 9 September 2019

ORA-39346: data loss in character set conversion for object TABLE_STATISTICS:"GBO_DB"."DESPATCH_HEADER"

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');

1 comment:

  1. Thank You for the tip!
    It fixed a similar issue for me.

    Fredrik

    ReplyDelete

Featured post

Postgres commads

 [oracle@Tesdb ~]$ systemctl status postgresql-15 ● postgresql-15.service - PostgreSQL 15 database server    Loaded: loaded (/usr/lib/system...