4 Replies Latest reply on Sep 25, 2013 7:57 PM by KnightOfBlueArmor

    Deleting Schemas:  What am I missing?




      I am on - 64bit Production.


      I have deleted a schema using DBMS_XMLSCHEMA.DELETESSCHEMA and delete_option 3.


      I have then also deleted the resource using DBMS_XDB.DELETERESOURCE.


      I then execute the XMLTYPE schemaValidate method on a record that was based on the schema just deleted and the result is an error that could only occur if the schema as still there (being more than one occurrence of an element that must have only one occurrence).


      What am I missing?





      Context:  This is a development database and I am trying to replace an incorrect schema without having to spend a lot of time (slow performing system) migrating data using that schema.

        • 1. Re: Deleting Schemas:  What am I missing?

          Could you provide a test case so that we can reproduce without too much guessing ?

          • 2. Re: Deleting Schemas:  What am I missing?

            I will have to get back to you on that one.  I have a deadline to deploy a change by.  I have worked out a kludge to get it in for the moment.  I will try to get a test case up in the next 48 hours.

            • 3. Re: Deleting Schemas:  What am I missing?

              OK.  I have formulated a hypothesis while trying to get together a test case for this forum and Oracle support.


              Originally I replaced the XSD only as a resource using the DBMS_XDB.DELETERESOURCE method.  Life went on and eventually testing hit an error that lead me to believe I should have done something more.


              I then discovered the DBMS_XMLSCHEMA.DELETESSCHEMA method and tried to use that in conjunction with the DBMS_XDB.DELETERESOURCE method.  It was after this, when I could see the schema said one thing but the XMLTYPE schemaValidate method said something different, that I started this discussion and raised an Oracle Support call.


              Since then, I have been restoring the DB and repeating tests in order to produce a test case, but everything has then been working as expected.


              Hypothesis:  Removing the XSD originally using only the DBMS_XDB.DELETERESOURCE method left the system in some sort of inconsistent state that the subsequent use of the DBMS_XMLSCHEMA.DELETESSCHEMA method could not correct.


              Thanks to anyone who spent some time giving this some consideration.

              • 4. Re: Deleting Schemas:  What am I missing?

                The same thing happened to me....