Semi structured storage

hi,
what are the steps to follow to store or import/ export native xml data into semistructured storage in oracle 11g?????
how to test the performance of the semi structured data??????
Edited by: user11269819 on Jul 17, 2009 11:00 AM

I'm not sure which method you are referring to as "semi-structure" (hybrid?) so I'll point you to this [Oracle 11g – XMLType Storage Options | http://www.liberidu.com/blog/?p=203] which is derived from [Oracle® XML DB Developer's Guide 11g Release 1|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/toc.htm]. You can also find more storage related information on Marco's blog under the [storage category | http://www.liberidu.com/blog/?cat=23]

Similar Messages

  • Importing native xml in to semi structured storage

    hello,
    how store the a bibliographic data in the native xml and import or export that data into to the semi structured storage. What are the ways we query the xml database.
    Eagerly waiting for the reply
    Cheers
    Akhil
    Thank you in advance

    Based on a small extension demo-ed in : http://www.liberidu.com/blog/?p=1053 (demo script demo06.sql)
    -- If you can select it you can insert it...
    -- drop table OGH_xml_store purge;
    create table OGH_xml_store of xmltype
    xmltype store as binary xml
    commit;
    exec get_dir_list( 'G:\OGH\xmlstore' );
    set time on timing on
    insert into OGH_xml_store
    select XMLTYPE(bfilename('OGH_USE_CASE',dl.filename),NLS_CHARSET_ID('AL32UTF8')) AS "XML"
    from   dir_list dl
    where  dl.filename like '%.xml';
    set time off timing off
    commit;
    select count(*) from OGH_xml_store;
    prompt pause
    pause
    clear screen
    -- If you can select it you can create resources and files
    set time on timing on
    commit;
    exec get_dir_list( 'G:\OGH\xmlstore' );
    select count(*) from dir_list where filename like '%.xml';
    set serveroutput on size 10000
    DECLARE
      XMLdoc       XMLType;
      res          BOOLEAN;
      v_foldername varchar2(4000) := '/public/OGH/';
      cursor c1
      is
      select dl.filename                                                                  FNAME
      ,      XMLTYPE(bfilename('OGH_USE_CASE',dl.filename),NLS_CHARSET_ID('AL32UTF8')) XMLCONTENT
      from   dir_list dl
      where  dl.filename like '%.xml'
      and rownum <= 100;
    BEGIN
    -- Create XDB repository Folder
    if (dbms_xdb.existsResource(v_foldername))
    then
           dbms_xdb.deleteResource(v_foldername,dbms_xdb.DELETE_RECURSIVE_FORCE);
    end if;
    res:=DBMS_XDB.createFolder(v_foldername);
    -- Create XML files in the XDB Repository
    for r1 in c1
    loop
       if (DBMS_XDB.CREATERESOURCE(v_foldername||r1.fname, r1.xmlcontent))
       then
          dbms_output.put_line(v_foldername||r1.fname);
          null;
       else
          dbms_output.put_line('Loop Exception :'||sqlerrm);
       end if;
    end loop;
    EXCEPTION WHEN OTHERS THEN
      dbms_output.put_line('Others Exception: '||sqlerrm);
    END;
    set time off timing off
    commit;
    prompt pause
    pause
    clear screen
    -- FTP and HTTP
    clear screen
    prompt
    prompt *** FTP - Demo ***
    prompt
    prompt pause
    pause
    host ftp
    -- open localhost 2100
    -- user OGH OGH
    -- cd public
    -- cd OGH
    -- ls
    -- bye
    clear screen
    prompt
    prompt *** Microsoft Internet Explorer - Demo ***
    prompt
    prompt pause
    pause
    host "C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://OGH:OGH@localhost:8080/public/OGH/
    prompt pause
    pause
    -- Accessing the XDB Repository content via Resource View
    -- Selecting content from a resource via XBDUriType
    clear screen
    prompt set long 300
    set long 300
    prompt Relative Path - (path)
    SELECT path(1) as filename
    FROM RESOURCE_VIEW
    WHERE under_path(RES, '/public/OGH', 1) = 1
    and rownum <= 10
    prompt pause
    pause
    clear screen
    prompt Absolute Path - (any_path)
    select xdburitype(any_path).getClob() as xml
    FROM RESOURCE_VIEW
    WHERE under_path(RES, '/public/OGH', 1) = 1
    and rownum <= 1;
    prompt pause
    pause

  • Query about XMLTYPE column structured storage in Oracle Xml db

    Dear All,
    DB Version: Oracle 11g (11.2.0.3.0)
    I have an table having one column as XMLTYPE with Structured storage.
    CREATE TABLE Orders
        Order_id NUMBER NOT NULL,
        Order_etc VARCHAR2(100),
        Order_desc XMLType NOT NULL
        XMLTYPE Order_desc STORE AS OBJECT RELATIONAL XMLSCHEMA  "http://localhost/public/xsd/order_desc_xsd.xsd" ELEMENT "OrderState";
    I have then registered the XSD with XML Db schema which is required for Structured storage.
    Before this table creation I had created a table (db_objects) of XMLTYPE and was able to use the below query to check for what all objects the XMLTYPE table got broken into when I registered its XSD.
        SELECT column_name,     
               data_type
        FROM   user_tab_cols
        WHERE  table_name = 'DB_OBJECTS';
    And used below query to look for data stored in Object-Relational structure for my table (DB_OBJECTS) created with XMLTYPE definition.
      SELECT EXTRACTVALUE(xseq.column_value, '/THISROW/OWNER')       AS owner
        ,      EXTRACTVALUE(xseq.column_value, '/THISROW/OBJECT_NAME') AS object_name
        ,      EXTRACTVALUE(xseq.column_value, '/THISROW/OBJECT_TYPE') AS object_type
        ,      EXTRACTVALUE(xseq.column_value, '/THISROW/OBJECT_ID')   AS object_id
        ,      EXTRACTVALUE(xseq.column_value, '/THISROW/CREATED')     AS created
        FROM   db_objects do
         ,      TABLE(XMLSEQUENCE(EXTRACT(VALUE(do), '/ROWSET/THISROW'))) xseq 
        WHERE  ROWNUM <= 10;
    Now could someone let me know, how to find how the column (Order_desc) of XMLTYPE was broken down into further objects just like I did for the Table with XMLTYPE (as shown above)?
    Many Thanks.

    First given that you are on 11.2, ExtractValue is deprecated and the documentation lists three options to use instead.  Here is one option (untested)
    SELECT owner, object_name, object_type, object_id, created
      FROM db_objects do,
           XMLTable('/ROWSET/THISROW'
                    PASSING do.object_value
                    COLUMNS
                    -- Set data types accordingly
                    owner        VARCHAR2(20) PATH 'owner',
                    object_name  VARCHAR2(20) PATH 'object_name',
                    object_type  VARCHAR2(20) PATH 'object_type',
                    object_id    VARCHAR2(20) PATH 'object_id',
                    created      VARCHAR2(20) PATH 'created');
    Second, why does column order matter?  You are storing in an object relational method.  As long as the XML is valid per the schema, the Oracle will be able to store the data and later retrieve it as well.  How that data is stored is mostly Oracle internals and should not be touched as it can be changed from version to version.  You can use schema annotation to control how Oracle maps and stores the XML, but nothing in there specifies column order that I am aware of.
    It seems additional details are missing as to what you need the information for so that would help others answer your question.

  • 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>

  • Piecewise Insert into structured storage

    I understand that XMLUPDATE can handle piecewise update, but what do I do for piecewise insert. I want to add a sub-tree (document fragment) conformant with the registered schema to the xml document, without re-writing the whole (possibly very, very large and growing) document, and retaining all the power and abstraction of structured storage.
    It would be nice to get an XMLType via an XPath select, get the DOM object from the XMLTYpe, operate on the DOM, and see those changes reflected in the database. I can do all that, but the changes to the DOM seem to be in-memory only.
    How do I add a sub-node to an existing structured document?
    Thanks,
    David

    HI,
    Oracle version is 11.1.0.7.0.
    Metalink found three bugs related to the error ORA-00600: Interner Fehlercode, Argumente: [qmxConvUnkType], [], [], [], [],
    The bugs are:
    BUG 8644684 ORA-600 [QMXCONVUNKTYPE] DURING INSERT INTO SCHEMA-BASED TABLE
    BUG 8671408 INSERT OF XML DOC INTO AN XML SCHEMA STORED AS BINARY XML FAILS WITH ORA-30937
    BUG 8683472 SCHEMA EXECUTABLE RETURNS INCORRECT ERRORS DURING VALIDATION AGAINST XML SCHEMA
    Well, I have to look round in XML DB Forum yet.

  • Storing data in structured storage

    I see everywhere that storing data in stuctured storage way is the better thing to do if we want to make fast search.
    But how can I do it.
    I only see that the default storage is clob for xmltype and we also can say "stored as clob" but how do it for store it in structured storage.
    Thank you.

    You need to register an XML Schema that defines your data. You then define the type of data your XML columns will contain using XMLSCHEMA and ELEMENT clauses..
    See the XML DB demo for more info

  • Any idea to make something similar as Ms Structured Storage in Labview?

    I read about Ms COM based Structured storage. Are there any idea to make something similar in Labview, or call some external component to make that functions?

    COM is from Component Object Model and the structured storage(SS) is based on it. Shortly SS is a file system within a file with two kind of objects: storage=>directory and stream=>file and COM defines how to treat that objects in a single file system. Some of the features are: simultaneous access to objects (or part of) from multiple applications, direct or transacted access and so on. In direct access the changes are made immediately, in transacted they are buffered and committed or reverted. There are some functions in OLE32.dll but the question is how to implement the full functionality of SS and call it from LV, may be in another dll...

  • Structured Storage

    I have a very simple schema registered called "Books.xsd" with a targetNamespace. This generated the user_xml_table Books4576_TAB.
    I've also created a table BOOKS with an XMLType column and can successfully insert an XML file with a schemaLocation with the targetNamespace and Books.xsd.
    A select from the BOOKS table's XMLType column yields a CLOB of XML. However, a select of the Books4576_TAB table yields no rows. I don't think structured storage is being successfully applied on my insert and the default table is not being populated.
    If I am using structured storage correctly, should the relational tables generated by the register schema command be populated when I perform an insert?

    No, you have LOB based storage for the table you created....
    You need to look at the DDL for the table generated using register Schema and then modify that DDL to create the relational table with the XMLType column. You need to understand that the storeVarrayAsTable directive only applies to the table generated by registerSchema, not to any XMLType tables or columns that are created after the XML Schema is registered.

  • Loading XML Document into Structured Storage

    HI Everybody,
    I am confronted with a BUG in Oracle which is being fixed but will last a long time. I have a relatively complex Schema with manifold includes, imports and inheritances which I can register successfully. The object-relational table is also generated. But loading the instance document with INSERT INTO... fails due to severe internal error. I have not yet tried SQL*Loader, however.
    Please, does anyone know a safe alternative method to parse and load? Structured storage is mandatory because I need to retrieve individual elements and attributes. Instance documents are big, ca. 20 MB.
    Thanks, regards
    Miklos HERBOLY

    HI,
    Oracle version is 11.1.0.7.0.
    Metalink found three bugs related to the error ORA-00600: Interner Fehlercode, Argumente: [qmxConvUnkType], [], [], [], [],
    The bugs are:
    BUG 8644684 ORA-600 [QMXCONVUNKTYPE] DURING INSERT INTO SCHEMA-BASED TABLE
    BUG 8671408 INSERT OF XML DOC INTO AN XML SCHEMA STORED AS BINARY XML FAILS WITH ORA-30937
    BUG 8683472 SCHEMA EXECUTABLE RETURNS INCORRECT ERRORS DURING VALIDATION AGAINST XML SCHEMA
    Well, I have to look round in XML DB Forum yet.

  • Using other site structure storage instead on index.portal

    Hi.
    The question is quite simple. All data about WebLogic portal structure is stored in index.portal XML file. Are there any ways to move data storage from this XML to database, actually to force portal to retrive data about site structure and portlets on pages from database?
    Thanks for all responces.

    Maksim Galushka wrote:
    The question is quite simple. All data about WebLogic portal structure is stored in index.portal XML file. Are there any ways to move data storage from this XML to database, actually to force portal to retrive data about site structure and portlets on pages from database?Yes, use the Portal Administration Tool to create a streaming desktop from the
    .portal file. A streaming desktop is stored in the database so that it can be
    modified and changed at runtime.
    Gerald

  • Permission issues accross schemas to load XMLTYPE column - structured storage

    Hi,
    We have a table in BIUSER schema this table is object-realtionally stored with XMLs. When we are trying to load receords from ETLUSER schema we are getting the error as
    Record 1: Rejected - Error on table "BIUSER"."PWAYWORKFILE_TABLE".
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01031: insufficient privileges
    Heres the oracle installation details
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    "CORE 11.2.0.3.0 Production"
    All the records are moving to the bad file, whereas the same load happens normally in its own schema i.e. BIUSER
    Suspecting this as permission issues we have already given the permission to the table sysnonym as given below in the registration script.
    We googled and found few things about ACLs that we are not sure of , its that is the issue please let us know if this table can be created and loaded from different schema
    Heres the table creation and registration script
    set echo on
    spool regschema.log
    set define on
    set timing on
    set long 100000 pages 0 lines 256 trimspool on timing on
    drop table PWAYWORKFILE_TABLE;
    drop sequence PWAYWORKFILE_TABLE_SEQ;
    begin
    dbms_xmlschema.deleteschema('workfile.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('TotalLoss.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('Salvage.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('rate.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('notes.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('Image.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('Event.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('estimate.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('CoTotals.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('corr.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('Admin.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('Vins.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('commonType.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'commonType.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'commonType.xsd';
    BEGIN
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'Admin.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'Admin.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'CoTotals.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'CoTotals.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'Event.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'Event.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'Image.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'Image.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'Salvage.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'Salvage.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'TotalLoss.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'TotalLoss.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME        VARCHAR2(700) := 'Vins.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'Vins.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      -- DOM Fidelity enabled due to presence of mixed text, substitution group heads, or repeating choice structures in complex type defintion :-
      DBMS_XMLSCHEMA_ANNOTATE.enableMaintainDOM(V_XML_SCHEMA,'RefurbMgr',TRUE);
      select /*+ NO_XML_QUERY_REWRITE */
             XMLQuery(
               'declare namespace xdb = "http://xmlns.oracle.com/xdb"; (:
                copy $NEWSCH := $SCHEMA modify (
                                          let $MODEL := $NEWSCH/xs:schema/xs:complexType[11]/xs:all
                                          return (
                                            replace value of node $MODEL/xs:element[2]/xs:complexType/@xdb:maintainDOM with "false",
                                            replace value of node $MODEL/xs:element[3]/xs:complexType/@xdb:maintainDOM with "false",
                                            replace value of node $MODEL/xs:element[4]/xs:complexType/@xdb:maintainDOM with "false"
                 return $NEWSCH'
               passing V_XML_SCHEMA as "SCHEMA"
               returning content
        into V_XML_SCHEMA
        from dual;
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'corr.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'corr.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'estimate.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'estimate.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'notes.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'notes.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'rate.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'rate.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'workfile.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'workfile.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      -- Out-of-Line mappings for 1000 Column optimization :-
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'AdminComp','ADMINCOMP_XML');
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'NotesComp','NOTESCOMP_XML');
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'SalvageComp','SALVGCOMP_XML');
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'CorrComp','CORRCOMP_XML');
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'ImageComp','IMAGECOMP_XML');
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'EventInterfaceManagerComp','EVIFCMGRCOMP_XML');
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'TotalLossComp','TOTALLOSSCOMP_XML');
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    -- Table creation for namespace "http://www.cccis.com/Pathways/Workfile"
    set lines 80
    CREATE TABLE "PWAYWORKFILE_TABLE"
          SequenceID NUMBER,
          DL_CLM_FOLDER_ID   VARCHAR2(30),
          CUST_CLM_REF_ID VARCHAR(25),
          ems_file_nm               varchar2(256),
          EST_IND         VARCHAR2(3),
          rec_dt date default sysdate,
          filesent_datetime date,
          CLM_TYP_CD               VARCHAR2(2 CHAR),
          WORKFILE  XMLTYPE
    XMLTYPE COLUMN WORKFILE
    STORE AS OBJECT RELATIONAL
    XMLSCHEMA "workfile.xsd" ELEMENT "PwayWorkfile"
    create sequence PWAYWORKFILE_TABLE_SEQ
    start with 1
    increment by 1
    nomaxvalue
    create trigger PWAYWORKFILE_TABLE_TRIGGER
    before insert on PWAYWORKFILE_TABLE
    for each row
    begin
    select PWAYWORKFILE_TABLE_SEQ.nextval into :new.SequenceID from dual;
    end;
    desc PWAYWORKFILE_TABLE
    /* create synonym */
    create or replace public synonym PWAYWORKFILE_TABLE for PWAYWORKFILE_TABLE;
    grant select on PWAYWORKFILE_TABLE to BIUSER_RO;
    grant select, insert, update,delete on PWAYWORKFILE_TABLE to biuser_full;
    exit;
    Regards,
    Arghyadip

    Hi MarcoGralike,
    I have finally acquired a sample schema and xmls to reproduce the errors that i am getting even after acquiring XDBADMIN privilege and registering my schema as GLOBAL.
    Here's the problem i am facing, whenever i intend to store the PublisherList (publisher.xsd) out of line while registration i am running into insufficient privilege issues even if i have the schema registered using (LOCAL => FALSE), whereas it runs smooth in BIUSER and if i dont set it out of line it works in ETLUSER as well.
    Here are the 2 XSD files
    books.xsd   --- this is the root element
    <xs:schema  xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb"  version="1.0" xdb:storeVarrayAsTable="true">
      <xs:include schemaLocation="publisher.xsd"/>
      <xs:element name="books" type="bookType"/>
      <xs:complexType name="bookType" abstract="true">
        <xs:sequence>
        <xs:element name="author" type="xs:string" minOccurs="0"/>
        <xs:element name="title" type="xs:string" minOccurs="0"/>
        <xs:element name="genre" type="xs:string" minOccurs="0"/>
        <xs:element ref="PublisherList" minOccurs="0"/>
       </xs:sequence>
       </xs:complexType>
    </xs:schema>
    publisher.xsd -- this is a child elelment which in my actual scenario is so big that i must keep it out of line during registration
    <xs:schema  xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb"  version="1.0" xdb:storeVarrayAsTable="true">
      <xs:element name="PublisherList" type="PublisherListType"/>
      <xs:complexType name="PublisherListType">
        <xs:sequence>
        <xs:element name="Name" type="xs:string" minOccurs="0"/>
        <xs:element name="Office" type="xs:string" minOccurs="0"/>
       </xs:sequence>
       </xs:complexType>
    </xs:schema>
    Here's the sample XML
    <?xml version="1.0"?>
    <books xmlns:xs="http://www.w3.org/2001/XMLSchema">
          <author>Writer</author>
          <title>The First Book</title>
          <genre>Fiction</genre>
          <PublisherList>
           <Name>Penguin</Name>
           <Office>London</Office>
          </PublisherList>
    </books>
    Here's how i am registering the Schemas in BIUSER which has XDBADMIN privilege
    DROP TABLE BOOKS_TABLE;
    begin
    dbms_xmlschema.deleteschema('books.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('publisher.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'publisher.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'publisher.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
        DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => FALSE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'books.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'books.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
    DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'bookType', 'PublisherList','PUBLISHERLIST_XML');
        DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => FALSE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    CREATE TABLE BOOKS_TABLE
          BOOKS  XMLTYPE
    XMLTYPE COLUMN BOOKS
    STORE AS OBJECT RELATIONAL
    XMLSCHEMA "books.xsd" ELEMENT "books"
    DROP PUBLIC SYNONYM BOOKS_TABLE;
    create or replace public synonym BOOKS_TABLE for BOOKS_TABLE;
    grant select, insert, update,delete on BOOKS_TABLE to ETLUSER;
    Heres the ctl file that i am using
    Load_Books.ctl
    OPTIONS (ERRORS=100000, SILENT=(HEADER,FEEDBACK),ROWS=500, BINDSIZE=3072000 , READSIZE=3072000)
    load data
    infile '/apps/dev/PWXML-10/ctl/load_xml.txt'
    BADFILE '/apps/dev/PWXML-10/ctl/load_xml.txt.bad'
    DISCARDFILE '/apps/dev/PWXML-10/ctl/load_xml.txt.dsc'
    append
    into table BOOKS_TABLE
    filename filler char(120),
    BOOKS lobfile(filename) terminated by eof)
    '/apps/dev/PWXML-10/ctl/load_xml.txt' would contain the XML file path that i gave
    Heres how i am loading the XML through sqlldr in ETLUSER
    sqlldr etluser/etluserpassword@MYXMLDBNAME control=Load_Books.ctl log=Load_Books.ctl.log
    Here's the error i am getting
    Record 1: Rejected - Error on table "BIUSER"."BOOKS_TABLE".
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01031: insufficient privileges
    Hopefully i have given you all the set up required to pin point the evil error.
    Please let me know if i have missed something.

  • "no raws selected" message for structured storage to xml doc

    hi every one , wish really u can help with this problem
    Well …
    One stage of my project is to store an xml file into a table of XMLType column in structured way (using the schema)
    So that’s what I did:
    1.     I copied the schema file into this folder http://localhost:8080/public/
    2.     Then I register the schema
    SQL> ALTER SESSION SET EVENTS='31098 trace name context forever';
    Session altered.
    1 begin
    2 dbms_xmlschema.registeruri(
    3 'http://localhost:8080/public/auction.xsd',
    4 '/public/auction.xsd',
    5 local=>true, gentypes=>true, genbean=>false, gentables=>false);
    6* end;
    SQL> r
    1 begin
    2 dbms_xmlschema.registeruri(
    3 'http://localhost:8080/public/auction.xsd',
    4 '/public/auction.xsd',
    5 local=>true, gentypes=>true, genbean=>false, gentables=>false);
    6* end;
    PL/SQL procedure successfully completed.
    3.     after that I create the table as it mentioned below
    SQL> create table struc_100kb( xmldoc sys.xmltype)
    2 xmltype column xmldoc store as object relational
    3 xmlschema "http://localhost:8080/public/auction.xsd"
    4 element "site";
    Table created.
    SQL>SQL> describe struc_100kb
    Name Null? Type
    XMLDOC SYS.XMLTYPE(XMLSchema "http:
    //localhost:8080/public/auct
    ion.xsd" Element "site") STO
    RAGE Object-relational TYPE
    "site171_T"
    4.     then I used he sqlldr to load the xml document , and that what included in the control file
    load data
    infile *
    replace
    into table struc_100kb
    fields terminated by ','
    fname filler char(40),
    xmldoc lobfile(fname) terminated by EOF
    begindata
    c:\amal\xmldoc\xmldoc_used\doc100kb.xml
    C:\oracle\product\10.1.0\db_1\BIN>sqlldr scott/**** control=c:\amal\work.ctl
    But after that when I run any query such as this
    select e.xmldoc.extract( 'site/people/person[@id="person12"]/name/text()') from struc_100kb e
    I got a message no rows selected
    So whats my problem??

    I thought to show u part of the schema and xml files
    auction.xsd
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by Brian Murphy (wpi) -->
    <!--W3C Schema generated by XML Spy v4.4 U (http://www.xmlspy.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <xs:element name="address">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="street"/>
                        <xs:element ref="city"/>
                        <xs:element ref="country"/>
                        <xs:element ref="province" minOccurs="0"/>
                        <xs:element ref="zipcode"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    doc100kb.xml
    <?xml version="1.0" standalone="yes" ?>
    - <site>
    - <regions>
    - <africa>
    - <item id="item0">
    <location>United States</location>
    <quantity>1</quantity>
    <name>duteous nine eighteen</name>
    <payment>Creditcard</payment>
    - <description>
    - <parlist>
    - <listitem>
    - <text>
    page rous lady idle authority capt professes stabs monster petition heave humbly removes rescue runs shady peace most piteous worser oak assembly holes patience but malice whoreson mirrors master tenants smocks yielded
    <keyword>officer embrace such fears distinction attires</keyword>
    </text>
    ..............

  • Versioning xml and structure storage

    Hi,
    I have following sitiations:
    a. I have registered XML schema
    b. I have put XML resource (based on the schema) into repos and I get new instance of XMLType in generated table.
    That is ok.
    My question is:
    If I put a new XML file as the same resource will I get a new instance of XMLType or
    the previous XMLType will be updated automaticlly ?
    I mean , Can I create many version of the same resource and keep only one instance of XMLType in the XML table ?
    regards,
    Cezary

    Unless you enable versioning each update of the resource will update the corresponding row in the default table.

  • Problems using mathml XML Schema in XMLDB

    I have successfully loaded the hierarchy of XML Schema definition documents for the current 'mathml' by adjusting the relative paths in all include and import statements, and by forcing the load to overcome cyclic dependency issues.
    However when I try to create a table using the XMLTYPE or register another schema which is dependent on mathml I receive the following error:
    ERROR at line 1:
    ORA-31079: unable to resolve reference to group "Content-expr.class"
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 37
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 61
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 126
    ORA-06512: at line 14
    Having tried loading into both 9iR2 and 10GR2 databases and pasting the document containing the 'Content-expr.class' into the parent document (i.e. removing the include) I have come to the conclusion that there is a problem with the schema definition.
    However being new to XML I do not know what ths issue is as the file containing the definition (math.xsd) is included well before the references in the parent document.
    Here is the group definition corresponding to the offending reference:
    <xs:group name="Content-expr.class">
    <xs:choice>
    <xs:group ref="ContExpr.class"/>
    <xs:group ref="PresExpr.class"/>
    </xs:choice>
    </xs:group>
    I am also unable to trace which reference is causing the problem as there are several.
    Does anyone have any suggestions as to what could be causing this issue, or how I can obtain further diagnostics?
    Any help much appreciated.
    Robert Honeyman
    *********** New info ***************
    OK. I have tried further to register the schema, and have the following additional information.
    I determined that I thought my problem was cyclic dependencies being resolved ONLY by virtue of the parent file mathml2.xsd. I therefore pasted all the files together in include order so that this was no longer an issue. I then performed the following actions:
    1. I tried to register into Oracle 9iR2 database (9.2.0.4) and received the following error:
    ERROR at line 1:
    ORA-31151: Cyclic definition encountered for group: "Content-expr.class"
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 0
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 26
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 131
    ORA-06512: at line 14
    2. I then tried registering the schema into an Oracle 10G Release 2 database as well, and received the following error:
    ORA-31084: error while creating table "MEDLINE"."math729_TAB" for element
    "math"
    ORA-01792: maximum number of columns in a table or view is 1000
    ORA-02310: exceeded maximum number of allowable columns in table
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 37
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 61
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 126
    ORA-06512: at line 14
    My conclusions are as follows:
    1. 9iR2 (the version I was using at least 9.2.0.4) can't handle cyclic dependencies at all, or at least not complex ones.
    2. Neither 9iR2 or 10gR2 can handle cyclic dependencies (or other dependent definitions managed purely by virtue of a parent file with multiple include statements)
    3. 10gR2 can handle cyclic dependencies when they are all defined in the same file or resolved by an explicit include regardless of complexity.
    4. 10gR2 cannot handle highly complex XML Schema definitions due its limit of 1000 columns per table.
    Does anyone have any comments on these conclusions?
    I don't even want to handle Mathml, just another schema definition that imports it. I may try to make my own adjustments.
    Message was edited by:
    rhoneyman
    null

    Thanks, I found the relevant sections in the XML DB 10GR2 documentation (chapter 3 I think). As far as I can tell my options are to either use one of the following:
    - top-down technique creating tables for sub elements in the schema definition
    - bottom-up technique collapsing some of the lower elements into CLOBs (I guess this is semi-structured storage)
    The problem with Mathml is that it seems quite complex, with only one global schema element and many nested elements, hence only one table is created by XMLDB and it logically follows that we run out of columns.
    To get it to work is likely to involve a fair amount of manual schema modification, which incurs a maintenance overhead for me.
    It would be good if Oracle could provide a way of simplifying this maintenance of complex schemas to get them to be registered. I guess this would be increasing the number of columns alllowed for a table or offering some other parametric option for DBMS_XMLSCHEMA.REGISTER_SCHEMA that allowed a threshold and either a top-down or bottom-up approach to be taken automatically.
    For the time being I am using a simplified schema that does not depend on Mathml for my storage needs.

  • Organization structure for Case study .... need yr advice

    Hi …I am in process of preparing an org structure for one of the company.
    The company operations is like ….
    The company has four factories in different locations and have 3 Regional distribution centers (RDC) across india. Each distribution center has 5 branches (Sales Offices), in this way they 15 Sales offices across India.
    Most of the materials are procured by factories independently while some materials are centrally procured. Factories produce Finish goods and they are either sale to customer directly ( big regular customers) , or transferred to RDC to cater the requirements of other MID size customers and the other possibility to transfer it to Branches for Retail customers. RDCs also transfer FG to Branches.
    All factories , RDC and branches have warehouse facility , however branches have limited warehouse facility as the customers supported by them are very few and generally deliveries are made directly from RDC / Factory.
    They also have one R&D department in another location to develop new products and material is generally transferred from factories to R&D department.They also have one project division at the same (R&D) location which handles commissioning of new plants and procurement of capital goods.
    Raw Material , Semi finish and FG are transferred between factories and FG material is also transferred between RDCs.
    The group also has another Company which produces another line of products. RDCs and Branches of first company also work for second company (which means same RDC can store FG produced by both companies) and also Branches can also have FG material of both companies. Second company doesn’t have any specific R&D or capital division and R&D and capital of first company also work for second company.
    Inter company transfer between both companies is a regular practice.
    > Proposed Org structure
    Company – Group Company
    Company Code – First company and Second company
    Factory Configurations
    For first company
    4 Factories will be 4 plants
    Factories Structure (Storage locations / warehouses and storage type)
    Since factories have different type of material ( like FG , Raw material , WIP ) therefore I am confused what option I should select 
    1) 3 storage location ( for each plant) and one warehouse, 1 storage type
    2) 1 storage  location and three warehouses (I think this is not possible in SAP , not sure ?? )
    3) 1 storage location , 1 warehouse and 3 storage types
    RDC structure
    RDCs have full fledged warehouse facility and therefore thinking of making them also as Plant. Every RDC will have 6 Storage locations , 1 for First company RDC itself, 5 for associated branches and I feel each “RDC storage locations” should be a associated to a separate warehouse also.
    ( Since both companies produce different set of products therefore they will have different material and hence thinking of handling products of both companies in same plant and same storage location and warehouse , may be two storage type/area can be defined to differentiate material of both companies.)
    Branches: Will be storage locations under RDC …..
    While making branches as Storage location …. I have another question about valuation , since material from Plant and RDC is being transferred to Branches and  from there it is distributed to customers therefore the valuation of FG at BRANCH and RDC should be different as transportation cost , packing , unpacking etc cost should get added at Branch level.
    Therefore in case I make branch as Storage location , I will miss the valuation part while if I make them as Plant then there will be lot of documents get generated for each movement. Hence not sure for what option I should go.
    R&D:
    Since R& D department is involved in testing in New Product development and generally material is required to be scrapped after testing therefore thinking of making it as Plant with one storage location and may be here I don’t need any warehouse (WM) here.
    Project Division
    Project division may also be a separate plant with one storage location and NO WAREHOUSE is required to linked with it.
    Purchase Organizations
    4 purchase organizations for each plant respectively and 1 centralized purchase Org for central procurement.
    Your all valuable inputs are welcome .... looking foward to have a best possible configuration for above mentioned case study.
    Regards

    Phew... long long question
    The rule I generally follow is that the org structure should map reality.
    Company code - where Balance Sheet and Profit and Loss are prepared at the end of the year. If an entity does not do this, it is not a company code.
    Plant
    1) Each manufacturing facility is a plant (could be in 1 location or separate).
    2) Each separate location is a plant (even if it only stores goods). May be an overkill, but helps when legal requirements change or the location is upgraded.
    So in your case, RDC will be a plant (may be more than 1 if necessary). R&D should be a separate plant without warehouse management
    Storage location
    The only rule I follow is that there should not be any overlap of storage locations. So physically, any area of say 1 square foot should belong to one and only one storage location. Otherwise there is a lot of confusion during physical inventory. So logical locations are a no-no.
    I usually use a lot of storage locations.
    Don't have a warehouse spanning multiple plants (even though it is allowed).
    Purchasing organizations
    Have one for each location of purchase. If there is a team sitting in each plant procuring for only that plant, have it as a separate purchasing org (not strictly necessary, but makes authorization simple). For central purchasing, a central purchasing org should do nicely...
    Hope this helps,
    Lakshman

Maybe you are looking for