4 Replies Latest reply: Oct 12, 2012 10:25 AM by 957325 RSS

    ORA-19007 - Schema does not match

    957325
      On my database, we have two schemas with matching tables in each - one for active data and one for data that is being held for longer-term research. Both contain an XMLType column registered to the same schema. However, when I try to insert directly from the active into the archive, I get the following:

      SQL> insert into eci_archv_schema.rev_item_earn_dtl_archv
      2 select * from eci_schema.rev_item_earn_dtl
      3 where ROWNUM = 1;
      insert into eci_archv_schema.rev_item_earn_dtl_archv
      *
      ERROR at line 1:
      ORA-19007: Schema http://xmlns.foo.com/1.3.1/ABC.xsd does not match expected http://xmlns.foo.com/1.3.1/ABC.xsd.

      The only way in which I can successfully move the data from one to the other is to wrap the select in one of the following:

      1. XMLType.createXML(my_xml_column.getCLOBVal())
      2. XMLType.createNonSchemaBasedXML(my_xml_column)

      Both of these take an exceptionally long amount of time to complete and cause my archiving process to be very, very slow. It would appear that because the schemas were registered under different database schemas, they are somehow seen as incompatible. Is this the case or do they actually not match in some other way? Is there an easy way to compare them?

      FYI: We are running 11.2.0.3 but this also occurs on 11.2.0.2. Any help would be appreciated.
        • 1. Re: ORA-19007 - Schema does not match
          odie_63
          It would appear that because the schemas were registered under different database schemas, they are somehow seen as incompatible.
          Possibly.
          Is this the case or do they actually not match in some other way? Is there an easy way to compare them?
          Are both XML schemas identical?
          If so, why not register only one globally and give access to both DB schemas?

          Does XML instances have xsi:schemaLocation or xsi:noNamespaceSchemaLocation attributes?
          Are they the same?

          A test case would be welcome actually.

          Edited by: odie_63 on 3 oct. 2012 18:50
          • 2. Re: ORA-19007 - Schema does not match
            957325
            Thanks! The only place we use schemaLocation is to import an external schema which is, again, the same in both database schemas. What particular information would be helpful: the XSD which we register? I appreciate the help!
            • 3. Re: ORA-19007 - Schema does not match
              odie_63
              What particular information would be helpful: the XSD which we register?
              Yes, including the one you import (if not too big), or a simplified version if possible?

              BTW, is it Object-Relational or Binary XML storage?
              • 4. Re: ORA-19007 - Schema does not match
                957325
                Thanks for the feedback. I think that you have led us in the right direction. We have the same schema registered twice, once under the owner of each table. I am working with our DBAs now to create a test version of these tables using a globally-registered version of the schema. I will post the results.