About dbms_xmlschema.delete_cascade_force

with oracle 10g.
1. exec dbms_xmlschema.registerschema('http://someurl', bfilename('SOMEFOLDER','some.xsd'));
2. create table TTT (key_col varchar2(10) primary key, xml_col xmltype)
xmltype column xml_col xmlschema "http://someurl" element "Fields"
3. insert into TTT values('001', xmltype(bfilename('SOMEFOLDER', 'data01.xml'), nls_charset_id('AL32UTF8')));
4. exec dbms_xmlschema.deleteschema('http://someurl', dbms_xmlschema.delete_cascade_force);
after step 4,
desc TTT will got ORA-24372
select count(*) from TTT will got ORA-04063
Could anyone tell me how to resolve this problem with no loss of TTT's data?

No..
This one falls into the cateogory of "If it hurts please don't do it"
DELETE_CASCADE_FORCE should only be used when you are sure that you do not care for the content of any tables or columns that are based on the XML schema.. Please don't tell me you've done this in a a production system and now you need the data, because "There is no way to recover this data" except from a backup of the database before the schema was deleted...
Basically once the XML Schema has gone we have no way to correcly interpret the contents of the tables that contain the content of the documents.
-M

Similar Messages

  • Dbms_xmlschema.deleteschema hangs

    Hi,
    I am trying to delete an already registered schema using:
    dbms_xmlschema.deleteschema('http://myurl', dbms_xmlschema.DELETE_CASCADE_FORCE);
    This API does not complete and hangs forever. I am running this on Oracle 11g R2 database. Please help.
    Thanks,
    Ramesh

    It's more likely that there is a session somewhere that has retrieved data from an object associated with the XML Schema and is still holding a 'PIN' on it...
    Re: Deleting XML Schema

  • ORA-03113 when using references in xmltype

    I get an 'ORA-03113: end-of-file on communication channel' if I try to use references in an xml schema on multiple levels. You can find an example below.
    Setup:
    exec dbms_session.reset_package;
    declare
    l_schema varchar2(32767) :='<?xml version="1.0" encoding="utf-8"?>
    <xs:schema attributeFormDefault="qualified"
    elementFormDefault="qualified"
    version="1.0"
    xmlns:xdb="http://xmlns.oracle.com/xdb"
    xdb:storeVarrayAsTable="false"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="T_NODE" xdb:SQLType="T_NODE">
    <xs:sequence>
    <xs:element name="NODE" type="T_NODE"/>
    <xs:element name="LEVEL" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="NODE" type="T_NODE" xdb:defaultTable="T_NODE_REF"/>
    </xs:schema>';
    l_xml xmltype;
    l_url varchar2(1000) := 'NodeTest.xsd';
    begin
    begin
    execute immediate 'drop table T_NODE_REF';
    exception
    when others then null;
    end;
    begin
    execute immediate 'drop table T_NODE_XML';
    exception
    when others then null;
    end;
    begin
    dbms_xmlschema.deleteschema(
    schemaurl => l_url
    ,delete_option => dbms_xmlschema.delete_cascade_force
    exception
    when others then null;
    end;
    l_xml := xmltype.createxml(l_schema);
    dbms_xmlschema.registerschema (schemaurl => l_url
    ,schemadoc => l_xml
    ,gentables => true
    execute immediate 'CREATE TABLE T_NODE_XML OF XMLTYPE XMLTYPE STORE AS OBJECT RELATIONAL XMLSCHEMA "' || l_url || '" ELEMENT "NODE"';
    end;
    The script:
    declare
    l_reference ref xmltype;
    function rec(
    i_level pls_integer
    ) return ref xmltype
    is
    l_url varchar2(1000) := 'NodeTest.xsd';
    l_ref ref xmltype := null;
    l_new_ref ref xmltype := null;
    l_node t_node;
    l_level pls_integer;
    l_node_xml xmltype;
    begin
    if i_level > 0 then
    l_level := i_level - 1;
    l_ref := rec(l_level);
    else
    l_ref := null;
    end if;
    l_node := new t_node(null, l_ref, i_level);
    l_node_xml := xmltype.createxml(xmlData => l_node, schema => l_url, element => 'NODE', validated => 1);
    dbms_output.put_line(dbms_lob.substr(l_node_xml.getClobVal, amount => 200, offset => 1));
    insert into T_NODE_XML t values(l_node_xml) returning ref(t) into l_new_ref;
    commit;
    return l_new_ref;
    end;
    begin
    l_reference := rec(1);
    end;
    Any idea how to overcome this issue?
    Thanks in advance

    Your previous reply never said anything about commenting out dbms_output so how was I supposed to see the variations you were trying?<br><br>
    You need to continue this discussion with Oracle as to why you getting the specific ORA-0600 that you are. This assumes you have a valid support contract. You are getting an internal Oracle error. I'm not Oracle nor do I know the inner workings of their system. If not, Google and maybe the XML DB forum might be able to help you with this issue. They will want to know your version (4 digits) and may question your hammer use of .delete_cascade_force when deleting the schema. This should only be a last resort to use that level I know. It's probably not related to your issue but may come up.

  • Structured storage XMLType but disappointing performance

    Hi,
    This relates to Oracle 11g, but maybe the same question can be asked for 10g.
    I'm having a lot of big XML files which are structured following this xsd:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xs:schema
       xmlns="http://localhost/public/xsd/simple.xsd"
       targetNamespace="http://localhost/public/xsd/simple.xsd"
       xmlns:xs="http://www.w3.org/2001/XMLSchema"
       xmlns:xdb="http://xmlns.oracle.com/xdb"
       elementFormDefault="qualified"
       attributeFormDefault="unqualified"
       xdb:storeVarrayAsTable="true">
      <xs:element name="root" xdb:defaultTable="simple_or" xdb:maintainDOM="false">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="ea">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="eb" minOccurs="1" maxOccurs="unbounded">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="c1" type="xs:double" />
                        <xs:element name="c2" type="xs:double" />
                        <xs:element name="c3" type="xs:double" />
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
               </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>I create a VARRAY (the order is important) based structured storage table using the following commands:
    declare
      l_bfile bfile;
      res boolean;
    begin
      l_bfile := bfilename('EXDIR', 'simple.xsd');
      dbms_lob.open(l_bfile);
      dbms_xdb.deleteResource('/public/simple.xsd',4);
      res := dbms_xdb.createResource('/public/simple.xsd',l_bfile);
    end;
    BEGIN
      DBMS_XMLSchema.deleteSchema(
        schemaurl=>'http://localhost/public/xsd/simple.xsd',
        delete_option=>DBMS_XMLSchema.Delete_Cascade_Force);
    END;
    begin
       dbms_xmlschema.registerSchema(schemaurl => 'http://localhost/public/xsd/simple.xsd',
                                     schemadoc => xdbUriType('/public/simple.xsd').getXML(),
                                     local     => true,
                                     gentypes  => true,
                                     genbean   => false,
                                     gentables => true,
                                     force     => false,
                                     owner     => user);
    end;
    CREATE TABLE simple_or_1 OF XMLType
      XMLSCHEMA "http://localhost/public/xsd/simple.xsd"
      ELEMENT "root"
      VARRAY "XMLDATA"."ea"."eb"
        STORE AS TABLE simple_nested1
            ((PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$)))
    /And I load some XML files of the following form:
    <?xml version="1.0" encoding="UTF-8"?>
    <root xmlns="http://localhost/public/xsd/simple.xsd">
    <ea>
    <eb>
    <c1>4.0</c1>
    <c2>5.0</c2>
    <c3>6.0</c3>
    </eb>
    <eb>
    <c1>7.0</c1>
    <c2>8.0</c2>
    <c3>9.0</c3>
    </eb>
    <eb>
    <c1>7.0</c1>
    ... etc ...
    </ea>
    </root>
    Every document has about 50.000 <eb> elements and I loaded 6 sample documents.
    A simple query like the following takes about 5 minutes:
    SELECT XMLQuery('
      declare default element namespace "http://localhost/public/xsd/simple.xsd"; (: :)
      for $i in /root
      return max($i/a/b/c2)
    ' PASSING OBJECT_VALUE RETURNING CONTENT)
    FROM simple_or_1;The explain plan shows the following:
    | Id  | Operation                    | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                |     6 |    60 |     3   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE              |                |     1 |  1901 |            |          |
    |*  2 |   TABLE ACCESS BY INDEX ROWID| SIMPLE_NESTED1 |  1969 |  3655K|     6   (0)| 00:00:01 |
    |*  3 |    INDEX RANGE SCAN          | SYS_C009750    |   787 |       |     2   (0)| 00:00:01 |
    |   4 |  SORT AGGREGATE              |                |     1 |       |            |          |
    |   5 |   FAST DUAL                  |                |     1 |       |     2   (0)| 00:00:01 |
    |   6 |  TABLE ACCESS FULL           | SIMPLE_OR_1    |     6 |    60 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter(SYS_XMLCONV("SYS_ALIAS_2"."SYS_XDBPD$",0,32,'3952ABE048DCF8D6E040007F0101
                  7EA4',1,5561,1) IS NOT NULL)
       3 - access("NESTED_TABLE_ID"=:B1)I'm not understanding the low performance of 5 minutes... is there anyone who can explain and help out?

    Note with DOM Fidelity disabled on all types the SYS_XMLCONV is replaced with the more efficeint SYS_XMLGEN. However this is still not as efficient as the XMLTable approach..
    C:\Documents and Settings\Mark D Drake>sqlplus sys/oracle as sysdba
    SQL*Plus: Release 11.1.0.6.0 - Production on Fri Sep 7 06:03:39 2007
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Beta
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> connect / as sysdba
    Connected.
    SQL> --
    SQL> drop user Tijink cascade
      2  /
    drop user Tijink cascade
    ERROR at line 1:
    ORA-01918: user 'TIJINK' does not exist
    SQL> grant connect, resource, alter session, create view to Tijink  identified by  Tijink
      2  /
    Grant succeeded.
    SQL> conn Tijink/Tijink
    Connected.
    SQL> --
    SQL> set long 10000000
    SQL> set pages 5000
    SQL> var schemaPath varchar2(256)
    SQL> var schemaURL  varchar2(256)
    SQL> var xmlSchema  clob;
    SQL> --
    SQL> begin
      2     :schemaURL := 'http://localhost/public/xsd/simple.xsd';
      3     :schemaPath := '/public/simple.xsd';
      4     :xmlSchema :=
      5  '<?xml version="1.0" encoding="ISO-8859-1"?>
      6  <xs:schema
      7     xmlns="http://localhost/public/xsd/simple.xsd"
      8     targetNamespace="http://localhost/public/xsd/simple.xsd"
      9     xmlns:xs="http://www.w3.org/2001/XMLSchema"
    10     xmlns:xdb="http://xmlns.oracle.com/xdb"
    11     elementFormDefault="qualified"
    12     attributeFormDefault="unqualified"
    13     xdb:storeVarrayAsTable="true">
    14    <xs:element name="root" xdb:defaultTable="simple_or">
    15      <xs:complexType xdb:maintainDOM="false">
    16        <xs:sequence>
    17          <xs:element name="ea">
    18            <xs:complexType xdb:maintainDOM="false">
    19              <xs:sequence>
    20                <xs:element name="eb" minOccurs="1" maxOccurs="unbounded">
    21                  <xs:complexType xdb:maintainDOM="false">
    22                    <xs:sequence>
    23                      <xs:element name="c1" type="xs:double" />
    24                      <xs:element name="c2" type="xs:double" />
    25                      <xs:element name="c3" type="xs:double" />
    26                    </xs:sequence>
    27                  </xs:complexType>
    28                </xs:element>
    29              </xs:sequence>
    30             </xs:complexType>
    31          </xs:element>
    32        </xs:sequence>
    33      </xs:complexType>
    34    </xs:element>
    35  </xs:schema>';
    36  end;
    37  /
    PL/SQL procedure successfully completed.
    SQL> alter session set events='31098 trace name context forever'
      2  /
    Session altered.
    SQL> DECLARE
      2    BINARY_XML boolean:=FALSE;
      3  BEGIN
      4     IF (BINARY_XML)
      5     THEN
      6        dbms_xmlschema.registerSchema(SCHEMAURL => :schemaURL,
      7                                      SCHEMADOC => :xmlschema,
      8                                      LOCAL     => TRUE,
      9                                      GENTYPES  => FALSE,
    10                                      GENBEAN   => FALSE,
    11                                      GENTABLES => FALSE,
    12                                      ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE,
    13                                      FORCE     => FALSE,
    14                                      OPTIONS   => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
    15                                      OWNER     => USER);
    16     ELSE
    17        dbms_xmlschema.registerSchema(SCHEMAURL => :schemaURL,
    18                                      SCHEMADOC => :xmlSchema,
    19                                      LOCAL     => TRUE,
    20                                      GENTYPES  => TRUE,
    21                                      GENBEAN   => FALSE,
    22                                      GENTABLES => TRUE,
    23                                      ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE,
    24                                      FORCE     => FALSE,
    25                                      OWNER     => USER);
    26     END IF;
    27  END;
    28  /
    PL/SQL procedure successfully completed.
    SQL> --
    SQL> set timing on
    SQL> set long 1000000
    SQL> set pages 50000
    SQL> set lines 200
    SQL> --
    SQL> call  dbms_stats.GATHER_SCHEMA_STATS('TIJINK')
      2  /
    Call completed.
    Elapsed: 00:00:01.67
    SQL> set autotrace on explain
    SQL> --
    SQL> SELECT XMLQuery
      2         ('
      3      declare default element namespace "http://localhost/public/xsd/simple.xsd"; (: :)
      4      for $i in /root
      5      return max($i/ea/eb/c2)
      6      ' PASSING OBJECT_VALUE RETURNING CONTENT)
      7    FROM "simple_or"
      8  /
    no rows selected
    Elapsed: 00:00:00.28
    Execution Plan
    Plan hash value: 3716725992
    | Id  | Operation                    | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                                |     1 |    10 |     2   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE              |                                |     1 |    23 |            |       |
    |*  2 |   TABLE ACCESS BY INDEX ROWID| SYS_NTobq/uFrTQGaOrq3BeDy9Eg== |     1 |    23 |     0   (0)| 00:00:01 |
    |*  3 |    INDEX RANGE SCAN          | SYS_C009648                    |     1 |       |     0   (0)| 00:00:01 |
    |   4 |  SORT AGGREGATE              |                                |     1 |       |            |       |
    |   5 |   FAST DUAL                  |                                |     1 |       |     2   (0)| 00:00:01 |
    |   6 |  TABLE ACCESS FULL           | simple_or                      |     1 |    10 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter(SYS_XMLGEN(TO_CHAR("SYS_ALIAS_1"."c2")) IS NOT NULL)
       3 - access("NESTED_TABLE_ID"=:B1)
    SQL> select max(c2)
      2    from "simple_or",
      3         xmltable
      4         (
      5           xmlnamespaces
      6           (
      7              default 'http://localhost/public/xsd/simple.xsd'
      8           ),
      9           '/root/ea/eb'
    10           passing OBJECT_VALUE
    11           columns
    12           C2 PATH 'c2'
    13         )
    14  /
       MAX(C2)
    Elapsed: 00:00:00.15
    Execution Plan
    Plan hash value: 1041340395
    | Id  | Operation                     | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |                                |     1 |    33 |     0   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE               |                                |     1 |    33 |            |          |
    |   2 |   NESTED LOOPS                |                                |       |       |            |          |
    |   3 |    NESTED LOOPS               |                                |     1 |    33 |     0   (0)| 00:00:01 |
    |   4 |     INDEX FULL SCAN           | SYS_C009649                    |     1 |    10 |     0   (0)| 00:00:01 |
    |*  5 |     INDEX RANGE SCAN          | SYS_C009648                    |     1 |       |     0   (0)| 00:00:01 |
    |   6 |    TABLE ACCESS BY INDEX ROWID| SYS_NTobq/uFrTQGaOrq3BeDy9Eg== |     1 |    23 |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       5 - access("NESTED_TABLE_ID"="simple_or"."SYS_NC0000700008$")
    SQL> desc "simple_or"
    Name                                                                                                      Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "http://localhost/public/xsd/simple.xsd" Element "root") STORAGE Object-relational TYPE "root648_T"
    SQL> desc "root648_T"
    Name                                                                                                      Null?    Type
    ea                                                                                                                 ea649_T
    SQL> desc "ea649_T"
    Name                                                                                                      Null?    Type
    eb                                                                                                                 eb651_COLL
    SQL> desc "eb651_COLL"
    "eb651_COLL" VARRAY(2147483647) OF eb650_T
    Name                                                                                                      Null?    Type
    c1                                                                                                                 NUMBER
    c2                                                                                                                 NUMBER
    c3                                                                                                                 NUMBER
    SQL>

  • XML binary storage format impairs schema validation?

    I'm using Oracle 11g R1 on Windows Server 2003. I successfully registered schemas and created tables and indexes in the new binary storage format. However, when trying to load data, I'm running into problems. Schema validation behaves as if not the full feature set of XML Schema mysteriously isn't supported anymore.
    There is probably more but at least wildcard elements (xs:any) and element references (xs:element ref="STH") are simply ignored in the schema definition and data is rejected even when it conforms to the schema.
    Is there any solution for this or am I out of luck? I wanted to go back to CLOB storage as used in a previous installation but I'm running into problems when registering the schema. It complains about an empty SQL name although I don't have any defined. I'm pretty weirded out by all this.
    I created the schema and table in a straightforward way:
    begin
      dbms_xmlschema.registeruri(
        schemaurl => 'http://www.xxxhello.com/archive_tsd.xsd',
        schemadocuri => '/public/user/archive_tsd.xsd',
        gentypes => FALSE,
        options => DBMS_XMLSCHEMA.REGISTER_BINARYXML
    end;
    CREATE TABLE archive OF xmltype XMLTYPE STORE AS binary xml XMLSCHEMA
    "http://www.xxxhello.com/archive_tsd.xsd" ELEMENT "CompleteDocument";
    create index idx_lastmodified_archive on archive t
    (extractvalue(VALUE(t),'/CompleteDocument/DocContent/LastModified'));Because of xs:any or element references is ignored, I get errors like
    LSX-00213: only 0 occurrences of particle "REFDELEM", minimum is 1.
    Thanks for your help.

    The schema is very large (>200kb). Where should I upload it or can I send it to you? I'm bit concerned about confidentiality of company data. However, the instance is not valid yet. I'm in the process of modifying the schema to match all instances, but it breaks on places that should be already okay. No, I didn't use SchemaValidate ever.
    But I've made an example where at least xs:any doesn't work. Element references work, though.
    Sample schema:
    <?xml version = "1.0" encoding = "UTF-8"?>
    <xs:schema
      xmlns:tsd = "http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition"
      xmlns:xs = "http://www.w3.org/2001/XMLSchema">
      <xs:annotation>
        <xs:appinfo>
          <tsd:schemaInfo name = "sbreak">
            <tsd:collection name = "sbreak"></tsd:collection>
            <tsd:doctype name = "CompleteDocument">
              <tsd:logical>
                <tsd:content>open</tsd:content>
                <tsd:systemGeneratedIdentity reuse = "false"></tsd:systemGeneratedIdentity>
              </tsd:logical>
            </tsd:doctype>
            <tsd:adminInfo>
              <tsd:server>4.4.1.1</tsd:server>
              <tsd:modified>2007-07-03T16:00:46.484+02:00</tsd:modified>
              <tsd:created>2007-07-03T15:29:04.968+02:00</tsd:created>
              <tsd:version>TSD4.4</tsd:version>
            </tsd:adminInfo>
          </tsd:schemaInfo>
        </xs:appinfo>
      </xs:annotation>
      <xs:element name = "CompleteDocument">
        <xs:complexType>
          <xs:choice minOccurs = "0" maxOccurs = "unbounded">
            <xs:element name = "ComplexNormal">
              <xs:complexType>
                <xs:choice minOccurs = "0" maxOccurs = "unbounded">
                  <xs:element name = "NormalElem1" type = "xs:string"></xs:element>
                  <xs:element name = "NormalElem2" type = "xs:string"></xs:element>
                </xs:choice>
              </xs:complexType>
            </xs:element>
            <xs:element name = "ComplexAny">
              <xs:complexType>
                <xs:choice minOccurs = "0" maxOccurs = "unbounded">
                  <xs:any minOccurs = "0" maxOccurs = "unbounded"></xs:any>
                </xs:choice>
              </xs:complexType>
            </xs:element>
            <xs:element name = "ComplexRef">
              <xs:complexType>
                <xs:choice minOccurs = "0" maxOccurs = "unbounded">
                  <xs:element ref = "RefdElem"></xs:element>
                </xs:choice>
              </xs:complexType>
            </xs:element>
            <xs:element name = "LastModified" type = "xs:string"></xs:element>
          </xs:choice>
        </xs:complexType>
      </xs:element>
      <xs:element name = "RefdElem">
        <xs:complexType>
          <xs:choice minOccurs = "0" maxOccurs = "unbounded">
            <xs:element name = "Elem1" type = "xs:string"></xs:element>
            <xs:element name = "Elem2" type = "xs:string"></xs:element>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:schema>Sample instance:
    <?xml version="1.0" encoding="UTF-8" ?>
    <CompleteDocument>
         <ComplexNormal>
              <NormalElem1>Test1</NormalElem1>
              <NormalElem2>Test2</NormalElem2>
         </ComplexNormal>
         <ComplexAny>
              <AnyElem>Test3</AnyElem>
         </ComplexAny>
         <ComplexRef>
              <RefdElem>
                   <Elem1>Test4</Elem1>
                   <Elem2>Test5</Elem2>
              </RefdElem>
         </ComplexRef>
    </CompleteDocument>Log of what I did. First I confirmed, that I could enter the instance using clob storage:
    SQL> begin
      2    dbms_xmlschema.registeruri(
      3      schemaurl => 'http://www.xxxhello.com/sbreak_tsd.xsd',
      4      schemadocuri => '/public/sbreak_tsd.xsd'
      5    );
      6  end;
      7  /
    PL/SQL-Prozedur erfolgreich abgeschlossen.
    SQL> CREATE TABLE sbreak OF xmltype XMLTYPE STORE AS clob XMLSCHEMA
    "http://www.xxxhello.com/sbreak_tsd.xsd" ELEMENT "CompleteDocument";
    Tabelle wurde erstellt.
    SQL> create index idx_lastmodified_sbreak on sbreak t (extractvalue(VALUE(t),
    '/CompleteDocument/LastModified'));
    Index wurde erstellt.
    SQL> insert into sbreak values(xmltype(bfilename('DATA', 'sbreak/sbreakinstance.xml'),
    NLS_CHARSET_ID('AL32UTF8')));
    1 Zeile wurde erstellt.Then I deleted table and schema again:
    SQL> drop index idx_lastmodified_sbreak;
    Index wurde gelöscht.
    SQL> drop table sbreak;
    Tabelle wurde gelöscht.
    SQL> begin
      2    dbms_xmlschema.deleteschema(
      3      schemaurl => 'http://www.xxxhello.com/sbreak_tsd.xsd'
      4     ,delete_option => dbms_xmlschema.delete_cascade_force
      5    );
      6  end;
      7  /
    PL/SQL-Prozedur erfolgreich abgeschlossen.After that I created schema and table with binary XML storage and tried to insert the same instance again:
    SQL> begin
      2    dbms_xmlschema.registeruri(
      3      schemaurl => 'http://www.xxxhello.com/sbreak_tsd.xsd',
      4      schemadocuri => '/public/sbreak_tsd.xsd',
      5      gentypes => FALSE,
      6      options => DBMS_XMLSCHEMA.REGISTER_BINARYXML
      7    );
      8  end;
      9  /
    PL/SQL-Prozedur erfolgreich abgeschlossen.
    SQL> CREATE TABLE sbreak OF xmltype XMLTYPE STORE AS binary xml XMLSCHEMA
    "http://www.xxxhello.com/sbreak_tsd.xsd" ELEMENT "CompleteDocument";
    Tabelle wurde erstellt.
    SQL> create index idx_lastmodified_sbreak on sbreak t (extractvalue(VALUE(t),
    '/CompleteDocument/LastModified'));
    Index wurde erstellt.
    SQL> insert into sbreak values(xmltype(bfilename('DATA', 'sbreak/sbreakinstance.xml'),
    NLS_CHARSET_ID('AL32UTF8')));
    insert into sbreak values(xmltype(bfilename('DATA', 'sbreak/sbreakinstance.xml'),
    NLS_CHARSET_ID('AL32UTF8')))
    FEHLER in Zeile 1:
    ORA-31011: XML-Parsing nicht erfolgreich
    ORA-19202: Fehler bei XML-Verarbeitung
    LSX-00021: undefined element "AnyElem"
    aufgetretenSorry about the non-english text, but I think it can be guessed easily what's going on. Next I'll try a modifed schema without the tsd namespace added by the schema editor I use (the original large schema has been migrated from the Tamino XML database).

  • Reregister modified XML Schema

    I have some XML Schemas registered with my oracle 10g database. The types are created, but not the tables.
    Now I have a change in field length in one of the Schemas and I need to reregister it. All the other schemas are dependent on this modified schema.
    I used the following approach to delete the schema and register it.
    dbms_xmlschema.deleteschema(schemaurl => 'my url',
    delete_option => dbms_xmlschema.DELETE_CASCADE_FORCE);
    dbms_xmlschema.registerschema(schemaurl => 'my url',
    schemadoc => BFILENAME(SCHEMADIR, 'schema_name'),
    local=>true,
    genTypes=>true,
    genbean=>false,
    genTables=>false,
    force=>false);
    This successfully registered the schema.
    But whenever the database is restarted, I face a dangling ref error whenever I try to access the OOT created for the Schema.
    Any pointers on this will be of great help. Is this the right approach?
    Also I read about dbms_xmlschema.copyevolve() procedure. I only need the types, so I am not interested in any transformations as I dont have any instance documents.

    The last problem regarding dangling ref's on this forum ended up in creating an SR with support...
    Before you register the schema you could set an event that will trace all statements that are executed in the "background" and stored in a trace file in the UDUMP directory
    ALTER session SET events = '31098 trace name context forever';It is also always useful to check the database alert.log for errors...
    Edited by: Marco Gralike on Nov 19, 2008 9:23 PM

  • ORA-31000: Resource 'example_name.xsd' is not an XDB schema document

    Morning,
    I'm running 11gr2 on OEL 5. I recently joined a project where a lot of work has already been done by a previous dba and xmldb is fairly new to me. I'm trying to register a new xml schema but keep getting the above error. The error is referencing a resource that I'm not even declaring in my statement. See statement below.
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL => 'http://localhost/xsd/test/collection_test.xsd',
    SCHEMADOC => bfilename('XSD_TEST','collection_test.xsd'),
    CSID => nls_charset_id('AL32UTF8'));
    END;
    I've used the FORCE=True option which has worked but then the error shows up again when trying to create a table. I queried the schema url and found that nothing was mapped to it so I deleted it as so:
    DBMS_XMLSCHEMA.DELETESCHEMA('http://localhost/xsd/test/collection_test.xsd', DBMS_XMLSCHEMA.DELETE_CASCADE_FORCE);
    This worked just fine. Problem now is, I'm still getting the same error when registering schema or creating a table. I thought maybe I could purge t he schema from the database now but I can't query the schema ID to do so. I feel I am stuck now. I've tried to look up solutions online for a day now to no avail. All help is GREATLY appreciated (and rewarded). Thanks!!

    I don't expect to be able to give you the answer you seek, but I'll ask a couple of questions to help others along.
    1) What is your error message? That is useful
    2) What does collection_test.xsd look like? Can you post it (or a portion of it, including any includes/imports and all namespaces)?
    Reproducible test cases are always nice as they show others what is going on and give a starting point for reproducing/fixing the error.

  • ORA-07445 in the alert log when inserting into table with XMLType column

    I'm trying to insert an xml-document into a table with a schema-based XMLType column. When I try to insert a row (using plsql-developer) - oracle is busy for a few seconds and then the connection to oracle is lost.
    Below you''ll find the following to recreate the problem:
    a) contents from the alert log
    b) create script for the table
    c) the before-insert trigger
    d) the xml-schema
    e) code for registering the schema
    f) the test program
    g) platform information
    Alert Log:
    Fri Aug 17 00:44:11 2007
    Errors in file /oracle/app/oracle/product/10.2.0/db_1/admin/dntspilot2/udump/dntspilot2_ora_13807.trc:
    ORA-07445: exception encountered: core dump [SIGSEGV] [Address not mapped to object] [475177] [] [] []
    Create script for the table:
    CREATE TABLE "DNTSB"."SIGNATURETABLE"
    (     "XML_DOCUMENT" "SYS"."XMLTYPE" ,
    "TS" TIMESTAMP (6) WITH TIME ZONE NOT NULL ENABLE
    ) XMLTYPE COLUMN "XML_DOCUMENT" XMLSCHEMA "http://www.sporfori.fo/schemas/www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd" ELEMENT "Object"
    ROWDEPENDENCIES ;
    Before-insert trigger:
    create or replace trigger BIS_SIGNATURETABLE
    before insert on signaturetable
    for each row
    declare
    -- local variables here
    l_sigtab_rec signaturetable%rowtype;
    begin
    if (:new.xml_document is not null) then
    :new.xml_document.schemavalidate();
    end if;
    l_sigtab_rec.xml_document := :new.xml_document;
    end BIS_SIGNATURETABLE2;
    XML-Schema (xmldsig-core-schema.xsd):
    =====================================================================================
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Schema for XML Signatures
    http://www.w3.org/2000/09/xmldsig#
    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
    Copyright 2001 The Internet Society and W3C (Massachusetts Institute
    of Technology, Institut National de Recherche en Informatique et en
    Automatique, Keio University). All Rights Reserved.
    http://www.w3.org/Consortium/Legal/
    This document is governed by the W3C Software License [1] as described
    in the FAQ [2].
    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
    -->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xdb="http://xmlns.oracle.com/xdb"
    targetNamespace="http://www.w3.org/2000/09/xmldsig#" version="0.1" elementFormDefault="qualified">
    <!-- Basic Types Defined for Signatures -->
    <xs:simpleType name="CryptoBinary">
    <xs:restriction base="xs:base64Binary">
    </xs:restriction>
    </xs:simpleType>
    <!-- Start Signature -->
    <xs:element name="Signature" type="ds:SignatureType"/>
    <xs:complexType name="SignatureType">
    <xs:sequence>
    <xs:element ref="ds:SignedInfo"/>
    <xs:element ref="ds:SignatureValue"/>
    <xs:element ref="ds:KeyInfo" minOccurs="0"/>
    <xs:element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Id" type="xs:ID" use="optional"/>
    </xs:complexType>
    <xs:element name="SignatureValue" type="ds:SignatureValueType"/>
    <xs:complexType name="SignatureValueType">
    <xs:simpleContent>
    <xs:extension base="xs:base64Binary">
    <xs:attribute name="Id" type="xs:ID" use="optional"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <!-- Start SignedInfo -->
    <xs:element name="SignedInfo" type="ds:SignedInfoType"/>
    <xs:complexType name="SignedInfoType">
    <xs:sequence>
    <xs:element ref="ds:CanonicalizationMethod"/>
    <xs:element ref="ds:SignatureMethod"/>
    <xs:element ref="ds:Reference" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Id" type="xs:ID" use="optional"/>
    </xs:complexType>
    <xs:element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
    <xs:complexType name="CanonicalizationMethodType" mixed="true">
    <xs:sequence>
    <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
    <!-- (0,unbounded) elements from (1,1) namespace -->
    </xs:sequence>
    <xs:attribute name="Algorithm" type="xs:anyURI" use="required"/>
    </xs:complexType>
    <xs:element name="SignatureMethod" type="ds:SignatureMethodType"/>
    <xs:complexType name="SignatureMethodType" mixed="true">
    <xs:sequence>
    <xs:element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
    <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    <!-- (0,unbounded) elements from (1,1) external namespace -->
    </xs:sequence>
    <xs:attribute name="Algorithm" type="xs:anyURI" use="required"/>
    </xs:complexType>
    <!-- Start Reference -->
    <xs:element name="Reference" type="ds:ReferenceType"/>
    <xs:complexType name="ReferenceType">
    <xs:sequence>
    <xs:element ref="ds:Transforms" minOccurs="0"/>
    <xs:element ref="ds:DigestMethod"/>
    <xs:element ref="ds:DigestValue"/>
    </xs:sequence>
    <xs:attribute name="Id" type="xs:ID" use="optional"/>
    <xs:attribute name="URI" type="xs:anyURI" use="optional"/>
    <xs:attribute name="Type" type="xs:anyURI" use="optional"/>
    </xs:complexType>
    <xs:element name="Transforms" type="ds:TransformsType"/>
    <xs:complexType name="TransformsType">
    <xs:sequence>
    <xs:element ref="ds:Transform" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="Transform" type="ds:TransformType"/>
    <xs:complexType name="TransformType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:any namespace="##other" processContents="lax"/>
    <!-- (1,1) elements from (0,unbounded) namespaces -->
    <xs:element name="XPath" type="xs:string"/>
    </xs:choice>
    <xs:attribute name="Algorithm" type="xs:anyURI" use="required"/>
    </xs:complexType>
    <!-- End Reference -->
    <xs:element name="DigestMethod" type="ds:DigestMethodType"/>
    <xs:complexType name="DigestMethodType" mixed="true">
    <xs:sequence>
    <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Algorithm" type="xs:anyURI" use="required"/>
    </xs:complexType>
    <xs:element name="DigestValue" type="ds:DigestValueType"/>
    <xs:simpleType name="DigestValueType">
    <xs:restriction base="xs:base64Binary"/>
    </xs:simpleType>
    <!-- End SignedInfo -->
    <!-- Start KeyInfo -->
    <xs:element name="KeyInfo" type="ds:KeyInfoType"/>
    <xs:complexType name="KeyInfoType" mixed="true">
    <xs:choice maxOccurs="unbounded">
    <xs:element ref="ds:KeyName"/>
    <xs:element ref="ds:KeyValue"/>
    <xs:element ref="ds:RetrievalMethod"/>
    <xs:element ref="ds:X509Data"/>
    <xs:element ref="ds:PGPData"/>
    <xs:element ref="ds:SPKIData"/>
    <xs:element ref="ds:MgmtData"/>
    <xs:any processContents="lax" namespace="##other"/>
    <!-- (1,1) elements from (0,unbounded) namespaces -->
    </xs:choice>
    <xs:attribute name="Id" type="xs:ID" use="optional"/>
    </xs:complexType>
    <xs:element name="KeyName" type="xs:string"/>
    <xs:element name="MgmtData" type="xs:string"/>
    <xs:element name="KeyValue" type="ds:KeyValueType"/>
    <xs:complexType name="KeyValueType" mixed="true">
    <xs:choice>
    <xs:element ref="ds:DSAKeyValue"/>
    <xs:element ref="ds:RSAKeyValue"/>
    <xs:any namespace="##other" processContents="lax"/>
    </xs:choice>
    </xs:complexType>
    <xs:element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
    <xs:complexType name="RetrievalMethodType">
    <xs:sequence>
    <xs:element ref="ds:Transforms" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="URI" type="xs:anyURI"/>
    <xs:attribute name="Type" type="xs:anyURI" use="optional"/>
    </xs:complexType>
    <!-- Start X509Data -->
    <xs:element name="X509Data" type="ds:X509DataType"/>
    <xs:complexType name="X509DataType">
    <xs:sequence maxOccurs="unbounded">
    <xs:choice>
    <xs:element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
    <xs:element name="X509SKI" type="xs:base64Binary"/>
    <xs:element name="X509SubjectName" type="xs:string"/>
    <xs:element name="X509Certificate" type="xs:base64Binary"/>
    <xs:element name="X509CRL" type="xs:base64Binary"/>
    <xs:any namespace="##other" processContents="lax"/>
    </xs:choice>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="X509IssuerSerialType">
    <xs:sequence>
    <xs:element name="X509IssuerName" type="xs:string"/>
    <xs:element name="X509SerialNumber" type="xs:integer"/>
    </xs:sequence>
    </xs:complexType>
    <!-- End X509Data -->
    <!-- Begin PGPData -->
    <xs:element name="PGPData" type="ds:PGPDataType"/>
    <xs:complexType name="PGPDataType">
    <xs:choice>
    <xs:sequence>
    <xs:element name="PGPKeyID" type="xs:base64Binary"/>
    <xs:element name="PGPKeyPacket" type="xs:base64Binary" minOccurs="0"/>
    <xs:any namespace="##other" processContents="lax" minOccurs="0"
    maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:sequence>
    <xs:element name="PGPKeyPacket" type="xs:base64Binary"/>
    <xs:any namespace="##other" processContents="lax" minOccurs="0"
    maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:choice>
    </xs:complexType>
    <!-- End PGPData -->
    <!-- Begin SPKIData -->
    <xs:element name="SPKIData" type="ds:SPKIDataType"/>
    <xs:complexType name="SPKIDataType">
    <xs:sequence maxOccurs="unbounded">
    <xs:element name="SPKISexp" type="xs:base64Binary"/>
    <xs:any namespace="##other" processContents="lax" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    <!-- End SPKIData -->
    <!-- End KeyInfo -->
    <!-- Start Object (Manifest, SignatureProperty) -->
    <xs:element name="Object" type="ds:ObjectType"/>
    <xs:complexType name="ObjectType" mixed="true">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
    <xs:any namespace="##any" processContents="lax"/>
    </xs:sequence>
    <xs:attribute name="Id" type="xs:ID" use="optional"/>
    <xs:attribute name="MimeType" type="xs:string" use="optional"/> <!-- add a grep facet -->
    <xs:attribute name="Encoding" type="xs:anyURI" use="optional"/>
    </xs:complexType>
    <xs:element name="Manifest" type="ds:ManifestType"/>
    <xs:complexType name="ManifestType">
    <xs:sequence>
    <xs:element ref="ds:Reference" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Id" type="xs:ID" use="optional"/>
    </xs:complexType>
    <xs:element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
    <xs:complexType name="SignaturePropertiesType">
    <xs:sequence>
    <xs:element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Id" type="xs:ID" use="optional"/>
    </xs:complexType>
    <xs:element name="SignatureProperty" type="ds:SignaturePropertyType"/>
    <xs:complexType name="SignaturePropertyType" mixed="true">
    <xs:choice maxOccurs="unbounded">
    <xs:any namespace="##other" processContents="lax"/>
    <!-- (1,1) elements from (1,unbounded) namespaces -->
    </xs:choice>
    <xs:attribute name="Target" type="xs:anyURI" use="required"/>
    <xs:attribute name="Id" type="xs:ID" use="optional"/>
    </xs:complexType>
    <!-- End Object (Manifest, SignatureProperty) -->
    <!-- Start Algorithm Parameters -->
    <xs:simpleType name="HMACOutputLengthType">
    <xs:restriction base="xs:integer"/>
    </xs:simpleType>
    <!-- Start KeyValue Element-types -->
    <xs:element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
    <xs:complexType name="DSAKeyValueType">
    <xs:sequence>
    <xs:sequence minOccurs="0">
    <xs:element name="P" type="ds:CryptoBinary"/>
    <xs:element name="Q" type="ds:CryptoBinary"/>
    </xs:sequence>
    <xs:element name="G" type="ds:CryptoBinary" minOccurs="0"/>
    <xs:element name="Y" type="ds:CryptoBinary"/>
    <xs:element name="J" type="ds:CryptoBinary" minOccurs="0"/>
    <xs:sequence minOccurs="0">
    <xs:element name="Seed" type="ds:CryptoBinary"/>
    <xs:element name="PgenCounter" type="ds:CryptoBinary"/>
    </xs:sequence>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
    <xs:complexType name="RSAKeyValueType">
    <xs:sequence>
    <xs:element name="Modulus" type="ds:CryptoBinary"/>
    <xs:element name="Exponent" type="ds:CryptoBinary"/>
    </xs:sequence>
    </xs:complexType>
    <!-- End KeyValue Element-types -->
    <!-- End Signature -->
    </xs:schema>
    ===============================================================================
    Code for registering the xml-schema
    begin
    dbms_xmlschema.deleteSchema('http://xmlns.oracle.com/xdb/schemas/DNTSB/www.sporfori.fo/schemas/www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd',
    dbms_xmlschema.DELETE_CASCADE_FORCE);
    end;
    begin
    DBMS_XMLSCHEMA.REGISTERURI(
    schemaurl => 'http://www.sporfori.fo/schemas/www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd',
    schemadocuri => 'http://www.sporfori.fo/schemas/www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd',
    local => TRUE,
    gentypes => TRUE,
    genbean => FALSE,
    gentables => TRUE,
    force => FALSE,
    owner => 'DNTSB',
    options => 0);
    end;
    Test program
    -- Created on 17-07-2006 by EEJ
    declare
    XML_TEXT3 CLOB := '<Object xmlns="http://www.w3.org/2000/09/xmldsig#">
                                  <SignatureProperties>
                                       <SignatureProperty Target="">
                                            <Timestamp xmlns="http://www.sporfori.fo/schemas/dnts/general/2006/11/14">2007-05-10T12:00:00-05:00</Timestamp>
                                       </SignatureProperty>
                                  </SignatureProperties>
                             </Object>';
    xmldoc xmltype;
    begin
    xmldoc := xmltype(xml_text3);
    insert into signaturetable
    (xml_document, ts)
    values
    (xmldoc, current_timestamp);
    end;
    Platform information
    Operating system:
    -bash-3.00$ uname -a
    SunOS dntsdb 5.10 Generic_125101-09 i86pc i386 i86pc
    SQLPlus:
    SQL*Plus: Release 10.2.0.3.0 - Production on Fri Aug 17 00:15:13 2007
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    Enter password:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning and Data Mining options
    Kind Regards,
    Eyðun

    You should report this in a service request on http://metalink.oracle.com.
    It is a shame that you put all the effort here to describe your problem, but on the other hand you can now also copy & paste the question to Oracle Support.
    Because you are using 10.2.0.3; I am guessing that you have a valid service contract...

  • ORA-30937 when validating element referenced from included schema

    I've boiled my latest problem down to a simple test case. Basically it seems as though the included schema is the problem, but I can't figure out why:
    begin
    dbms_xmlschema.deleteSchema('http://www.forensic.gov.uk/eMessages/Pnclink/NDNA/testinclude.xsd', dbms_xmlschema.DELETE_CASCADE_FORCE);
    dbms_xmlschema.registerSchema('http://www.forensic.gov.uk/eMessages/Pnclink/NDNA/testinclude.xsd',
    '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" versionfiltered="1-00" id="NDNASimpleTypes">
    <xsd:complexType name="MessageHeaderType">
    <xsd:sequence>
    <xsd:element name="MESSAGE_NUMBER" type="xsd:long"/>
    <xsd:element name="MESSAGE_TYPE" type="MessageTypeType"/>
    <xsd:element name="MESSAGE_DATE" type="xsd:dateTime"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="MessageTypeType">
    <xsd:annotation>
    <xsd:documentation>The definition of the Sample Message Types</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="2"/>
    <xsd:enumeration value="CT"/>
    <xsd:enumeration value="CA"/>
    <xsd:enumeration value="CD"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:schema>',TRUE,FALSE,FALSE,FALSE);
    dbms_xmlschema.deleteSchema('http://www.forensic.gov.uk/eMessages/Pnclink/NDNA/Test.xsd', dbms_xmlschema.DELETE_CASCADE);
    dbms_xmlschema.registerSchema('http://www.forensic.gov.uk/eMessages/Pnclink/NDNA/Test.xsd',
    '<xsd:schema xmlns="http://www.forensic.gov.uk/eMessages/Pnclink/NDNA" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.forensic.gov.uk/eMessages/Pnclink/NDNA" elementFormDefault="qualified" attributeFormDefault="unqualified" versionfiltered="1.0" id="Test">
    <xsd:include schemaLocation="http://www.forensic.gov.uk/eMessages/Pnclink/NDNA/testinclude.xsd"/>
    <xsd:element name="SAMPLE_MESSAGE">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="MESSAGE_HEADER" type="MessageHeaderType"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>',TRUE,TRUE,FALSE,FALSE);
    END;
    update xml_in
    set xml_data = xmltype ( '<?xml versionfiltered="1.0" encoding="UTF-8"?>
    <!--Sample XML file generated by XMLSpy v2005 rel. 3 U (http://www.altova.com)-->
    <SAMPLE_MESSAGE xmlns="http://www.forensic.gov.uk/eMessages/Pnclink/NDNA" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.forensic.gov.uk/eMessages/Pnclink/NDNA http://www.forensic.gov.uk/eMessages/Pnclink/NDNA/Test.xsd">
    <MESSAGE_HEADER>
    <MESSAGE_NUMBER>2147483647</MESSAGE_NUMBER>
    <MESSAGE_TYPE>CT</MESSAGE_TYPE>
    <MESSAGE_DATE>2001-12-17T09:30:47</MESSAGE_DATE>
    </MESSAGE_HEADER>
    </SAMPLE_MESSAGE>
    where msg_id = 8
    and I get the error:
    ORA-30937: No schema definition for 'MESSAGE_NUMBER' (namespace 'http://www.forensic.gov.uk/eMessages/Pnclink/NDNA') in parent 'MESSAGE_HEADER'
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 27
    But if I remove the MESSAGE_NUMBER I get
    ORA-31154: invalid XML document
    ORA-19202: Error occurred in XML processing
    LSX-00213: only 0 occurrences of particle "MESSAGE_NUMBER", minimum is 1
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 37
    So it knows there is supposed to be a particle called message_number if it's not there, but not what to do with it if it is.
    One other thing, which I think is significant: If I amend my test.xsd schema so I define MESSAGE_HEADER there, so the only thing being referenced from testinclude.xsd is the SIMPLE type "MessageTypeType", I don't have a problem. It seems to be only when I include COMPLEX types.
    Any suggestions?

    Dave
    I can't register the XML Schemas with XML DB, since we do think versionfiltered is a valid attribute for a schema element...
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType(
      4  '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" versionfilt
    ered="1-00" id="NDNASimpleTypes">
      5
      6          <xsd:complexType name="MessageHeaderType">
      7                  <xsd:sequence>
      8                          <xsd:element name="MESSAGE_NUMBER" type="xsd:long"/>
      9                          <xsd:element name="MESSAGE_TYPE" type="MessageTypeType"/>
    10                          <xsd:element name="MESSAGE_DATE" type="xsd:dateTime"/>
    11                  </xsd:sequence>
    12          </xsd:complexType>
    13          <xsd:simpleType name="MessageTypeType">
    14                  <xsd:annotation>
    15                          <xsd:documentation>The definition of the Sample Message Types</xsd:documentation>
    16                  </xsd:annotation>
    17                  <xsd:restriction base="xsd:string">
    18                          <xsd:maxLength value="2"/>
    19                          <xsd:enumeration value="CT"/>
    20                          <xsd:enumeration value="CA"/>
    21                          <xsd:enumeration value="CD"/>
    22                  </xsd:restriction>
    23          </xsd:simpleType>
    24  </xsd:schema>');
    25  begin
    26    if (dbms_xdb.existsResource(:schemaPath)) then
    27      dbms_xdb.deleteResource(:schemaPath);
    28    end if;
    29    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    30  end;
    31  /
    Queuing DELETE Event
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.04
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      :schemaURL,
      5      xdbURIType(:schemaPath).getClob(),
      6      TRUE,TRUE,FALSE,TRUE
      7    );
      8  end;
      9  /
    begin
    ERROR at line 1:
    ORA-30937: No schema definition for 'versionfiltered' (namespace '##local') in parent '/schema'
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 20
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 31
    ORA-06512: at line 2XMLSPY agrees with us on this...
    If I change version filtered to version I get
    SQL> var schemaURL varchar2(256)
    SQL> var schemaPath varchar2(256)
    SQL> --
    SQL> begin
      2    :schemaURL := 'http://www.forensic.gov.uk/eMessages/Pnclink/NDNA/testinclude.xsd';
      3    :schemaPath := '/public/testinclude.xsd';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
      2  /
    Queuing DELETE Event
    Call completed.
    Elapsed: 00:00:00.07
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType(
      4  '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1-
    00" id="NDNASimpleTypes">
      5
      6          <xsd:complexType name="MessageHeaderType">
      7                  <xsd:sequence>
      8                          <xsd:element name="MESSAGE_NUMBER" type="xsd:long"/>
      9                          <xsd:element name="MESSAGE_TYPE" type="MessageTypeType"/>
    10                          <xsd:element name="MESSAGE_DATE" type="xsd:dateTime"/>
    11                  </xsd:sequence>
    12          </xsd:complexType>
    13          <xsd:simpleType name="MessageTypeType">
    14                  <xsd:annotation>
    15                          <xsd:documentation>The definition of the Sample Message Types</xsd:documentation>
    16                  </xsd:annotation>
    17                  <xsd:restriction base="xsd:string">
    18                          <xsd:maxLength value="2"/>
    19                          <xsd:enumeration value="CT"/>
    20                          <xsd:enumeration value="CA"/>
    21                          <xsd:enumeration value="CD"/>
    22                  </xsd:restriction>
    23          </xsd:simpleType>
    24  </xsd:schema>');
    25  begin
    26    if (dbms_xdb.existsResource(:schemaPath)) then
    27      dbms_xdb.deleteResource(:schemaPath);
    28    end if;
    29    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    30  end;
    31  /
    Queuing DELETE Event
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.04
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      :schemaURL,
      5      xdbURIType(:schemaPath).getClob(),
      6      TRUE,TRUE,FALSE,TRUE
      7    );
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.20
    SQL> begin
      2    :schemaURL := 'http://www.forensic.gov.uk/eMessages/Pnclink/NDNA/Test.xsd';
      3    :schemaPath := '/public/Test.xsd';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
      2  /
    Queuing DELETE Event
    Call completed.
    Elapsed: 00:00:00.06
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType(
      4  '<xsd:schema xmlns="http://www.forensic.gov.uk/eMessages/Pnclink/NDNA" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="ht
    tp://www.forensic.gov.uk/eMessages/Pnclink/NDNA" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" id="Test">
      5
      6          <xsd:include schemaLocation="http://www.forensic.gov.uk/eMessages/Pnclink/NDNA/testinclude.xsd"/>
      7        <xsd:element name="SAMPLE_MESSAGE">
      8                  <xsd:complexType>
      9                          <xsd:sequence>
    10                                  <xsd:element name="MESSAGE_HEADER" type="MessageHeaderType"/>
    11                          </xsd:sequence>
    12                  </xsd:complexType>
    13          </xsd:element>
    14    </xsd:schema>');
    15  begin
    16    if (dbms_xdb.existsResource(:schemaPath)) then
    17      dbms_xdb.deleteResource(:schemaPath);
    18    end if;
    19    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    20  end;
    21  /
    Queuing DELETE Event
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.04
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      :schemaURL,
      5      xdbURIType(:schemaPath).getClob(),
      6      TRUE,TRUE,FALSE,FALSE
      7    );
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.14
    SQL> var xmltext varchar2(4000)
    SQL> --
    SQL> begin
      2    :xmltext :=
      3  '<SAMPLE_MESSAGE xmlns="http://www.forensic.gov.uk/eMessages/Pnclink/NDNA" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:sc
    hemaLocation="http://www.forensic.gov.uk/eMessages/Pnclink/NDNA http://www.forensic.gov.uk/eMessages/Pnclink/NDNA/Test.xsd">
      4     <MESSAGE_HEADER>
      5        <MESSAGE_NUMBER>2147483647</MESSAGE_NUMBER>
      6        <MESSAGE_TYPE>CT</MESSAGE_TYPE>
      7        <MESSAGE_DATE>2001-12-17T09:30:47</MESSAGE_DATE>
      8     </MESSAGE_HEADER>
      9  </SAMPLE_MESSAGE>';
    10  end;
    11  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    SQL> drop table xml_in
      2  /
    Table dropped.
    Elapsed: 00:00:00.04
    SQL> create table xml_in
      2  (
      3    msg_id   number(4),
      4    xml_data xmltype
      5  )
      6  /
    Table created.
    Elapsed: 00:00:00.03
    SQL> insert into xml_in values ( 8, xmltype ('<FOO/>'))
      2  /
    1 row created.
    Elapsed: 00:00:00.01
    SQL> declare
      2    xmldata xmltype;
      3  begin
      4    xmldata := xmltype(:xmltext);
      5    xmldata.schemaValidate();
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.09
    SQL> update xml_in
      2     set xml_data = xmltype ( :xmltext )
      3   where msg_id = 8
      4  /
    1 row updated.
    Elapsed: 00:00:00.01
    SQL> select * from xml_in
      2  /
        MSG_ID
    XML_DATA
             8
    <SAMPLE_MESSAGE xmlns="http://www.forensic.gov.uk/eMessages/Pnclink/NDNA" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLo
    cation="ht
    tp://www.forensic.gov.uk/eMessages/Pnclink/NDNA http://www.forensic.gov.uk/eMessages/Pnclink/NDNA/Test.xsd">
      <MESSAGE_HEADER>
        <MESSAGE_NUMBER>2147483647</MESSAGE_NUMBER>
        <MESSAGE_TYPE>CT</MESSAGE_TYPE>
        <MESSAGE_DATE>2001-12-17T09:30:47</MESSAGE_DATE>
      </MESSAGE_HEADER>
    </SAMPLE_MESSAGE>
    Elapsed: 00:00:00.06
    SQL>

  • Bug in xs:pattern implementation when calling schemaValidate?

    Hi all,
    I have a schema with a pattern <xs:pattern value="(0?[1-9]|1[0-2])"/> that is supposed to validate the digits 01-09, 1-9, 10, 11, 12. When validating XML against the schema, values such as '12' fail. If the xs:pattern in re-written "(1[0-2]|0?[1-9])", i.e. the parts either side of the | are swapped, the xs:pattern works as expected, i.e. '12' validates as correct. The pattern itself works as expected with validators such as with Eclipse, and the RE seems to work as expected in PL/SQL
    Is this a bug with the XML parser used in "Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production", or is there another parser I can configure 10g to use? I have a number of xml schemas and patterns to check, and want to be sure that they work as expected.
    thanks
    Paul
    -- A simple example demonstrating the problem.
    declare
    vSchemaName varchar(100);
    xmldoc XMLType;
    vReturn boolean;
    vResult int;
    begin
    vSchemaName := 'test.xsd';
    -- Remove the old schema, if it exists.
    if (dbms_xdb.existsResource('/' || vSchemaName)) then
    dbms_xdb.deleteResource('/' || vSchemaName);
    end if;
    select count(1)
    into vResult
    from sys.DBA_XML_SCHEMAS
    where SCHEMA_URL = vSchemaName;
    if (vResult = 1) then
    dbms_XMLSchema.deleteSchema(vSchemaName, DELETE_OPTION => dbms_xmlschema.DELETE_CASCADE_FORCE);
    end if;
    vReturn := dbms_xdb.createResource(
    '/' || vSchemaName
    , XMLType('
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:element name="Document_Creation_Date" type="Date_Mandatory"/>
         <xs:simpleType name="Date_Mandatory">
              <xs:restriction base="xs:string">
    <!-- <xs:pattern value="[0-9]?[0-9]/(0?[1-9]|1[0-2])/[0-9]{4}"/> Original Expression -->
    <!-- <xs:pattern value="(0?[1-9]|1[0-2])"/> Problem part of expression -->
    <xs:pattern value="(0?[1-9]|1[0-2])"/>
              </xs:restriction>
         </xs:simpleType>
    </xs:schema>')
    -- Register the schema
    dbms_XMLSchema.registerSchema( schemaUrl => vSchemaName, schemaDoc => sys.UriFactory.getUri('/' || vSchemaName), GENTYPES => false, GENTABLES => false);
    -- Sample XML to validate
    xmldoc := XMLType('<Document_Creation_Date>12</Document_Creation_Date>').createSchemaBasedXML('test.xsd');
    xmldoc.schemaValidate();
    commit;
    end;
    /

    Please patch one fo your machines to 10.2.0.3 and then try and duplicate. You do not have to go through the complete registration of the XSD process thoguh you can check and see if the c based parser will validate on the command line using the
    schema executible under your oracle_home bin directory.
    schema 1.xml 1.xsd
    for example
    if it dupes in 10.2.0.3 open a TAR with support so that we may bug it.
    regards
    Coby

  • Unable to register XSD into Oracle using trigger / procedure

    Hi,
    I am using Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production.
    I have a table which stores XSD and i need to register this XSD. I am able to register the XSD if dbms_schema is executed from PLSQL anonymous block. But if i mention the same code in trigger / procedure is not working . Getting the error as insufficient privileges.
    Table, trigger and procedure are in same schema. This schema has all the privs required for XSD registration globally.
    create table t_vkk ( n number, xsd xmltype)
    alter table t_vkk add active varchar2(1)
    create sequence seq_vkk start with 1 increment by 1
    CREATE OR REPLACE TRIGGER TRG_t_vkk_xsd
    AFTER INSERT OR UPDATE
    ON t_vkk
    REFERENCING OLD AS old NEW AS new
    FOR EACH ROW
    BEGIN
    IF INSERTING AND :new.active = 'Y'
    THEN
    prc_reg_xsd(:new.n, :new.xsd);
    END IF;
    -- Applied when updating rows in the table
    IF UPDATING
    THEN
    IF :new.active = 'Y' -- XSD re-registration since template id is still active
    THEN
    prc_reg_xsd(:old.n, :old.xsd);
    ELSIF :new.active = 'N' -- XSD de-registration
    THEN
    BEGIN
    dbms_xmlschema.deleteschema (
    schemaurl => :old.n
    , delete_option => dbms_xmlschema.delete_cascade_force
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL; -- This XSD was not registered
    END;
    END IF;
    END IF;
    END TRG_t_vkk_xsd;
    This fails -
    insert into t_vkk
    values (0,XMLTYPE(
    '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:books" xmlns:bks="urn:books">
    <xsd:element name="books" type="bks:BooksForm"/>
    <xsd:complexType name="BooksForm">
    <xsd:sequence>
    <xsd:element name="book" type="bks:BookForm" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="BookForm">
    <xsd:sequence>
    <xsd:element name="author" type="xsd:string"/>
    <xsd:element name="title" type="xsd:string"/>
    <xsd:element name="genre" type="xsd:string"/>
    <xsd:element name="price" type="xsd:float"/>
    <xsd:element name="pub_date" type="xsd:date"/>
    <xsd:element name="review" type="xsd:string"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string"/>
    </xsd:complexType>
    </xsd:schema>'
    ), 'Y')
    This works :
    After inserting the record into t_vkk (Trigger is disabled)
    declare
    begin
    for x in (select * from t_vkk)
    loop
    dbms_output.put_line (x.xsd.getstringval());
    BEGIN
    dbms_xmlschema.deleteschema (
    schemaurl => x.n
    , delete_option => dbms_xmlschema.delete_cascade_force
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL; -- This XSD was not registered
    END;
    dbms_xmlschema.registerschema (schemaurl => x.n
    , schemadoc => x.xsd
    , local => false);
    end loop;
    end;
    This Fails:
    create or replace procedure prc_reg_xsd
    as
    begin
    for x IN (select * from t_vkk)
    loop
    BEGIN
    dbms_xmlschema.deleteschema (
    schemaurl => x.n
    , delete_option => dbms_xmlschema.delete_cascade_force
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL; -- This XSD was not registered
    END;
    dbms_xmlschema.registerschema (schemaurl => x.n
    , schemadoc => x.xsd
    , local => false);
    end loop;
    end;
    BEGIN
    prc_reg_xsd;
    END;
    -Vinod K

    Thanks everyone. I got the solution from one of my colleague. I can invoke dbms_xmlschema.registerschema through my standalone procedure by using current_user authid.
    create or replace procedure prc_reg_xsd
    (in_id IN NUMBER
    , in_xsd IN XMLTYPE)
    authid current_user
    as
    begin
    dbms_output.put_line (' startd');
    BEGIN
    dbms_xmlschema.deleteschema (
    schemaurl => in_id
    , delete_option => dbms_xmlschema.delete_cascade_force
    EXCEPTION
    WHEN OTHERS
    THEN
    dbms_output.put_line (' Failed'); -- This XSD was not registered
    END;
    dbms_xmlschema.registerschema (schemaurl => in_id
    , schemadoc => in_xsd
    , local => false);
    dbms_output.put_line (' done');
    end;
    DECLARE
    x number:=9;
    t xmltype := XMLTYPE(
    '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:books" xmlns:bks="urn:books">
    <xsd:element name="books" type="bks:BooksForm"/>
    <xsd:complexType name="BooksForm">
    <xsd:sequence>
    <xsd:element name="book" type="bks:BookForm" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="BookForm">
    <xsd:sequence>
    <xsd:element name="author" type="xsd:string"/>
    <xsd:element name="title" type="xsd:string"/>
    <xsd:element name="genre" type="xsd:string"/>
    <xsd:element name="price" type="xsd:float"/>
    <xsd:element name="pub_date" type="xsd:date"/>
    <xsd:element name="review" type="xsd:string"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string"/>
    </xsd:complexType>
    </xsd:schema>');
    BEGIN
    prc_reg_xsd(x,t);
    END;
    This worked for me. The procedure is in the same schema which has XDBADMIN role. So i am able to register the XSD.
    Vinod

  • Invalid objects and ORA-00600 after deleting XML schema

    I am running Oracle 10.2.0.3 on Solaris 10. I am new to XML DB but my developers requested it for a new application. Recently we have noticed the following issue:
    My developers have attempted to re-register several schemas using:
    DBMS_XMLSchema.deleteSchema(SchemaURL => l_strSchemaURL,
    Delete_Option => DBMS_XMLSchema.Delete_Cascade_Force);
    And then re-register.
    DBMS_XMLSchema.RegisterURI( SchemaURL => l_strSchemaURL,
    SchemaDocURI => l_strImportURL,
    Local => True,
    GenTypes => True,
    GenBean => False,
    GenTables => True,
    Force => False,
    EnableHierarchy => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_RESMETADATA);
    Afterwards I have noticed several invalid objects:
    OWNER        OBJECT_NAME                    OBJECT_TYPE     STATUS
    ELSVC        hsp_standard825_TAB$xd         TRIGGER         INVALID
    ELSVC        hsp_standard1145_TAB$xd        TRIGGER         INVALID
    ELSVC        hsp_standard_set827_TAB$xd     TRIGGER         INVALID
    ELSVC        hsp_standard_set827_TAB        TABLE           INVALID
    ELSVC        hsp_product822_TAB$xd          TRIGGER         INVALID
    ELSVC        hsp_product822_TAB             TABLE           INVALID
    ELSVC        hsp_planner_content833_TAB     TABLE           INVALID
    ELSVC        hsp_planner_content833_TAB$xd  TRIGGER         INVALID
    ELSVC        hsp_correlations839_TAB        TABLE           INVALID
    ELSVC        hsp_correlations839_TAB$xd     TRIGGER         INVALID
    ELSVC        hsp_standard825_TAB            TABLE           INVALID
    ELSVC        hsp_program819_TAB             TABLE           INVALID
    ELSVC        hsp_program819_TAB$xd          TRIGGER         INVALID
    XDB          XDLNKrHbGsLaHgRAAUTyLEhg==     XML SCHEMA      INVALID
    XDB          XDLNKrHbIULaHgRAAUTyLEhg==     XML SCHEMA      INVALID
    XDB          XDLNKrHbJZLaHgRAAUTyLEhg==     XML SCHEMA      INVALID
    XDB          XDLNKrHbGFLaHgRAAUTyLEhg==     XML SCHEMA      INVALID
    XDB          XDLNKrHbHdLaHgRAAUTyLEhg==     XML SCHEMA      INVALID and if I attempt to compile the triggers I receive an ORA-00600: internal error code, arguments: [diana for triggering table/view ], [], [], [], [], [], [], []. I opened a TAR with oracle but they have not made much headway. Are we attempting to de-register the schemas improperly? Has anyone seen this issue before?
    Thanks,
    Brian

    SR 6204906.993. Up to this point oracle was able to help me identify that the invalid objects were related to the ORA-00600 but it was just recently that it appeared the Issue was possibly related to the delete schema procedure. The informed me that they were not aware of any known issues with this procedure.
    Thanks

  • Removing xml schema fails

    When i try to remove an xml schema using the enterprise manager (10.1.0.2.0) console i receive the following error:
    VB0-8051: ...
    ORA-31000: Resource ... is not an xdb-schema document
    ORA-06512: in XDB.DBMS_XMLSCHEMA_INT: row 70
    ORA-06512: in XDB.DBMS_XMLSCHEMA: row 103
    ORA-06512: in row 1
    Thanks for any hint,
    Christian
    What i see in the schema code (see below) is that the <xs:schema>-tag is directly following the comment.
    Even if i register a schema without a comment, i can't remove it from xdb :-((((
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!-- edited with XMLSpy v2005 sp2 U (http://www.altova.com) by --><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:oraxdb="http://xmlns.oracle.com/xdb" oraxdb:flags="279" oraxdb:schemaURL="stdb1296/objects.xsd" oraxdb:schemaOwner="ISMED_XML" oraxdb:numProps="12">
    <xs:element name="objects" oraxdb:propNumber="2408" oraxdb:global="true" oraxdb:SQLName="objects" oraxdb:SQLType="objects137_T" oraxdb:SQLSchema="ISMED_XML" oraxdb:memType="258" oraxdb:defaultTable="objects143_TAB" oraxdb:defaultTableSchema="ISMED_XML">
    <xs:annotation>
    <xs:documentation>Top level element als Klammer über alle Instanzen.</xs:documentation>
    </xs:annotation>
    .....

    Christian,
    I run the following code from sql to remove the schemas I register.
    I've noticed when I try to register schemas multiple times I will get errors.
    I got this code from one of the XML documents or XDB documents. I don't remember where I found it. You may be able to do a search if you want more information.
    declare
    unregistered_schema exception;
    PRAGMA EXCEPTION_INIT( unregistered_schema -31000 );
    begin
    dbms_xmlschema.deleteschema('schemaregisterednamehere',dbms_xmlschema.DELETE_CASCADE_FORCE);
    exception
    when unregistered_schema then
    null;
    end;

  • Column int_objname empty after register schema

    Hi all,
    We have come across a very strange feature in our XDB repository (RDBMS 10.2.0.2 EE) and I hope someone can give a hint to solve it.
    In the past we registered xml schemas and worked with it with success. The schemas are local. Now, we're implementing new versions of these xml schemas by deleting the old ones and registering the new versions. But, when we try to delete the old xml schemas, ORA-31000 is the result:
    begin dbms_xmlschema.deleteschema ('budget-canoniek.xsd', dbms_xmlschema.delete_cascade_force ); end
    ERROR at line 1:
    ORA-31000: Resource 'budget-canoniek.xsd' is not an XDB schema document
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 82
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 102
    ORA-06512: at line 1However, all_xml_schemas shows that the schema does exists:
      1  select owner, schema_url, int_objname
      2    from all_xml_schemas
      3*  where schema_url like '%canoniek%' and local = 'YES'
    puc@PGIO> /
    OWNER      SCHEMA_URL                INT_OBJNAME
    PUC        budget-canoniek2.xsd      XDLTCTsQgnhyHgQPwK+fx/kQ==
    PUC        budget-canoniek.xsdTo test what is happening I registered a schema under another name : budget-canoniek2.xsd. This schema can be unregistered without any problems.
    The difference between both schemas is a missing value INT_OBJNAME.
    Questions:
    - Does anyone have a clue how can this int_objname get nullified? I guess some internal process is doing this?
    - Does anyone have a clue how we can get this column fixed and filled again. Apparently, this column causes the dbms_xdb.deleteSchema procedure to fail. It also causes other functions on this schema to fail.
    - In thread Error when deleting schema the same issue was "solved" by deleting a record in xdb$schema table, but was not recommended. An aternative was not given. Before I totally wreck up my XDB by executing this delete statement: is there an alternative?
    Please help,
    Regards,

    Harm, could you request the backport via metalink? An upgrade to 10.2.0.3.0 will not be a solution, just checked on metalink
    I will install it on Thursday (tomorrow I am off to a client) for the project if it is available for download.
    Grz
    Marco

  • Duplicate entries in referenced table (SQLInline=false)

    Hi,
    I'm testing with the following example XSD from Oracle:
    declare
    doc varchar2(8000) := '
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="1.0" xdb:schemaURL="http://xmluser.de.oracle.com/xsd/deptemp.xsd">
         <xsd:complexType name="Department" xdb:SQLType="DEPT_T">
              <xsd:sequence>
                   <xsd:element name="Deptno" type="xsd:decimal" xdb:SQLName="DEPTNO"/>
                   <xsd:element name="Deptname" type="xsd:string" xdb:SQLName="DEPTNAME"/>
                   <xsd:element name="Employees" type="Employee" maxOccurs="unbounded" xdb:SQLName="EMPLOYEES" xdb:SQLInline="false" xdb:defaultTable="EMPLOYEES_TABLE"/>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="Employee" xdb:SQLType="EMP_T">
              <xsd:sequence>
                   <xsd:element name="Name" type="xsd:string" xdb:SQLName="NAME"/>
                   <xsd:element name="Age" type="xsd:decimal" xdb:SQLName="AGE"/>
                   <xsd:element name="Addr" type="Address" xdb:SQLName="ADDRESS"/>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="Address" xdb:SQLType="ADDR_T">
              <xsd:sequence>
                   <xsd:element name="Street" type="xsd:string" xdb:SQLName="STREET"/>
                   <xsd:element name="City" type="xsd:string" xdb:SQLName="CITY"/>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:element name="emptable" type="Employee" xdb:defaultTable="EMP_TAB"/>
         <xsd:element name="depttable" type="Department" xdb:defaultTable="DEPT_TAB"/>
    </xsd:schema>
    begin
    -- dbms_xmlschema.deleteSchema('http://xmluser.de.oracle.com/xsd/deptemp.xsd', dbms_xmlschema.DELETE_CASCADE_FORCE);
    dbms_xmlschema.registerSchema('http://xmluser.de.oracle.com/xsd/deptemp.xsd', doc, TRUE, TRUE, FALSE, TRUE);
    end;
    Whenever I insert a line into the DEPT_TAB created by the above example, I get two entries for any contained Employees element in the EMPLOYEES_TABLE.
    E.g. the EMPLOYEES_TABLE is empty:
    SQL> select * from EMPLOYEES_TABLE;
    No rows selected.
    Then I insert the following:
    SQL> insert into DEPT_TAB VALUES (sys.XMLType('
    <depttable xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmluser.de.oracle.com/xsd/deptemp.xsd">
         <Deptno>1</Deptno>
         <Deptname>Sales Consulting</Deptname>
         <Employees>
              <Name>ABC</Name>
              <Age>11</Age>
              <Addr>
                   <Street>Street1</Street>
                   <City>City1</City>
              </Addr>
         </Employees>
         <Employees>
              <Name>DEF</Name>
              <Age>22</Age>
              <Addr>
                   <Street>Street2</Street>
                   <City>City2</City>
              </Addr>
         </Employees>
    </depttable>
    After this I find the following in the EMPLOYEES_TABLE:
    SQL> select * from EMPLOYEES_TABLE;
    SYS_NC_ROWINFO$
    <Employees>
    <Name>ABC</Name>
    <Age>11</Age>
    <Addr>
    <Street>Street1</Str
    <Employees>
    <Name>DEF</Name>
    <Age>22</Age>
    <Addr>
    <Street>Street2</Str
    SYS_NC_ROWINFO$
    <Employees>
    <Name>ABC</Name>
    <Age>11</Age>
    <Addr>
    <Street>Street1</Str
    <Employees>
    <Name>DEF</Name>
    <Age>22</Age>
    <Addr>
    SYS_NC_ROWINFO$
    <Street>Street2</Str
    SQL> select count(*) from EMPLOYEES_TABLE;
    COUNT(*)
    4
    What's wrong here?
    Thanks for your help,
    Andreas

    Physical design is different depending on the DB, so let's start there, e.g. the Dim tables have unique indices built on the DIM IDs, but in Oracle - the fact table (Non-transactional and no Line Item/High cardinality dims) would just have bitmap indices, so not having a unique index on the fact table is not an issue in Oracle.
    What DB and version?
    Do any of the Dims have more than 16 charateristics in them?
    Are there concurrent loads to the InfoCube from different data sources?
    Is Number Range buffering used for any of the dimensions?
    Key figure(s) identical values, or are they different?

Maybe you are looking for

  • Interactive report from PL/SQL function

    Hello All, i have a pl/sql function that dynamically builds up a sql query and returns it as a varchar2. when i create a new report then i can use this function in the report like return f_function(param1,param2,v('APP_ID'), v('APP_SESSION')); and th

  • Write statements after OO ALV

    Hi, i have the following problem. In a report we are using the set_table_for_first_display method for ALV display. In the ALV, once pressed the 'BACK' button we want to show per screen some WRITE commands. The lines are being short printed, but the p

  • Error in form tag which calls a javascript function

    Following is the code <script type="text/javascript"> try{      var variable3=(document.forms[0]).server_Name.value;      var variable=(document.forms[0]).job_Name.value;      }catch(err){}   function returnall()        var vald2=checkempty();       

  • Apple TV Display Too Large

    My Apple TV output is displayed (zoomed) much larger than the television screen.  Need help in determining how to reduce the display size, as this is new.  Thanks for any help you can provide.

  • Problems using mesh tool

    Here is  the vector image I created...(yes i know this is a jpeg i made of it) The problem is i can use the gradient tool on any section of this... But the mesh gradient thing will not work... I select and enclosed section and try to use it with no l