Inplace Schema Evolution

Mark,
You said in Nov. 2005:
"We did demo the process in our pod in the Oracle Database campgrounds. FYI, for the four simple examples we were using, the current copy/evolve process would take approx 8 mins to handle 10000 of our standard purchaseorder documents, the inplace evolution would complete in less than 4 seconds."
I am wondering if this functionality is released to the public yet.

This functionality will be made available in a future release of the database. Due to compliance reasons I cannot say which release or when that release will become available in a public forum.

Similar Messages

  • Errors when using inplace schema evolution

    Hi, i have been having some issues when attempting to use inplace schema evolution to add a new element into an existing xsd file currently registered on the database and was looking for some help with this if possible.
    Firstly, Oracle details are as follows :
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE     11.2.0.2.0     Production"
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - ProductionThe xsd registered on the database is called truncheadtest2.xsd :
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XMLSpy v2009 sp1 (http://www.altova.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
         <xs:element name="title">
              <xs:simpleType>
                   <xs:restriction base="xs:string"/>
              </xs:simpleType>
         </xs:element>
         <xs:element name="clientRiskEventHeader" xdb:defaultTable="EVLN_CLIENTRISKEVENTHEADER">
              <xs:complexType xdb:SQLType="EVLN_CLIENTRISKEVENTHEADER_T">
                   <xs:sequence>
                        <xs:element ref="title" xdb:SQLName="TITLE"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>registered via :
    BEGIN
      DBMS_XMLSCHEMA.registerSchema(
       SCHEMAURL => 'http://xmlns.kfis.co.uk/testevheader/xsdin/truncheadertest.xsd',
      SCHEMADOC => XDBURIType('/public/web_quotes/header/xsd/test/SchemaTest/truncheadtest2.xsd').getCLOB());
    END;i have then created a new xsd, to add the new element to the xsd (using minoccurs to allow backwards compatibility between xml files conforming to the 1st xsd and this new xsd), called truncheadtestfn3.xsd :
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XMLSpy v2009 sp1 (http://www.altova.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
         <xs:element name="title">
              <xs:simpleType>
                   <xs:restriction base="xs:string"/>
              </xs:simpleType>
         </xs:element>
         <xs:element name="forename">
              <xs:simpleType>
                   <xs:restriction base="xs:string"/>
              </xs:simpleType>
         </xs:element>
         <xs:element name="clientRiskEventHeader" xdb:defaultTable="EVLN_CLIENTRISKEVENTHEADER">
              <xs:complexType xdb:SQLType="EVLN_CLIENTRISKEVENTHEADER_T">
                   <xs:sequence>
                        <xs:element ref="title" xdb:SQLName="TITLE"/>
                        <xs:element ref="forename" minOccurs="0" xdb:SQLName="FORENAME"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>I can run the following code to create the difference doc between the 2 versions of the schema document, without errors:
    DECLARE
       schemaDiff XMLType;
       res boolean;
    BEGIN
       SELECT xmlDiff
            xdburitype('/public/web_quotes/header/xsd/test/SchemaTest/truncheadtest2.xsd').getXML(),
            xdburitype('/public/web_quotes/header/xsd/test/SchemaTest/truncheadtestfn3.xsd').getXML()
       INTO schemaDiff
       FROM dual;
       IF (dbms_xdb.existsResource('/public/web_quotes/header/xsd/test/SchemaTest/header.xml')) THEN
           dbms_xdb.deleteResource('/public/web_quotes/header/xsd/test/SchemaTest/header.xml');
       END IF;
       res :=
         dbms_xdb.createResource('/public/web_quotes/header/xsd/test/SchemaTest/header.xml',schemaDiff);
         dbms_xmlschema.inPlaceEvolve('http://xmlns.kfis.co.uk/testevheader/xsdin/truncheadertest.xsd',schemaDiff,2);
    END;
    / which creates the following xml file:
    - <xd:xdiff xsi:schemaLocation="http://xmlns.oracle.com/xdb/xdiff.xsd http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <?oracle-xmldiff operations-in-docorder="true" output-model="snapshot" diff-algorithm="global"?>
    - <xd:insert-node-before xd:node-type="element" xd:xpath="/xs:schema[1]/xs:element[2]">
    - <xd:content>
    - <xs:element name="forename">
    - <xs:simpleType>
      <xs:restriction base="xs:string" />
      </xs:simpleType>
      </xs:element>
      </xd:content>
      </xd:insert-node-before>
    - <xd:append-node xd:node-type="element" xd:parent-xpath="/xs:schema[1]/xs:element[2]/xs:complexType[1]/xs:sequence[1]">
    - <xd:content>
      <xs:element ref="forename" minOccurs="0" xdb:SQLName="FORENAME" />
      </xd:content>
      </xd:append-node>
      </xd:xdiff>However, when i then run the inplace schema evolution code for option 1, i get the following error:
    Error report:
    ORA-22324: altered type has compilation errors
    ORA-22328: object "WEB_STAGING"."EVLN_CLIENTRISKEVENTHEADER_T" has errors.
    PLS-00215: String length constraints must be in range (1 .. 32767)
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 173
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 231
    ORA-06512: at line 17
    22324. 00000 -  "altered type has compilation errors"
    *Cause:    The use of the ALTER TYPE statement caused a compilation error.
    *Action:   Correct the error reported and resubmit the statement.I am getting this issue when attempting to add any string value to the existing xsd and i was wondering if you had any idea what the issue was here and how i could resolve this.
    Thanks.

    Hi,
    When you use INPLACE_TRACE flag, it traces the operations that would be performed with option 1.
    If you look at the trace file produced in this case, you'll see where the error is coming from :
    ------------ QMTS Executing SQL ------------
    ALTER TYPE "TEST"."EVLN_CLIENTRISKEVENTHEADER_T" ADD ATTRIBUTE "FORENAME" VARCHAR2 CASCADE NOT INCLUDING TABLE DATA
    /The mandatory length specification is absent.
    I thought adding an explicit xs:maxLength restriction would solve the problem, but it happens the generated DDL still lacks the length specification.
    After some tries, I found that the issue seems related to the usage of ref elements in the schema.
    On a side note, it's not the first time we see problems associated with ref (Cf. how do i get xml db to work right with imported or included schemas?).
    The workaround is to use a named type.
    I've also added an xdb:defaultTable annotation to the top-level element ("title") so that the registration process doesn't generate a table for it :
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
         <xs:element name="title" xdb:defaultTable="">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                     <xs:maxLength value="200"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:simpleType name="forenameType">
              <xs:restriction base="xs:string">
                   <xs:maxLength value="30"/>
              </xs:restriction>
         </xs:simpleType>
         <xs:element name="clientRiskEventHeader" xdb:defaultTable="EVLN_CLIENTRISKEVENTHEADER">
              <xs:complexType xdb:SQLType="EVLN_CLIENTRISKEVENTHEADER_T">
                   <xs:sequence>
                        <xs:element ref="title" xdb:SQLName="TITLE"/>
                        <xs:element name="forename" type="forenameType" minOccurs="0" xdb:SQLName="FORENAME"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>

  • Copy Evolve Schema Evolution Fails

    Oracle 11gr2 on Linux VM
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 22 13:51:28 2012
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Enter user-name: jmendez
    Enter password:
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production I've been able to get schema evolution to work without data in the table (doesnt help much). When I have data in the table I get the following error message:
    BEGIN
      2    DBMS_XMLSCHEMA.copyEvolve(
      3      xdb$string_list_t('http://localhost/xsd/test/collection_test_3.xsd'),
      4      XMLSequenceType(XDBURIType('/u01/app/xsd/test/collection_evolve_3.xsd').getXML()),
      5      XMLSequenceType(XDBURIType('/u01/app/xsd/test/collection_evolve_3.xsl').getXML()));
      6  END;
      7  /
    BEGIN
    ERROR at line 1:
    ORA-30942: XML Schema Evolution error for schema
    'http://localhost/xsd/test/collection_test_3.xsd' table
    "JMENDEZ"."COLLECTION_TEST" column 'XML_DATA'
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: '()'
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 153
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 221
    ORA-06512: at line 2I've registered the schema's and loaded revised schema and xsl style sheets into the database. Before I try schema evolution I create the proper context and xml indexes and run a few queries with sample data. This works just fine. I drop the indexes prior to starting schema evolution and run the above command. It fails every time.
    CREATE TABLE collection_test
        NAID     NUMBER not null enable,
        opa_counter     number,
        xml_data      XMLType not null enable,
        desc_type      varchar2(25 byte),
        constraint "PK_CL_NAID" Primary key ("NAID")
      XMLTYPE COLUMN "XML_DATA" STORE AS BASICFILE CLOB
      XMLSCHEMA "http://localhost/xsd/test/collection_test_3.xsd" ELEMENT "collection";
    INSERT INTO COLLECTION_TEST(naid,XML_DATA) VALUES (111112,XMLTYPE('<collection>
          <collectionIdentifier>AAS</collectionIdentifier>
          <dataControlGroup>ou\=NW,ou\=groups,dc\=das,dc\=nara,dc\=gov</dataControlGroup>
          <dateApproved>
             <day>3</day>
             <month>12</month>
             <year>2001</year>
          </dateApproved>
          <dateEntered>
             <day>3</day>
             <month>12</month>
             <year>2001</year>
          </dateEntered>
          <descriptionType>6021989</descriptionType>
          <inclusiveEndDate>
             <year>1926</year>
          </inclusiveEndDate>
          <inclusiveStartDate>
             <year>1923</year>
          </inclusiveStartDate>
          <isUnderEdit>false</isUnderEdit>
          <naId>766</naId>
          <organizationalDonorArray>
             <organizationName>
                <naId>6505115</naId>
             </organizationName>
          </organizationalDonorArray>
          <title>American Antiquarian Society Collection</title>
          <variantControlNumberArray>
             <variantControlNumber>
                <number>AAS</number>
                <variantControlNumberType>
                   <naId>6044072</naId>
                </variantControlNumberType>
             </variantControlNumber>
          </variantControlNumberArray>
       </collection>')); I've used mapforce to generate my XSL file.
    I can't seem to find the right resource online for my problem. Any help or redirection is greatly appreciated. Thanks
    -jjm
    Edited by: jjmdb on Feb 22, 2012 10:51 AM

    I am testing schema evolution in a test environment. I'm only changing the xsd file and adding a new element (fullTitle) and having the data that copied from title to fulltitle.
    BEFORE
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    - Description : Collections XML schema
    -->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="0.3">
         <!--
          - Include document detailing common Archival Types
        -->
         <xs:include schemaLocation="ArchivalTypes.xsd"/>
         <!--
          - Main XML definition
        -->
         <xs:element name="collection" type="coll_type"/>
         <xs:complexType name="coll_type">
              <xs:sequence>
                   <xs:element name="approvedBy" type="xs:string" minOccurs="0"/>
                   <xs:element name="collectionIdentifier" type="xs:string" minOccurs="0"/>
                   <xs:element name="coverageEndDate" type="qualifiableDate" minOccurs="0"/>
                   <xs:element name="coverageStartDate" type="qualifiableDate" minOccurs="0"/>
                   <xs:element name="dataControlGroup" type="xs:string" minOccurs="0"/>
                   <xs:element name="dateApproved" type="dasDate" minOccurs="0"/>
                   <xs:element name="dateEntered" type="dasDate" minOccurs="0"/>
                   <xs:element name="dateNote" type="xs:string" minOccurs="0"/>
                   <xs:element name="descriptionAuthorArray" type="descriptionAuthorArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="descriptionDateArray" type="dasDateArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="descriptionType" type="xs:long" minOccurs="0"/>
                   <xs:element name="enteredBy" type="xs:string" minOccurs="0"/>
                   <xs:element name="findingAidArray" type="findingAidArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="formerlyContainedArray" type="seriesArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="inclusiveEndDate" type="qualifiableDate" minOccurs="0"/>
                   <xs:element name="inclusiveStartDate" type="qualifiableDate" minOccurs="0"/>
                   <xs:element name="isUnderEdit" type="xs:boolean" minOccurs="0"/>
                   <xs:element name="naId" type="xs:long" minOccurs="1"/>
                   <xs:element name="organizationalDonorArray" type="organizationNameArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="personalDonorArray" type="personArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="preliminaryDescriptionArray" type="preliminaryDescriptionArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="scopeAndContentNote" type="xs:string" minOccurs="0"/>
                   <xs:element name="seriesArray" type="seriesArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="staffOnlyNote" type="xs:string" minOccurs="0"/>
                   <xs:element name="title" type="xs:string" minOccurs="0"/>
                   <xs:element name="variantControlNumberArray" type="variantControlNumberArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>
    AFTER
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    - Description : Collections XML schema
    -->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="0.3">
         <!--
          - Include document detailing common Archival Types
        -->
         <xs:include schemaLocation="ArchivalTypes.xsd"/>
         <!--
          - Main XML definition
        -->
         <xs:element name="collection" type="coll_type"/>
         <xs:complexType name="coll_type">
              <xs:sequence>
                   <xs:element name="approvedBy" type="xs:string" minOccurs="0"/>
                   <xs:element name="collectionIdentifier" type="xs:string" minOccurs="0"/>
                   <xs:element name="coverageEndDate" type="qualifiableDate" minOccurs="0"/>
                   <xs:element name="coverageStartDate" type="qualifiableDate" minOccurs="0"/>
                   <xs:element name="dataControlGroup" type="xs:string" minOccurs="0"/>
                   <xs:element name="dateApproved" type="dasDate" minOccurs="0"/>
                   <xs:element name="dateEntered" type="dasDate" minOccurs="0"/>
                   <xs:element name="dateNote" type="xs:string" minOccurs="0"/>
                   <xs:element name="descriptionAuthorArray" type="descriptionAuthorArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="descriptionDateArray" type="dasDateArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="descriptionType" type="xs:long" minOccurs="0"/>
                   <xs:element name="enteredBy" type="xs:string" minOccurs="0"/>
                   <xs:element name="findingAidArray" type="findingAidArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="formerlyContainedArray" type="seriesArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="inclusiveEndDate" type="qualifiableDate" minOccurs="0"/>
                   <xs:element name="inclusiveStartDate" type="qualifiableDate" minOccurs="0"/>
                   <xs:element name="isUnderEdit" type="xs:boolean" minOccurs="0"/>
                   <xs:element name="naId" type="xs:long" minOccurs="1"/>
                   <xs:element name="organizationalDonorArray" type="organizationNameArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="personalDonorArray" type="personArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="preliminaryDescriptionArray" type="preliminaryDescriptionArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="scopeAndContentNote" type="xs:string" minOccurs="0"/>
                   <xs:element name="seriesArray" type="seriesArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                   <xs:element name="staffOnlyNote" type="xs:string" minOccurs="0"/>
                   <xs:element name="title" type="xs:string" minOccurs="0"/>
                   <xs:element name="fullTitle" type="xs:string" minOccurs="0"/>
                   <xs:element name="variantControlNumberArray" type="variantControlNumberArray" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>XSLT
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    This file was generated by Altova MapForce 2012sp1
    YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
    OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
    Refer to the Altova MapForce Documentation for further details.
    http://www.altova.com/mapforce
    -->
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:core="http://www.altova.com/MapForce/UDF/core" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" exclude-result-prefixes="core xs fn">
         <xsl:template name="core:convert-uri-to-windows-file-path">
              <xsl:param name="uri" select="()"/>
              <xsl:choose>
                   <xsl:when test="fn:starts-with($uri, 'file://')">
                        <xsl:choose>
                             <xsl:when test="(fn:substring($uri, xs:double('6'), xs:double('3')) = '///')">
                                  <xsl:variable name="var1_resultof_url_decode" as="xs:string">
                                       <xsl:call-template name="core:url-decode">
                                            <xsl:with-param name="uri" select="fn:substring($uri, xs:double('9'), xs:double(fn:string-length($uri)))" as="xs:string"/>
                                       </xsl:call-template>
                                  </xsl:variable>
                                  <xsl:sequence select="fn:translate($var1_resultof_url_decode, '/|', '\:')"/>
                             </xsl:when>
                             <xsl:otherwise>
                                  <xsl:sequence select="$uri"/>
                             </xsl:otherwise>
                        </xsl:choose>
                   </xsl:when>
                   <xsl:otherwise>
                        <xsl:sequence select="$uri"/>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template name="core:url-decode">
              <xsl:param name="uri" select="()"/>
              <xsl:choose>
                   <xsl:when test="fn:contains($uri, '%')">
                        <xsl:variable name="var1_resultof_url_decode_part" as="xs:string">
                             <xsl:call-template name="core:url-decode-part">
                                  <xsl:with-param name="uripart" select="fn:substring-after($uri, '%')" as="xs:string"/>
                             </xsl:call-template>
                        </xsl:variable>
                        <xsl:sequence select="fn:concat(fn:substring-before($uri, '%'), $var1_resultof_url_decode_part)"/>
                   </xsl:when>
                   <xsl:otherwise>
                        <xsl:sequence select="$uri"/>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template name="core:url-decode-part">
              <xsl:param name="uripart" select="()"/>
              <xsl:variable name="var1_resultof_dec_from__digits_hex" as="xs:decimal">
                   <xsl:call-template name="core:dec-from-2digits-hex">
                        <xsl:with-param name="hex" select="$uripart" as="xs:string"/>
                   </xsl:call-template>
              </xsl:variable>
              <xsl:choose>
                   <xsl:when test="($var1_resultof_dec_from__digits_hex &lt; xs:decimal('128'))">
                        <xsl:call-template name="core:url-decode-utf8">
                             <xsl:with-param name="value" select="$var1_resultof_dec_from__digits_hex" as="xs:decimal"/>
                             <xsl:with-param name="bytes" select="xs:decimal('0')" as="xs:decimal"/>
                             <xsl:with-param name="rest" select="fn:substring($uripart, xs:double('3'), xs:double(fn:string-length($uripart)))" as="xs:string"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:when test="($var1_resultof_dec_from__digits_hex &lt; xs:decimal('194'))">
                        <xsl:call-template name="core:url-decode">
                             <xsl:with-param name="uri" select="fn:substring($uripart, xs:double('3'), xs:double(fn:string-length($uripart)))" as="xs:string"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:when test="($var1_resultof_dec_from__digits_hex &lt; xs:decimal('224'))">
                        <xsl:call-template name="core:url-decode-utf8">
                             <xsl:with-param name="value" select="$var1_resultof_dec_from__digits_hex" as="xs:decimal"/>
                             <xsl:with-param name="bytes" select="xs:decimal('1')" as="xs:decimal"/>
                             <xsl:with-param name="rest" select="fn:substring($uripart, xs:double('3'), xs:double(fn:string-length($uripart)))" as="xs:string"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:when test="($var1_resultof_dec_from__digits_hex &lt; xs:decimal('240'))">
                        <xsl:call-template name="core:url-decode-utf8">
                             <xsl:with-param name="value" select="$var1_resultof_dec_from__digits_hex" as="xs:decimal"/>
                             <xsl:with-param name="bytes" select="xs:decimal('2')" as="xs:decimal"/>
                             <xsl:with-param name="rest" select="fn:substring($uripart, xs:double('3'), xs:double(fn:string-length($uripart)))" as="xs:string"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:when test="($var1_resultof_dec_from__digits_hex &lt; xs:decimal('245'))">
                        <xsl:call-template name="core:url-decode-utf8">
                             <xsl:with-param name="value" select="$var1_resultof_dec_from__digits_hex" as="xs:decimal"/>
                             <xsl:with-param name="bytes" select="xs:decimal('3')" as="xs:decimal"/>
                             <xsl:with-param name="rest" select="fn:substring($uripart, xs:double('3'), xs:double(fn:string-length($uripart)))" as="xs:string"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:otherwise>
                        <xsl:sequence select="''"/>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template name="core:dec-from-2digits-hex">
              <xsl:param name="hex" select="()"/>
              <xsl:variable name="var1_resultof_dec_from__digit_hex" as="xs:decimal">
                   <xsl:call-template name="core:dec-from-1digit-hex">
                        <xsl:with-param name="hex" select="fn:substring($hex, xs:double('1'), xs:double('1'))" as="xs:string"/>
                   </xsl:call-template>
              </xsl:variable>
              <xsl:variable name="var2_resultof_dec_from__digit_hex" as="xs:decimal">
                   <xsl:call-template name="core:dec-from-1digit-hex">
                        <xsl:with-param name="hex" select="fn:substring($hex, xs:double('2'), xs:double('1'))" as="xs:string"/>
                   </xsl:call-template>
              </xsl:variable>
              <xsl:sequence select="(($var1_resultof_dec_from__digit_hex * xs:decimal('16')) + $var2_resultof_dec_from__digit_hex)"/>
         </xsl:template>
         <xsl:template name="core:url-decode-utf8">
              <xsl:param name="value" select="()"/>
              <xsl:param name="bytes" select="()"/>
              <xsl:param name="rest" select="()"/>
              <xsl:choose>
                   <xsl:when test="($bytes = xs:integer('0'))">
                        <xsl:variable name="var1_resultof_char_from_code" as="xs:string">
                             <xsl:call-template name="core:char-from-code">
                                  <xsl:with-param name="code" select="xs:integer($value)" as="xs:integer"/>
                             </xsl:call-template>
                        </xsl:variable>
                        <xsl:variable name="var2_resultof_url_decode" as="xs:string">
                             <xsl:call-template name="core:url-decode">
                                  <xsl:with-param name="uri" select="$rest" as="xs:string"/>
                             </xsl:call-template>
                        </xsl:variable>
                        <xsl:sequence select="fn:concat($var1_resultof_char_from_code, $var2_resultof_url_decode)"/>
                   </xsl:when>
                   <xsl:when test="(fn:substring($rest, xs:double('1'), xs:double('1')) = '%')">
                        <xsl:variable name="var3_resultof_cast" as="xs:double" select="xs:double(fn:string-length($rest))"/>
                        <xsl:variable name="var4_resultof_dec_from__digits_hex" as="xs:decimal">
                             <xsl:call-template name="core:dec-from-2digits-hex">
                                  <xsl:with-param name="hex" select="fn:substring($rest, xs:double('2'), $var3_resultof_cast)" as="xs:string"/>
                             </xsl:call-template>
                        </xsl:variable>
                        <xsl:call-template name="core:url-decode-utf8">
                             <xsl:with-param name="value" select="((($value mod xs:decimal('64')) * xs:decimal('64')) + ($var4_resultof_dec_from__digits_hex mod xs:decimal('64')))" as="xs:decimal"/>
                             <xsl:with-param name="bytes" select="($bytes - xs:decimal('1'))" as="xs:decimal"/>
                             <xsl:with-param name="rest" select="fn:substring($rest, xs:double('4'), $var3_resultof_cast)" as="xs:string"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:otherwise>
                        <xsl:call-template name="core:url-decode">
                             <xsl:with-param name="uri" select="$rest" as="xs:string"/>
                        </xsl:call-template>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template name="core:dec-from-1digit-hex">
              <xsl:param name="hex" select="()"/>
              <xsl:variable name="var1_resultof_string_length" as="xs:integer" select="fn:string-length(fn:substring-before('0123456789ABCDEFabcdef', $hex))"/>
              <xsl:choose>
                   <xsl:when test="($var1_resultof_string_length &lt;= xs:integer('15'))">
                        <xsl:sequence select="$var1_resultof_string_length"/>
                   </xsl:when>
                   <xsl:otherwise>
                        <xsl:sequence select="($var1_resultof_string_length - xs:decimal('6'))"/>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template name="core:char-from-code">
              <xsl:param name="code" select="()"/>
              <xsl:sequence select="fn:codepoints-to-string($code)"/>
         </xsl:template>
         <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
         <xsl:template match="/">
              <xsl:variable name="var1_resultof_document" as="node()" select="."/>
              <xsl:variable name="var2_resultof_convert_uri_to_windows_file_path" as="xs:string">
                   <xsl:call-template name="core:convert-uri-to-windows-file-path">
                        <xsl:with-param name="uri" select="fn:document-uri($var1_resultof_document)" as="xs:string"/>
                   </xsl:call-template>
              </xsl:variable>
              <xsl:result-document href="{$var2_resultof_convert_uri_to_windows_file_path}" encoding="UTF-8">
                   <collection>
                        <xsl:attribute name="xsi:noNamespaceSchemaLocation" namespace="http://www.w3.org/2001/XMLSchema-instance" select="'C:/Users/Javier/Documents/XML/XSD/collection_evolve_2.xsd'"/>
                        <xsl:for-each select="$var1_resultof_document/collection">
                             <xsl:variable name="var3_title" as="node()?" select="title"/>
                             <xsl:for-each select="approvedBy">
                                  <approvedBy>
                                       <xsl:sequence select="fn:string(.)"/>
                                  </approvedBy>
                             </xsl:for-each>
                             <xsl:for-each select="collectionIdentifier">
                                  <collectionIdentifier>
                                       <xsl:sequence select="fn:string(.)"/>
                                  </collectionIdentifier>
                             </xsl:for-each>
                             <xsl:for-each select="coverageEndDate">
                                  <coverageEndDate>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </coverageEndDate>
                             </xsl:for-each>
                             <xsl:for-each select="coverageStartDate">
                                  <coverageStartDate>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </coverageStartDate>
                             </xsl:for-each>
                             <xsl:for-each select="dataControlGroup">
                                  <dataControlGroup>
                                       <xsl:sequence select="fn:string(.)"/>
                                  </dataControlGroup>
                             </xsl:for-each>
                             <xsl:for-each select="dateApproved">
                                  <dateApproved>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </dateApproved>
                             </xsl:for-each>
                             <xsl:for-each select="dateEntered">
                                  <dateEntered>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </dateEntered>
                             </xsl:for-each>
                             <xsl:for-each select="dateNote">
                                  <dateNote>
                                       <xsl:sequence select="fn:string(.)"/>
                                  </dateNote>
                             </xsl:for-each>
                             <xsl:for-each select="descriptionAuthorArray">
                                  <descriptionAuthorArray>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </descriptionAuthorArray>
                             </xsl:for-each>
                             <xsl:for-each select="descriptionDateArray">
                                  <descriptionDateArray>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </descriptionDateArray>
                             </xsl:for-each>
                             <xsl:for-each select="descriptionType">
                                  <descriptionType>
                                       <xsl:sequence select="xs:string(xs:integer(fn:string(.)))"/>
                                  </descriptionType>
                             </xsl:for-each>
                             <xsl:for-each select="enteredBy">
                                  <enteredBy>
                                       <xsl:sequence select="fn:string(.)"/>
                                  </enteredBy>
                             </xsl:for-each>
                             <xsl:for-each select="findingAidArray">
                                  <findingAidArray>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </findingAidArray>
                             </xsl:for-each>
                             <xsl:for-each select="formerlyContainedArray">
                                  <formerlyContainedArray>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </formerlyContainedArray>
                             </xsl:for-each>
                             <xsl:for-each select="inclusiveEndDate">
                                  <inclusiveEndDate>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </inclusiveEndDate>
                             </xsl:for-each>
                             <xsl:for-each select="inclusiveStartDate">
                                  <inclusiveStartDate>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </inclusiveStartDate>
                             </xsl:for-each>
                             <xsl:for-each select="isUnderEdit">
                                  <isUnderEdit>
                                       <xsl:sequence select="xs:string(xs:boolean(fn:string(.)))"/>
                                  </isUnderEdit>
                             </xsl:for-each>
                             <naId>
                                  <xsl:sequence select="xs:string(xs:integer(fn:string(naId)))"/>
                             </naId>
                             <xsl:for-each select="organizationalDonorArray">
                                  <organizationalDonorArray>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </organizationalDonorArray>
                             </xsl:for-each>
                             <xsl:for-each select="personalDonorArray">
                                  <personalDonorArray>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </personalDonorArray>
                             </xsl:for-each>
                             <xsl:for-each select="preliminaryDescriptionArray">
                                  <preliminaryDescriptionArray>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </preliminaryDescriptionArray>
                             </xsl:for-each>
                             <xsl:for-each select="scopeAndContentNote">
                                  <scopeAndContentNote>
                                       <xsl:sequence select="fn:string(.)"/>
                                  </scopeAndContentNote>
                             </xsl:for-each>
                             <xsl:for-each select="seriesArray">
                                  <seriesArray>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </seriesArray>
                             </xsl:for-each>
                             <xsl:for-each select="staffOnlyNote">
                                  <staffOnlyNote>
                                       <xsl:sequence select="fn:string(.)"/>
                                  </staffOnlyNote>
                             </xsl:for-each>
                             <xsl:for-each select="$var3_title">
                                  <title>
                                       <xsl:sequence select="fn:string(.)"/>
                                  </title>
                             </xsl:for-each>
                             <xsl:for-each select="$var3_title">
                                  <fullTitle>
                                       <xsl:sequence select="fn:string(.)"/>
                                  </fullTitle>
                             </xsl:for-each>
                             <xsl:for-each select="variantControlNumberArray">
                                  <variantControlNumberArray>
                                       <xsl:sequence select="(./@node(), ./node())"/>
                                  </variantControlNumberArray>
                             </xsl:for-each>
                        </xsl:for-each>
                   </collection>
              </xsl:result-document>
         </xsl:template>
    </xsl:stylesheet>Edited by: jjmdb on Feb 22, 2012 11:42 AM

  • XDB schema evolution help

    Hello,
    I am currently working on a proof of concept using Oracle's XMLTYPE. I have successfully registered a schema and created a table that has an XMLTYPE column that is bound to the registered schema. Everything works perfect - invalid XML docs are rejected and valid XML docs are inserted without error.
    I am now working through schema evolution. Since it is unlikely that our schemas will change drastically, I am testing the inplaceevolve functionality.
    I have written a quick procedure and it looks like the evolve is working without error. Doing a quick SELECT * FROM USER_XML_SCHEMAS shows that the schema was updated - awesome!
    When I go to insert an XML document through my client, it inserts fine with no errors! However, when I try to view the row in the SQL Navigator I get the following error.
    ORA-30991: cannot use DOM to add special attribute to schema-based parent
    I can still view the old documents but none of the new ones - what could I be missing?
    Thanks for looking and especially any help provided.
    Best!
    Brian

    Got the issue resoved.
    Initially the schema was created in the local domain of the user. The updated schema was registered in the public domain.
    The table Name301_TAB was therefore created under the user domain and the CopyEvolve() function was looking for the function in Public domain.
    Thanks for the help.

  • Schema evolution success! But new node is empty in XMLTYPE column?

    Hi everyone!
    Quick question. I am working through the XML Schema evolution process and was able to use inplaceevolve successfully. I can see the new node added to my schema under user_xml_schemas. However, when I try to upload an XML document with that new node, it shows up in the stored XML as empty?
    Here are some more details...
    I added the assistant nickname element
    <element name="spousePartner" nillable="true" minOccurs="0" type="xsd:string" />
    <element name="title" nillable="true" minOccurs="0" type="xsd:string" />
    *<element name="assistantNickName" nillable="true" minOccurs="0" type="xsd:string" />*
    and I see it was added in my registered schema.
    I then add the node to my test XML and in my program's console I see the node being parsed...
    physicalStreet>10 Green St</physicalStreet>
    <salutation>Ms.</salutation>
    <title>CEO</title>
    *<assistantNickName>Big Bird</assistantNickName>*
    </contact>
    However, when I look at the stored XML in my XMLTYPE column, I see an empty node...
    <physicalStreet>10 Green St</physicalStreet>
    <salutation>Ms.</salutation>
    <title>CEO</title>
    *<assistantNickName/>*
    </contact>
    What am I missing?
    Any help is greatly appreciated - thank you much!

    Hi,
    Are you using BINARY XML?
    I've just tested the following with object-relational storage (not binary) :
    Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    Connected as dev
    SQL> var schema1 varchar2(4000);
    SQL> var schema2 varchar2(4000);
    SQL> BEGIN
      2   :schema1 := '<?xml version="1.0" encoding="UTF-8"?>
      3  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      4             xmlns:xdb="http://xmlns.oracle.com/xdb">
      5   <xs:element name="root" xdb:SQLName="root">
      6    <xs:complexType xdb:SQLType="ROOT_TYPE">
      7     <xs:sequence>
      8      <xs:element name="item" maxOccurs="unbounded" xdb:SQLCollType="ITEM_COLL">
      9       <xs:complexType xdb:SQLType="ITEM_TYPE">
    10        <xs:sequence>
    11         <xs:element name="Code" type="xs:string"/>
    12         <xs:element name="Val" type="xs:integer"/>
    13        </xs:sequence>
    14       </xs:complexType>
    15      </xs:element>
    16     </xs:sequence>
    17    </xs:complexType>
    18   </xs:element>
    19  </xs:schema>'
    20  ;
    21 
    22  :schema2 := '<?xml version="1.0" encoding="UTF-8"?>
    23  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    24             xmlns:xdb="http://xmlns.oracle.com/xdb">
    25   <xs:element name="root" xdb:SQLName="root">
    26    <xs:complexType xdb:SQLType="ROOT_TYPE">
    27     <xs:sequence>
    28      <xs:element name="item" maxOccurs="unbounded" xdb:SQLCollType="ITEM_COLL">
    29       <xs:complexType xdb:SQLType="ITEM_TYPE">
    30        <xs:sequence>
    31         <xs:element name="Code" type="xs:string"/>
    32         <xs:element name="Val" type="xs:integer"/>
    33         <xs:element name="Comm" type="xs:string" minOccurs="0"/>
    34        </xs:sequence>
    35       </xs:complexType>
    36      </xs:element>
    37     </xs:sequence>
    38    </xs:complexType>
    39   </xs:element>
    40  </xs:schema>'
    41  ;
    42  END;
    43  /
    PL/SQL procedure successfully completed
    SQL> BEGIN
      2   dbms_xmlschema.registerSchema(
      3    schemaURL => 'schema1.xsd',
      4    schemaDoc => :schema1,
      5    local => true,
      6    genTypes => true,
      7    genTables => false
      8   );
      9  END;
    10  /
    PL/SQL procedure successfully completed
    SQL> CREATE TABLE test_evolve OF XMLTYPE
      2  XMLTYPE STORE AS OBJECT RELATIONAL
      3  XMLSCHEMA "schema1.xsd" ELEMENT "root"
      4  ;
    Table created
    SQL> INSERT INTO test_evolve
      2  VALUES(
      3   xmltype('<root>
      4   <item><Code>A</Code><Val>1</Val></item>
      5   <item><Code>B</Code><Val>2</Val></item>
      6   <item><Code>C</Code><Val>3</Val></item>
      7  </root>')
      8  );
    1 row inserted
    SQL> COMMIT;
    Commit complete
    SQL> DECLARE
      2 
      3   xdiff xmltype;
      4 
      5  BEGIN
      6 
      7   select xmldiff(
      8           xmltype(:schema1),
      9           xmltype(:schema2)
    10          )
    11   into xdiff
    12   from dual;
    13 
    14   dbms_xmlschema.InPlaceEvolve(
    15    schemaURL => 'schema1.xsd',
    16    diffXML => xdiff,
    17    flags => dbms_xmlschema.INPLACE_EVOLVE
    18   );
    19 
    20  END;
    21  /
    PL/SQL procedure successfully completed
    SQL> INSERT INTO test_evolve
      2  VALUES(
      3   xmltype('<root>
      4   <item><Code>A</Code><Val>1</Val><Comm>This a comment</Comm></item>
      5   <item><Code>B</Code><Val>2</Val></item>
      6   <item><Code>C</Code><Val>3</Val></item>
      7  </root>')
      8  );
    1 row inserted
    SQL> SELECT t.object_value.getClobVal()
      2  FROM test_evolve t
      3  WHERE xmlexists('/root/item/Comm' passing t.object_value);
    T.OBJECT_VALUE.GETCLOBVAL()
    <root>
      <item>
        <Code>A</Code>
        <Val>1</Val>
        <Comm>This a comment</Comm>
      </item>
      <item>
        <Code>B</Code>
        <Val>2</Val>
      </item>
      <item>
        <Code>C</Code>
        <Val>3</Val>
      </item>
    </root>
    The new element has been added correctly.

  • Generate XSL from XSD ?

    Please let me know the steps involved .
    I need to generate XSL's from XSD's created in my application where am using IBM RSA 7.0 .
    After generating XSD am converting the same into XML but i could be wrong doing so as it shows errors in my xml file.
    My approach is to generate XML file from XSD and then using XSLT feature of RSA create xsl files. But it's not working as am getting errors.
    Any inputs or example or different approach would help greatly.
    My Thanks in advance for tips.

    Have a look at the topic XML Schema Evolution in the XML DB Development Guide that is the same version as your database. Use inplace Schema evolution if your on 11gRx

  • Schema-based xmltype table

    Below mentioned is the schema-based xmltype table
    CREATE TABLE BRSK.MEDV_brpubdoc_tab OF XMLType
    XMLSCHEMA "http://xmlns.oracle.com/xdb/schemas/BRSK/www.medversation.com/brpubdoc/brpubdoc.xsd"
    ELEMENT "brpubdoc"
    TABLESPACE BRSK_M;
    when ever delete the old schema and register the new schema should i drop the previous xmltype table and create the new one?If this is the case then we will be losing the previous xml contents.Is there is a way to avoid drop and creation on xmltype table on schema delete and schema registration.Please help me out on this.

    I hava gone through the below mentioned link http://download-east.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb07evo.htm which states In prior releases an XML schema, once registered with Oracle XML DB at a particular URL, could not be modified or evolved because there may be XMLType tables that depend on the XML schema. There was no standard procedure for schema evolution. This release supports XML schema evolution by providing a PL/SQL procedure CopyEvolve() a part of the DBMS_XMLSCHEMA package. CopyEvolve() involves copying existing instance documents to temporary tables, dropping and re-registering the XML schema, and copying the instance documents to the new XMLType tables.So i think schema evolution works in 10g only

  • Question on Avro schema management

    Hi,
    in our use case, we need to generate Avro schema on the fly (given some business object structure) and install with Oracle NoSQL. I have
    the following questions:
    1. Is there an API to install the Avro schema in NoSQL. Ideally we'd like to avoid using the command line tool for this (and also creating
    a .avsc file)
    2. Any recommended way to make the Avro schema available on the client? Ideally we don't want to use any file system operations
    for this. Would it be a reasonable way to store the Avro schema itself as a String in NoSQL and then when the client connects to NoSQL,
    first thing it does is read the schemata stored in NoSQL and parse them?
    On another topic, are there any performance penalties using JsonAvroBinding vs. GenericAvroBinding. Our objects are all JSON so we'd
    like to use JsonAvroBinding, however we'd go the extra mile and use GenericAvroBinding if that performs better.
    Best Regards and thanks in advance for your answer,
    Ralf

    Hello Ralf,
    1. Is there an API to install the Avro schema in NoSQL. Ideally we'd like to avoid using the command line tool for this (and also creating a .avsc file)No, there is no administrative API currently available. So currently, I think this would have to be done using a script that is invoked by your application and that uses the NoSQL DB admin CLI.
    2. Any recommended way to make the Avro schema available on the client? Ideally we don't want to use any file system operations for this. Would it be a reasonable way to store the Avro schema itself as a String in NoSQL and then when the client connects to NoSQL, first thing it does is read the schemata stored in NoSQL and parse them?The begs the question of how you'll do schema evolution. Will there ever be multiple versions of the same Avro schema (more than one version having the same schema name) in your application? If so, there will be additional complications with the approach you're taking.
    If not (if there will only ever be one version of a given schema), you can use the latest (only) version of a schema on the client. In that case you can call AvroCatalog.getCurrentSchemas to get the schemas you need. If a schema you recently added is not in the returned map, call AvroCatalog.refreshSchemaCache followed by AvroCatalog.getCurrentSchemas.
    On another topic, are there any performance penalties using JsonAvroBinding vs. GenericAvroBinding. Our objects are all JSON so we'd like to use JsonAvroBinding, however we'd go the extra mile and use GenericAvroBinding if that performs better.They should have similar performance characteristics -- they do essentially the same thing -- but I would guess that in general JsonAvroBinding is slightly faster than GenericAvroBinding, based on my knowledge of the Avro and Jackson code. However, we have not done any performance testing to compare them. It is possible that the answer depends on the schema you're using. So you should do your own testing, if you're concerned about minor performance differences.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to sync schema changes?

    Hi everybody,
    my question is:
    if I made some changes in application schema on desktop database (e.g. alter table, add constraint or else) how could I sync these changes with mobile schema?
    I've tried to re-package application with Packaging Wizard and then run mSync on PDA side, but nothing had changed.
    What is the right way to complete the task?
    Best regards,
    Roman.

    Hi
    Unfortunately, you cannot rely on republishing for schema evolutions. Behavior is quite odd (for instance, i change column length, it does nothing, and then i add a column, and it works perfectly for both changes).
    I've open a TAR on the subject, and was told to use Consolidator API.
    If you do not want to use the API, there seems to be a way, but it's pretty uneasy to do (need all your users to have synched at a certain date, need to recreate repository ...); here's a copyand paste of that method (i got it on metalink forum) :
    "I manage a mobile schema of 135 tables and I have found that the ONLY reliable way to deploy schema revisions is to drop and recreate my repository. I have spent time on the phone with Oracle regarding a few issues, and the end result is that simply republishing my Mobile app does not work 100% of the time and odd bugs pop up where tables refresh over and over and never get in sync, or some tables never sync up correctly at all, or the structure doesn't update on the PDA. The repository simply gets "out-of-whack" or corrupted.
    Furthermore, anytime you make DDL changes to the base backend tables on which your Mobile schema is based, you must republish your application. This is documented, I believe. Republishing the Mobile schema _should_ simply cause your clients to get out of sync and require a full refresh. Your results may vary with 10.0.0.0.x
    With my app, I only do maintenance every 90 days or so, so I have all
    clients sync by Friday of the weekend of maintenance, and I rebuild my Mobile repositories over the weekend. I do have different customers on different servers so I can do rolling maintenance. It is becoming less acceptable to recreate repositories as our customer base is growing and more users are added to one Mobile server.
    If you can get by with a simply republish, by all means do so because if you do recreate the Mobile schema you must recreate users, and the users will require a full database refresh.
    1) Make sure all your users have synched any modified records or they will lose their updates
    2) Configure and activate tracing on the Mobile server
    3) Stop Mobile server
    4) Do your DDL on the backend tables
    5) Restart Mobile server
    6) Republish your JAR file
    7) Try a sync, you should get full refresh. Try a 2nd sync. If you get another full refresh, you are hitting the same bug I've seen and you will then probably either have to log a TAR and provide Oracle with lots of tracing information (which you should have if you
    did step 1) "
    good luck
    JC

  • How to set dom fidelity to false on an already registered schema

    How to set dom fidelity to false on an already registered schema
    Thanks
    Message was edited by:
    uraees

    I guess that you will have to annotate the schema via updating schema or inserting the "xdb annotation" to deactivate the DOM fidelity. Reasoning from the most difficult situation that objects (XMLType objects created via registering the schema) are linked to the schema, this is probably not a supported way to do it.
    Schema evolution is supported though, this would be the supported way to do it...
    Do you have more info (including the database version in use)?

  • New to XML and Oracle

    Just trying to clarify some issues as I try and learn about XML, and specifically how it integrates into the DB.
    1 - Is there a way with Oracle tools for me to get an XSD of an existing 9i relational schema? We are not currently using the XML DB, but our middleware developers would like to have an up to date XSD to use for their internal mapping.
    2 - Is there any way that I can keep that XSD up-to-date automatically, so I get a new one whenever the schema gets updated?
    3 - If I wanted to investigate storing XML docs within the DB in native XML format, I need to have an XML DB, correct? Is this DB construct maintained seperatelly from my "normal" relational schema? or are they kept in sync by Oracle?
    I know these may all be real basic questions, but as I said, I'm new to XML and Oracle. I am reading as much as I can, but there are a lot of docs out there.
    Thanks,
    Mike

    Hi
    1. On my opinion such a tool doesn't exists. Some parts can be implemented elsewhere, but not as described by you... e.g. with XSU if you specify the parameter "withschema" the XSD of the executed statement is generated. Another example is to use DBMS_METADATA to dump the data dictionary in XML (but not XSD, of course you could write your own XSLT to do this transformation...).
    2. -
    3. If you use XSD-based tables the XSD and the relational model are stored separately in the data dictionary. Therefore if you change the XSD you have to drop/create the XSD-based table... no schema evolution yet.
    Chris

  • Error while creating the Unique Index of the Primary Key of an Item

    Hi all,
    I have deployed a new item (CO_CONTRACTUNIT_PRODUCT) in my publication. The deploy appears to be successfull as the item can be seen in the repository through the Mobile Manager.
    The problem occurs when i sync my local DB to get the item offline. While synchronizing, the following error appears, both in the sync window and the log file ol_sync.log.
    "ERROR",POL-5130,"11/09/2010 11:43:52","table or view %s.%s not found:CO_CONTRACTUNIT_PRODUCT,CO_CONTRACTID,OD_PRODUCTID,CO_CONTRACTUNITID","DB_ROSHNI"
    However, the debug file gives this other error regarding this table.
    ALL_INDEX:CREATE UNIQUE INDEX "TPCO_CONTRACTUNIT_PRODUCT_PK" ON CO_CONTRACTUNIT_PRODUCT (CO_CONTRACTID,OD_PRODUCTID,CO_CONTRACTUNITID) -5130Error at C:\ADE\omeprod_ol103021\olite\db\build\win\ocapi\..\..\..\src\ocapi\allindexes.cpp line:329 rc:-5130
    Build date Mar 29 2010
    okErr=(table or view %s.%s not found)
    mess=(CO_CONTRACTUNIT_PRODUCT,CO_CONTRACTID,OD_PRODUCTID,CO_CONTRACTUNITID)
    AddLog(-5130 "ERROR",POL-5130,"11/09/2010 11:43:52","table or view %s.%s not found:CO_CONTRACTUNIT_PRODUCT,CO_CONTRACTID,OD_PRODUCTID,CO_CONTRACTUNITID","DB_ROSHNI")
    But the index that is being created and is giving the error is the index created automatically with the Primary Key of the table, and so nothing has been modified in that.
    The primary key of the table is created with the three columns that are part of the index that is returning the error.
    As I could not solve the error, I tried to drop and re-create the item in the repository, but no luck. As a last option, i tried to remove the item from the repository to be able to sync properly again (just like before creating the item), but the error still happens.
    Another weird point is that i have tried creating the item in another publication of another database (but with almost equal items), and the item could was downloaded to my local DB without any problem, which makes this problem still more bizarre.
    What can it be?
    Any help would be great!
    Roshni

    have you tried unistalling the client and reinstalling it?
    schema evolution changes are not always handled correctly please check thread:
    Modification of publication item into Mobile Server
    i quote from rekounas instructions:
    If you are just adding a field, you should only have to run the alter publication item API call.
    Here is an old note on schema evolution on different scenarios. The names for the APIs that they use are now deprecated. Use the ConsolidatorManager class and call the method alterPublicationItem("PUBLICATION_ITEM_NAME", "SELECT STMT") :
    A) Add column
    1. Upload all client data. Clients should not add new data until they are told by the administrator to sync again!!
    2. Stop Mobile Server listener
    3. Change the Oracle8i/9i database schema (add column)
    4. Create a Java program to call the Consolidator Admin API AlterPublicationItem()
    5. Start Mobile Server
    6. Execute a sync from the client
    7. The new column should be seen on the client. Use MSQL to check snapshot definitions.
    B) Drop column
    1. Upload all client data. Clients should not add new data until they are told by the administrator to sync again!!
    2. Stop Mobile Server listener
    3. Delete column of the base table in the Oracle database schema
    4. Create a Java program to call the Consolidator Admin API DropPublicationItem()
    5. Create a Java program to call the Consolidator Admin API CreatePublicationItem() and AddPublicationItem().
    6. Start Mobile Server
    7. Execute a sync from the client
    8. The new column should be seen on the cliet. Use MSQL to check snapshot definitions.
    C) Change column datatype
    Changing datatypes in a repliatated system is not an easy task. You have to follow certain procedures in order to make it to work. Use DropPublicationItem, CreatePublicationItem and AddPublicationItem methods from the Consolidator Admin API. You must stop/start Mobile Server listener to refresh the cache.
    1. Client syncs. Clients should not add new data until they are told by the administrator to sync again!!
    2. Stop Mobile Server listener
    3. Drop/create column (do not use conversion procudures) at the base table
    4. Call DropPublicationItem(). Check if the ErrorQueue and InQueue no longer exist.
    5. Call CreatePublicationItem() and AddPublicationItem(). Check if the ErrorQueue and InQueue reflect the new column datatype
    6. Start Mobile Server. This automatically resumes application
    7. Client executes sync. This should drop the old snapshot and recreate the new snapshot. Use MSQL to check
    snapshot definitions.
    D) Drop table
    1. Client syncs. Clients should not add new data until they are told by the administrator to sync again!!
    2. Stop Mobile Server listener
    3. Drop base table
    4. Call DropPublicationItem(). Check if the ErrorQueue and InQueue no longer exist.
    5. Start Mobile Server. This automatically resumes application
    6. Client executes sync. This should drop the old snapshot. Use MSQL to check snapshot definitions.
    E) Add table
    1. Client syncs. Clients should not add new data until they are told by the administrator to sync again!!
    2. Stop Mobile Server listener
    3. Add new base table
    4. Call CreatePublicationItem() and AddPublicationItem() method
    5. Start Mobile Server. This automatically resumes application
    6. Client executes sync. This should add the new snapshot. Use MSQL to check snapshot definitions.
    F) Changing Primary Keys
    Chaning PK is a severe operation which must be executed manually. A snapshot must be deleted and recreated to propagate the changes to the clients. This causes a full refresh on this snapshot.
    1. Client syncs. Clients should not add new data until they are told by the administrator to sync again!!
    2. Stop Mobile Server listener
    3. Drop the snapshot using DropPublicationItem() method o
    4. Alter the base table
    5. Call CreatePublicationItem()and AddPublicationItem() methods for the altered table
    6. Start Mobile Server. This automatically resumes application
    7. Client executes sync. The old snapshot will be replaced by the new snapstot using a full refresh. Use MSQL to check snapshot definitions.
    G) To Change a Table Weight =>
    Follow the procedure below to change the Table Weight parameter. The table weight is used by the Mobile Server/Synchronization to determin the sequence in which client records are applied to the Oracle database.
    1. Run MGP to apply any changes in the InQueue to the Oracle databse
    2. Change table weight using SetTemplateItemMetadata() method
    3. Add/change constraint on the the base table which reflects the change in table weight
    4. Synchronize
    gl m8

  • Problems with the function DBMS_XMLSCHEMA.copyEvolve

    I´m having problems with the evolution of xml-schema.
    First the function DBMS_XMLSCHEMA.copyEvolve works correctly, but since one week I get only errors. Strangely is the fact that I use the same files (xml-schema, xslt and xml instances) and the same SQL-Code. Even if I delete all tables, directories, ... with the drop instruction and create them again, I get only error messages. It is also strangely that the function DBMS_XMLSCHEMA.copyEvolve not works if the old and new xml-schema are identical and no XSLT-Stylesheet is handed over. Can by the function DBMS_XMLSCHEMA.copyEvolve something going wrong in the database ? Do I must recreate the database, and how can I do that by the XE? But that can not be a good solution.
    Has anybody a idea what can I do?
    Here is my error report:
    Error starting at line 1 in command:
    BEGIN
    DBMS_XMLSCHEMA.copyEvolve(
    schemaURLs => xdb$string_list_t('http://localhost:8080/internal/xmlschema/testschema.xsd'),
    newSchemas => XMLSequenceType(XDBURIType('/public/testschema_evolution.xsd').getXML()),
    transforms => XMLSequenceType(XDBURIType('/public/MapTotestschema_evolution.xslt').getXML()));
    END;
    Error report:
    ORA-30944: Fehler beim Rollback für XML-Schema "http://localhost:8080/internal/xmlschema/testschema.xsd" Tabelle "MYUSER"."XMLSCHEMATABELLE" Spalte ""
    ORA-02304: Ungültiges Objektidentifizierungsliteral
    ORA-30942: Fehler bei XML Schema Evolution für Schema "http://localhost:8080/internal/xmlschema/testschema.xsd" Tabelle <n/a> Spalte ""
    ORA-31088: Objekt "MYUSER"."BIN$QNQjNoYiRfC4KlQtnfUpMw==$0" hängt von Schema ab
    ORA-06512: in "XDB.DBMS_XMLSCHEMA_INT", Zeile 113
    ORA-06512: in "XDB.DBMS_XMLSCHEMA", Zeile 210
    ORA-06512: in Zeile 2
    Thanks David

    Can you try doing the following before running copyEvolve
    SQL> purge recyclebin
      2  /
    Recyclebin purged.
    SQL> alter session set recyclebin =  off
      2  /
    Session altered.
    SQL>and see if it works as expected.

  • How to increase the length of a columnin existing publication item

    We need to urgently increase the length of three columns in one of the tables that is sent offline as a publication item. I have searched everywhere to see if there is a procedure to see this. I only found process to add/drop columns but not modify to JUST increase the length.
    Can we just alter the tables on the server and republish the application? Will that cause any data loss on the client end?
    Any help is greatly appreciated.
    Thanks
    Sireesha

    I totally forgot about this method. Metalink had it in the headlines today and remembered your question.
    This should work for you.
    Applies to:
    Oracle Lite - Version: 10.2.0.1.0 to 10.2.0.2.0
    Information in this document applies to any platform.
    Goal
    The Goal of this Document is to show the right steps when it is necessary to increase the Column Size for a table
    which is used for the Synchronization with Oracle Lite 10GR2
    BECAREFULL, it is not supported to change the Column Size or make any Schema Evolution on the Primary key
    as The Synchronization Algorithm is based on Primary key
    Solution
    Create table test_sec (col1 number(10); varchar2(10));
    alter table test_sec add primary key (col1));
    Create Publication: PUB_TEST_SEC
    Create Publication: PI_TEST_SEC: select COL1, COL2 from scott.TEST_SEC fast
    Refresh, server wins, weight = 1 and add it to the Publicatio PUB_TEST_SEC
    Synchronize this PUB_TEST_SEC
    On the Server: increase the col2 WHICH IS NOT A PK, from 10 to 15
    alter Table scott.TEST_SEC modify (col2 (varchar2(15));
    To get the new Column Size on the olite DB, you need to alter the Publication item too using for example this code:
    import java.sql.*;
    import java.io.*;
    import oracle.lite.sync.Consolidator;
    import oracle.lite.sync.ConsolidatorManager;
    import oracle.mobile.admin.*;
    public class PublicationChange {
    public static void main(String argv[]) throws Throwable
    DriverManager.registerDriver ((Driver)Class.forName ("oracle.jdbc.driver.OracleDriver").newInstance());
    ConsolidatorManager consolidatorManager = new ConsolidatorManager();
    consolidatorManager.openConnection("mobileadmin","manager","JDBC:ORACLE:thin:@suppolite1.fr.oracle.com:1521:PROD");
    System.out.println("Connected");
    try
    /*You need to put a Select Statment lightly different from the Publication item,
    if you will use the same select statment, it won't take in Account
    if you used: select * from owner.table to create the Publication Item
    you need to use: select * from owner.table for the alterPublicationItem API
    consolidatorManager.alterPublicationItem("PI_TEST_SEC","SELECT * FROM SCOTT.TEST_SEC");
    System.out.println("Pub Item recreated");
    catch (Throwable e) {
    e.printStackTrace();
    try
    consolidatorManager.closeConnection();
    System.out.println("The installation is done!");
    } catch (Throwable e) {
    Compile and run this java code.
    Synchronize
    Check your table Description on Oracle Lite Database to verify that this Schema Evolution has worked as expected.

  • Oracle's support in Django

    I'm trying to decide which application server/framework I can use for python development and for that, in my case, oracle's support is a must.
    While analyzing I found out Django is trying to add Oracle as an option right now, using, of course the cx_Oracle module: http://code.djangoproject.com/wiki/OracleBranch.
    That's good news. If anyone can comment their experience with Zope, Django, etc I'll appreciate it.
    TIA

    Well, Django itself is great for development of `standard` applications. You create a model, enter 3 commands and then you have a working application with admin interface. Cool, but in my personal experience I've been hitting the wall pretty fast and the amount of time spent on decrypting automagical functionality of a framework is in direct proportion to time spent designing and implementing it ourselves. Problems like schema evolution still need to be resolved by hand.
    My limited experience with Zope comes down to the fact that it is a bit like JBoss but focused more on the content management and portal solutions. Plone is a very interesting example of a widely used CMS running on top of Zope (plone.org and plone.net).
    Some companies are using Java application servers together with Jython servlets. You can also now run ASP.NET written in IronPython (www.asp.net/ironpython). These two because out of all Web stacks these are the most mature and as we know Oracle's support of .NET and Java is outstanding.
    If you are more into PHP or Perl, Python Server Pages from mod_python gives you capabilities similar to those offered by mod_php or mod_perl - but within Python.

Maybe you are looking for