DataPump Import Of XMLTYPE Fails With Errors ORA-31693 ORA-29913 ORA-31011 ORA-19202 LPX-217 Invalid Character (Doc ID 1391688.1)

Last updated on NOVEMBER 28, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.2 to 11.2.0.3 [Release 11.2]
Information in this document applies to any platform.
***Checked for relevance on 05-Dec-2014***

Symptoms

In 10gR2, in a table with an XMLTYPE column you inserted valid specific characters (conform the database character set). Then imported this table into 11.2.0.2. If now you export this table using expdp version 11.2.0.2 and import it, then you will see the errors:

ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00217: invalid character 8221 (U+201D)


like demonstrated below:

-- in 10gR2 with charset WE8MSWIN1252
connect / as sysdba

create or replace directory tmp as '/tmp';

create user test identified by test default tablespace users temporary tablespace temp;
grant connect, resource to test;

connect test/test

create table test_xmltype (id number, text sys.xmltype);

insert into test_xmltype values (1, '<A_TAG>Simple text</A_TAG>');
insert into test_xmltype values (2, '<B_TAG>Text with 0x201D: |&#x201D;|</B_TAG>');
commit;

host expdp system/password directory=tmp dumpfile=test_xmltype.dmp tables=test.test_xmltype

-- in 11.2.0.2 with charset WE8MSWIN1252
host impdp system/password directory=tmp dumpfile=test_xmltype.dmp full=y

-- export again using expdp 11.2.0.2
connect / as sysdba

create or replace directory tmp as '/tmp';

host expdp system/password directory=tmp dumpfile=test_xmltype_11202.dmp tables=test.test_xmltype

-- import the table back from the new dump
host impdp system/password directory=tmp dumpfile=test_xmltype_11202.dmp full=y table_exists_action=replace


This will show:

...
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
ORA-31693: Table data object "TEST"."TEST_XMLTYPE" failed to load/unload and
is being skipped due to error:
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00217: invalid character 8221 (U+201D)

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms