Run these queries first (as the sde user) to see how many records are orphaned:select count(*) from sde_xml_doc1 where sde_xml_id not in (select sde_xml_id from sde_xml_doc1 where sde_xml_id in (select definition from sde.gdb_items));select count(*) from sde_xml_doc2 where sde_xml_id not in (select sde_xml_id from sde_xml_doc2 where sde_xml_id in (select documentation from sde.gdb_items));select count(*) from sde_xml_doc3 where sde_xml_id not in (select sde_xml_id from sde_xml_doc3 where sde_xml_id in (select iteminfo from sde.gdb_items));select count(*) from sde_xml_doc4 where sde_xml_id not in (select sde_xml_id from sde_xml_doc4 where sde_xml_id in (select attributes from sde.gdb_itemrelationships));============Run the following sql (as the sde user) to clean up the tables. This will delete orphaned xmldocs:delete from sde_xml_doc1 where sde_xml_id not in (select sde_xml_id from sde_xml_doc1 where sde_xml_id in (select definition from sde.gdb_items));delete from sde_xml_doc2 where sde_xml_id not in (select sde_xml_id from sde_xml_doc2 where sde_xml_id in (select documentation from sde.gdb_items));delete from sde_xml_doc3 where sde_xml_id not in (select sde_xml_id from sde_xml_doc3 where sde_xml_id in (select iteminfo from sde.gdb_items));delete from sde_xml_doc4 where sde_xml_id not in (select sde_xml_id from sde_xml_doc4 where sde_xml_id in (select attributes from sde.gdb_itemrelationships));