Archived records are not getting restored even if the record is in the sys_archive_log table


Description


Some archived records are not getting restored. The archive log entry for the record presents the "Restored" field with a date and time value but the record still does not show on the source table.

Cause


The issue is that the archive records xml file that contained the character '&' or '&' are invalid XML characters not allowing the record to get restored

Sample Log When Trying To Restore A Record:


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 

2021-04-26 11:14:51 (962) Default-thread-14 5D70A8851BB32058FC316397624BCB33 txid=7b11a44d1b73 WARNING *** WARNING *** org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 477; Character reference "& #11" is an invalid XML character.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Resolution


The following should fix the issue:


1) Export the archived record from the archive log table as XML


2) Delete the '&' or '&' characters


3) Re-import xml file


4) Restore the archive record

Additional Information


IMPORTANT: The character '>' or '<' are acceptable xml character, no need to remove those.