XML schema Registration ??

Hello,
Our environment is
SQL*Plus: Release 9.2.0.4.0
Oracle9i Enterprise Edition Release 9.2.0.4.0
OS Windows 2000
We registered XML schema in XML DB.
oraxdb:schemaURL="PORR_MT030001Fatalities"
<xsd:element name="BiologicsSafetyCase" type="PORR_MT030001.BiologicsSafetyCase" oraxdb:propNumber="271050" oraxdb:global="true" oraxdb:SQLName="BiologicsSafetyCase" oraxdb:SQLType="PORR_MT030001.Biologics1829_T" oraxdb:SQLSchema="HL7_KSMITH" oraxdb:memType="258" oraxdb:defaultTable="BiologicsSafetyCase1840_TAB" oraxdb:defaultTableSchema="HL7_KSMITH"/>
When we query user_xml_tables. It shows following.
SELECT "SYS"."USER_XML_TABLES"."TABLE_NAME" as "TABLE_NAME",
"SYS"."USER_XML_TABLES"."XMLSCHEMA" as "XMLSCHEMA",
"SYS"."USER_XML_TABLES"."ELEMENT_NAME" as "ELEMENT_NAME"
FROM "SYS"."USER_XML_TABLES"
WHERE ( "XMLSCHEMA" LIKE '%Fata%')
TABLE_NAME XMLSCHEMA ELEMENT_NAME
support1807_TAB PORR_MT030001Fatalities support
BiologicsSafetyCase1840_TAB PORR_MT030001Fatalities BiologicsSafetyCase
XXIfTRALI681800_TAB PORR_MT030001Fatalities XXIfTRALI68
location1587_TAB PORR_MT030001Fatalities location
XXEventDescription81799_TAB PORR_MT030001Fatalities XXEventDescription8
manufacturingProcess1793_TAB PORR_MT030001Fatalities manufacturingProcess
partOrganization1611_TAB PORR_MT030001Fatalities partOrganization
organization1616_TAB PORR_MT030001Fatalities organization
locatedPlace1583_TAB PORR_MT030001Fatalities locatedPlace
causedRecipientReacti1798_TAB PORR_MT030001Fatalities causedRecipientReaction
It shows additional O-R tables against different elements.
Is it normal?
How does these tables links with main table oraxdb:defaultTable="BiologicsSafetyCase1840_TAB" shows in registered schema header?
Do we able to segment this schema ?
Let me know your thought.
Thanks in advance.
Ram

Hello,
Our environment is
SQL*Plus: Release 9.2.0.4.0
Oracle9i Enterprise Edition Release 9.2.0.4.0
OS Windows 2000
We registered XML schema in XML DB.
oraxdb:schemaURL="PORR_MT030001Fatalities"
<xsd:element name="BiologicsSafetyCase" type="PORR_MT030001.BiologicsSafetyCase" oraxdb:propNumber="271050" oraxdb:global="true" oraxdb:SQLName="BiologicsSafetyCase" oraxdb:SQLType="PORR_MT030001.Biologics1829_T" oraxdb:SQLSchema="HL7_KSMITH" oraxdb:memType="258" oraxdb:defaultTable="BiologicsSafetyCase1840_TAB" oraxdb:defaultTableSchema="HL7_KSMITH"/>
When we query user_xml_tables. It shows following.
SELECT "SYS"."USER_XML_TABLES"."TABLE_NAME" as "TABLE_NAME",
"SYS"."USER_XML_TABLES"."XMLSCHEMA" as "XMLSCHEMA",
"SYS"."USER_XML_TABLES"."ELEMENT_NAME" as "ELEMENT_NAME"
FROM "SYS"."USER_XML_TABLES"
WHERE ( "XMLSCHEMA" LIKE '%Fata%')
TABLE_NAME XMLSCHEMA ELEMENT_NAME
support1807_TAB PORR_MT030001Fatalities support
BiologicsSafetyCase1840_TAB PORR_MT030001Fatalities BiologicsSafetyCase
XXIfTRALI681800_TAB PORR_MT030001Fatalities XXIfTRALI68
location1587_TAB PORR_MT030001Fatalities location
XXEventDescription81799_TAB PORR_MT030001Fatalities XXEventDescription8
manufacturingProcess1793_TAB PORR_MT030001Fatalities manufacturingProcess
partOrganization1611_TAB PORR_MT030001Fatalities partOrganization
organization1616_TAB PORR_MT030001Fatalities organization
locatedPlace1583_TAB PORR_MT030001Fatalities locatedPlace
causedRecipientReacti1798_TAB PORR_MT030001Fatalities causedRecipientReaction
It shows additional O-R tables against different elements.
Is it normal?
How does these tables links with main table oraxdb:defaultTable="BiologicsSafetyCase1840_TAB" shows in registered schema header?
Do we able to segment this schema ?
Let me know your thought.
Thanks in advance.
Ram

Similar Messages

  • XML SCHEMA registration for XML TYPE (storing XML files in Oracle 10g)

    I have created the XML Schema for the XML file stored in Oracle 10g and also added this Schema into the database. I have related that schema with the column in the table which contains the XML file. When i execute the query to fetch the data from the stored file i am getting a blank resultset. Is registering the XML Schema is necessary, if yes then please let me know the process of doing it. I have tried following steps to register Schema, but it is not working
    Step1:
    DECLARE
    v_return BOOLEAN;
    BEGIN
    v_return := dbms_xdb.createFolder('/home/');
    v_return := dbms_xdb.createFolder('/home/DEV/');
    v_return := dbms_xdb.createFolder('/home/DEV/xsd/');
    v_return := dbms_xdb.createFolder('/home/DEV/messages/');
    v_return := dbms_xdb.createFolder('/home/DEV/employees/');
    COMMIT;
    END;
    STEP 2:
    Connecting To XML DB
    Step3:
    Register XML schema
    I am failing to execute step number 2 and hence not able to register the schema also.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by sudeepk:
    If a java exception is thrown probably during ur install u might have forgotten
    grant javauserpriv to scott;
    grant javasyspriv to scott;
    Thanks
    [email protected]
    <HR></BLOCKQUOTE>
    Thank you!!!

  • XML Schema registration error

    We installed XMLDB on Oracle Server Enterprise Edition 9.2.0.3 (AIX 4.3 version).
    The status from DBA_REGISTRY for Oracle XML DB is VALID.
    When trying to register schema, we get following error:
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 0
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 12
    ORA-06512: at line 35
    Here are the steps:
    1. Connect as SYS
    2. grant xdbadmin to wb_interface;
    3. connect as wb_interface;
    4. Try to register schema as follows
    declare
    doc varchar2(1000) := '&lt;schema
    targetNamespace="http://www.oracle.com/PO.xsd"
    xmlns:po="http://www.oracle.com/PO.xsd"
    xmlns="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;complexType name="PurchaseOrderType"&gt;
    &lt;sequence&gt;
    &lt;element name="PONum" type="decimal"/&gt;
    &lt;element name="Company"&gt;
    &lt;simpleType&gt;
    &lt;restriction base="string"&gt;
    &lt;maxLength value="100"/&gt;
    &lt;/restriction&gt;
    &lt;/simpleType&gt;
    &lt;/element&gt;
    &lt;element name="Item" maxOccurs="1000"&gt;
    &lt;complexType&gt;
    &lt;sequence&gt;
    &lt;element name="Part"&gt;
    &lt;simpleType&gt;
    &lt;restriction base="string"&gt;
    &lt;maxLength value="1000"/&gt;
    &lt;/restriction&gt;
    &lt;/simpleType&gt;
    &lt;/element&gt;
    &lt;element name="Price" type="float"/&gt;
    &lt;/sequence&gt;
    &lt;/complexType&gt;
    &lt;/element&gt;
    &lt;/sequence&gt;
    &lt;/complexType&gt;
    &lt;element name="PurchaseOrder" type="po:PurchaseOrderType"/&gt;
    &lt;/schema&gt;';
    begin
    dbms_xmlschema.registerSchema('http://www.oracle.com/PO.xsd', doc);
    end;
    Please Help!!!

    check if the user already has the following privileges.
    CREATE SESSION
    CREATE TABLE
    CREATE TRIGGER
    CREATE TYPE
    ALTER SESSION
    Else grant them.
    The problem only comes when use do this in pl/sql.
    here is a work around example.
    create or replace function get_xml_data return varchar2 is
    doc varchar2(1000) := '<schema
    targetNamespace="http://www.oracle.com/PO.xsd"
    xmlns:po="http://www.oracle.com/PO.xsd"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <complexType name="PurchaseOrderType">
    <sequence>
    <element name="PONum" type="decimal"/>
    <element name="Company">
    <simpleType>
    <restriction base="string">
    <maxLength value="100"/>
    </restriction>
    </simpleType>
    </element>
    <element name="Item" maxOccurs="1000">
    <complexType>
    <sequence>
    <element name="Part">
    <simpleType>
    <restriction base="string">
    <maxLength value="1000"/>
    </restriction>
    </simpleType>
    </element>
    <element name="Price" type="float"/>
    </sequence>
    </complexType>
    </element>
    </sequence>
    </complexType>
    <element name="PurchaseOrder" type="po:PurchaseOrderType"/>
    </schema>';
    begin
    return doc;
    end;
    exec dbms_xmlschema.registerSchema('http://www.oracle.com/PO.xsd', get_xml_data);
    good luck.

  • Oracle Xml Schema Registration problem.

    Hi Gurus,
    I tried to register a schema using an xsd named 'EntityBase.xsd', using the following block. It got registered successfully.
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL => 'http://xmlns.oracle.com/xdb/EntityBase.xsd',
    SCHEMADOC => bfilename('XMLDIR','EntityBase.xsd'),
    LOCAL => FALSE,
    CSID => nls_charset_id('AL32UTF8'));
    END;
    select local,schema_url,int_objname,qual_schema_url from dba_xml_schemas where schema_url like
    '%http://xmlns.oracle.com/xdb/EntityBase.xsd%';
    This gives me a record.
    Now I have another xsd, VersionedEntity.xsd with which I would like to register another schema. In the xsd definition for VersionedEntity.xsd, it has Entity.xsd being used and which is already registered and the .xsd exists in the same directory 'XMLDIR'. But when I register using the following block,
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL => 'http://xmlns.oracle.com/xdb/VersionedEntity.xsd',
    SCHEMADOC => bfilename('XMLDIR','VersionedEntity.xsd'),
    CSID => nls_charset_id('AL32UTF8'));
    END;
    I get
    ORA-31000: Resource 'EntityBase.xsd' is not an XDB schema document
    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 2
    Please help me with your expert advice. Am I doing something wrong?
    Thanks and Regards,

    There is a forum dedicated to XML...
    XML DB

  • Not simple xml schema registration

    How can i register schema from xsd file that contain includes of other xsd files, like "<xs:include schemaLocation="common/dataTypes.xsd"/>".

    How can i register schema from xsd file that contain includes of other xsd files, like "<xs:include schemaLocation="common/dataTypes.xsd"/>".

  • Exp XML Schema (.xsd) to another schema on same instance

    Hello,
    I hope someone on this forum can help me or point me in the correct direction. I want to export a schema which contains a table (EQUIPMENT) which has a XMLType column defined against a registered .xsd. I would then like to restored this schema to another schema on the same instance (development instance) and also onto another db instance.
    I have been trying to do this with the help of "Chapter 30 Importing and Exporting XMLType Tables" from the Oracle® XML DB Developer's Guide
    10g Release 2 (10.2). Unfortunately without success. At the end of this message I have encluded sample error messages that I am receiving for creation of TYPES which is causing my import to fail.
    I cannot find any examples on the web on how to achieve an exp from one schema and imp in another either on the same instance or another one.
    DDL for my table is :
    create table EQUIPMENT
    ID number(7) not null,
    STATUSID number(7) not null,
    ATTRIBUTEDATA xmltype
    xmltype column ATTRIBUTEDATA xmlschema "EQUIPMENT.xsd" element EQUIPMENT_XML
    tablespace TBS_DATA1;
    Three test runs as follows:
    1. Using an empty u2 schema and I register the .xsd file. Then I try to import (FROMUSER - TOUSER imp mode) my dump file which leads to the following error:
    IMP-00017: following statement failed with ORACLE error 2304:
    "CREATE TYPE "MTA1440_T" TIMESTAMP '2007-11-14:14:42:16' OID '3EE57B10307317"
    "74E044080020C94102' AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T",""
    "ATTRIBUTE_01" NUMBER(38),"ATTRIBUTE_02" VARCHAR2(4000 CHAR),"ATTRIBUTE_03" "
    "VARCHAR2(4000 CHAR),"ATTRIBUTE_04" NUMBER(38),"ATTRIBUTE_05" VARCHAR2(4000 "
    "CHAR))FINAL INSTANTIABLE "
    IMP-00003: ORACLE error 2304 encountered
    NOTE: Even though import failed, I now see a new TYPE created called "MTA1526_T".
    2. If I try to create the TYPE as is from the error above I get the following error:
    SQL> CREATE TYPE MTA1440_T
    2 OID '3EE57B1030731774E044080020C94102'
    3 AS OBJECT (SYS_XDBPD$ XDB.XDB$RAW_LIST_T,
    4 ATTRIBUTE_01 NUMBER(38),
    5 ATTRIBUTE_02 VARCHAR2(4000 CHAR),
    6 ATTRIBUTE_03 VARCHAR2(4000 CHAR),
    7 ATTRIBUTE_04 NUMBER(38),
    8 ATTRIBUTE_05 VARCHAR2(4000 CHAR)) FINAL INSTANTIABLE;
    9 /
    CREATE TYPE MTA1440_T
    ERROR at line 1:
    ORA-02304: invalid object identifier literal
    3. So now I create the "MTA1440_T" type without the OID value and retry the import.
    IMP-00061: Warning: Object type "U2"."MTA1440_T" already exists with a different identifier
    "CREATE TYPE "MTA1440_T" TIMESTAMP '2007-11-14:14:42:16' OID '3EE57B10307317"
    "74E044080020C94102' AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T",""
    "ATTRIBUTE_01" NUMBER(38),"ATTRIBUTE_02" VARCHAR2(4000 CHAR),"ATTRIBUTE_03" "
    "VARCHAR2(4000 CHAR),"ATTRIBUTE_04" NUMBER(38),"ATTRIBUTE_05" VARCHAR2(4000 "
    "CHAR))FINAL INSTANTIABLE "
    Questions from me:
    A. Can I export TYPES only as suggested by the online documentation ?
    B. If importing onto same instance in another schema surely the OID for the TYPE will always fail - so then why can the import not create the required TYPE name itself during the import ?
    C. Should I use global TYPES and Register the .XSD globally for all schema's in an instance to validate against .. would this prevent me from having errors on an import ?
    I would appreciate any insight any one could provide me. Many thanks in advance.
    Dom

    Hi Guys,
    Thank you all for the replies. I am dissappointed to hear that in 10g does not support exp/imp of schema's structured XML. However I am a little confused or should I say mislead by the "" documentation I
    Here is an extract from chapter "30 - Importing and Exporting XMLType Tables" from the Oracle XML DB 10g Developers Guide documentation:
    "..... Oracle Database supports the import and export of XML schema-based XMLType tables. An XMLType table depends on the XML schema used to define it. Similarly the XML schema has dependencies on the SQL object types created or specified for it. Thus, exporting a user with XML schema-based XMLType tables, consists of the following steps:
    1. Exporting SQL Types During XML Schema Registration. As a part of the XML
    schema registration process .....
    2. Exporting XML Schemas. After all the types are exported, XML schemas are
    exported as XML text .....
    3. Exporting XML Tables. The next step is to export the tables. Export of each table consists of two steps:
    A. The table definition is exported as a part of the CREATE TABLE statement....
    B. The data in the table is exported as XML text. Note that data for out-of-line
    tables is.....
    From this documentation I was under the impression that the exp/imp of XML Schema-Based XMLType Tables was supported.
    Regarding the backup mechanism/strategy for database schema's containing tables with Schema-Based XMLTypes what would you recommend the best online backup method to use - tablespace backups ?
    What I need to be able to do in day-to-day work is to have the ability to be able to take a copy of a customers UAT or production database schema and apply it to a dev or test db instance here for bug testing etc. Do you have any advice on best to achieve this without the use of an exp/imp when the schema will contain Schema-Based XMLType tables.
    Thank you all for your assistance so far.

  • Xml schema egistration

    i am new to xml . i using oracle 11g.while reading xml i came to know that xml schema registration.
    is it compulsary to work with xml data.what is the advantages of xml schema registration. with out registration also i am able to create xmltype tables and i am able to fetch data from tables. then what is the purpose of schema registration
    schema registration means what happening exactly.

    Schema Registration typically leads to better performance. With Binary XML / XML Index the differences are not critical for most applications. It also allows for better datatyping and compression, since if we tags and datatypes in advance we do do a more efficient encoding. For certain classes of applicaiton, where the object relational storage model is appropraite schema registration can lead to significantly better performance. See the XML DB basic demo for more info and the Hands on Lab for info related to Binary XML and XML Index

  • Facing problem in xml schema xsd file registration

    Hi,
    i am facing problem in xml schema xsd file registration when
    the number of column is more. It is showing persing error.
    if i am deleting few column from xsd file . It is working otherwise
    showing error. Is there any solution for that please suggest me.
    The Error is
    ORA-31011:XML parsing failed
    ORA_19202: Error occurred in XML processing
    LPX-00230 : (message vary time to time-like invalid tag ending etc.)
    Regards
    Manoranjan
    and thanks in advance

    Where is you XML coming from. Are you sure it's valid. If you are hard coding it as a SQL String constant are you hitting the 4k / 32K limit on the size of SQL / PL/SQL constant. Have you tried loading the content from a bfile..

  • How can I  refer an xml  Schema that was registred in Oracle xml DB

    How can I refer an xml Schema that was registred in Oracle xml DB, from other xml schema?
    I have the follow schema,:
    <?xml version="1.0" encoding="AL32UTF8"?>
    <xsd:schema targetNamespace="schemastipostasa.xsd"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xdb="http://xmlns.oracle.com/xdb/XDBSchema.xsd"
    elementFormDefault="unqualified" version="1.0"
    attributeFormDefault="unqualified">
    <xsd:simpleType name="codigosType" xdb:SQLType="NUMBER(4)">
    <xsd:restriction base="xsd:positiveInteger" >
    <xsd:totalDigits value="4" />
    </xsd:restriction>
    </xsd:simpleType >
    <xsd:simpleType name="integerUnoType" xdb:SQLType="NUMBER(1)">
    <xsd:restriction base="xsd:int" >
    <xsd:totalDigits value="1" />
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="condicionType" xdb:SQLType="VARCHAR2(1)">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="S" >
    <xsd:annotation>
    <xsd:documentation>Condicion si es S</xsd:documentation>
    </xsd:annotation>
    </xsd:enumeration>
    <xsd:enumeration value="N" >
    <xsd:annotation>
    <xsd:documentation>Condicion no es N</xsd:documentation>
    </xsd:annotation>
    </xsd:enumeration>
    </xsd:restriction>
    </xsd:simpleType >
    </xsd:schema>
    I registred the schema written above with the folowwing pl*sql :
    DECLARE
    direc varchar2(2000);
    nombreArch BFILE;
    mens varchar2(2000);
    BEGIN
    direc:=uso_comun.pack_mail.fun_valor_param('TASA','DIR_DBSERVER');
    nombreArch:=bfilename(direc,'schemas_tipos_tasa.xsd');
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL => 'http://xmlns.oracle.com/tasa/schemas.tipos.tasa.xsd',
    SCHEMADOC => nombreArch,
    LOCAL => TRUE,
    CSID => nls_charset_id('AL32UTF8'));
    dbms_lob.CLOSE(nombreArch);
    dbms_output.put_line('salio sin cancelar');
    exception
    when others then
    mens:=sqlerrm;
    dbms_lob.CLOSE(nombreArch);
    rollback;
    raise_application_error (-20001,'en registro shcema='||mens);
    END;
    Then, I want to register the following schema, that mention de schema above:
    <?xml version="1.0" encoding="AL32UTF8"?>
    <xsd:schema targetNamespace="schema.repuesto.xsd"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xdb="http://xmlns.oracle.com/xdb/XDBSchema.xsd"
    xmlns:tns="http://xmlns.oracle.com/tasa/schemas.tipos.tasa.xsd"
    elementFormDefault="qualified" version="1.0"
    attributeFormDefault="unqualified" >
    <xsd:element name="PRECIORENG" type="preciorepType" />
    <xsd:complexType name="preciorepType" >
    <xsd:sequence minOccurs="1" maxOccurs="unbounded">
    <xsd:element name="CODIGO_MARCA" type="tns:codigosType" />
    <xsd:element name="ORIGEN_PRECIO" type="tns:integerUnoType" />
    <xsd:element name="INGRESO_POR_FALTANTE" type="tns:condicionType" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    But when a run the following script whith the same db-user:
    DECLARE
    direc varchar2(2000);
    nombreArch BFILE;
    mens varchar2(2000);
    BEGIN
    direc:=uso_comun.pack_mail.fun_valor_param('TASA','DIR_DBSERVER');
    -- nombreArch:=bfilename(direc,'prueba_schema_seis.xsd');
    nombreArch:=bfilename(direc,'Schema_repuesto_nuevo.xsd');
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL =>'http://xmlns.oracle.com/tasa/schema.repuesto.xsd',
    SCHEMADOC => nombreArch,
    LOCAL => TRUE,
    CSID => nls_charset_id('AL32UTF8'));
    dbms_lob.CLOSE(nombreArch);
    dbms_output.put_line('salio sin cancelar');
    --commit;
    exception
    when others then
    mens:=sqlerrm;
    dbms_lob.CLOSE(nombreArch);
    rollback;
    raise_application_error (-20001,'en registro shcema='||mens);
    END;
    tell me the error: ORA: 01031, insufficient privileges!!!!, what’s wrong??,

    Hi,
    To register schema, you require XDBADMIN system privilege granted to the user.
    Please verify this and retry.
    Rgds,
    Rakesh Tripathi

  • Registration Of XML Schema

    Hi All,
    Created below block for registration of the XML Schema in database.
    Which is working fine.
    But strange thing is happing, actually when i am creating below code as stored procedure and executing sql prompt getting insufficent privilage.
    When running below code in form of unnamed block(Aynomanus Block) is working fine.
    Can you please help me understand why strange thing is happing.
    DECLARE
    PROCEDURE register_xml(p_schema_url VARCHAR2,p_xmlfile_url VARCHAR2,p_dir_name VARCHAR2)
    IS
    l_folders VARCHAR2(32767);
    PROCEDURE check_folders(p_folders VARCHAR2)
    IS
    v_return BOOLEAN;
    folder_exists EXCEPTION;
    PRAGMA EXCEPTION_INIT(folder_exists, -31003);
    l_pass NUMBER;
    BEGIN
    FOR i IN 1..(LENGTH(p_folders)-LENGTH(REPLACE(p_folders,'/'))) LOOP
    BEGIN
    IF SUBSTR(p_folders,1,INSTR(p_folders,'/',1,i+1)) IS NOT NULL THEN
    v_return := DBMS_XDB.CREATEFOLDER(SUBSTR(p_folders,1,INSTR(p_folders,'/',1,i+1)));
    END IF;
    EXCEPTION
    WHEN folder_exists THEN
    NULL;
    END;
    END LOOP;
    Dbms_Output.put_line('Commit Executed');
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20001,'Error while creating folders',TRUE);
    END check_folders;
    PROCEDURE register_xml_schema(p_xsd_url VARCHAR2,p_dir VARCHAR2)
    IS
    l_ret BOOLEAN;
    BEGIN
    l_ret := DBMS_XDB.CREATERESOURCE(
    abspath => SUBSTR(p_xsd_url,INSTR(p_xsd_url,'/',1,3)),
    data => BFILENAME (p_dir,SUBSTR(p_xsd_url,INSTR(p_xsd_url,'/',-1)+1))
    IF l_ret THEN
    DBMS_XMLSCHEMA.REGISTERSCHEMA(
    schemaurl => p_xsd_url,
    schemadoc => sys.UriFactory.getUri(SUBSTR(p_xsd_url,INSTR(p_xsd_url,'/',1,3)))
    COMMIT;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20002,'Error while registring schema xsd file',TRUE);
    END register_xml_schema;
    PROCEDURE register_xml_file(p_xml_url VARCHAR2,p_dir VARCHAR2)
    IS
    v_return BOOLEAN;
    l_folders VARCHAR2(32767);
    BEGIN
    l_folders := SUBSTR(p_xml_url,
    INSTR(p_xml_url,'/',1,3),
    (INSTR(p_xml_url,'/',1,(LENGTH(p_xml_url)-LENGTH(REPLACE(p_xml_url,'/'))))-INSTR(p_xml_url,'/',1,3))+1
    DBMS_OUTPUT.PUT_LINE('Folders -->'||l_folders);
    check_folders(l_folders);
    v_return := DBMS_XDB.CREATERESOURCE(
    abspath => SUBSTR(p_xml_url,INSTR(p_xml_url,'/',1,3)),
    data => BFILENAME (p_dir,SUBSTR(p_xml_url,INSTR(p_xml_url,'/',-1)+1))
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20003,'Error while registring xml file',TRUE);
    END register_xml_file;
    PROCEDURE delete_schema(p_schema_url VARCHAR2,p_xml_url VARCHAR2)
    IS
    BEGIN
    DBMS_XDB.DELETERESOURCE(
    abspath => SUBSTR(p_xml_url,INSTR(p_xml_url,'/',1,3))
    DBMS_XDB.DELETERESOURCE(
    abspath => SUBSTR(p_schema_url,INSTR(p_schema_url,'/',1,3))
    DBMS_XMLSCHEMA.DELETESCHEMA(
    schemaurl => p_schema_url,
    delete_option => 4
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END delete_schema;
    BEGIN
    l_folders := SUBSTR(p_schema_url,
    INSTR(p_schema_url,'/',1,3),
    (INSTR(p_schema_url,'/',1,(LENGTH(p_schema_url)-LENGTH(REPLACE(p_schema_url,'/'))))-INSTR(p_schema_url,'/',1,3))+1
    check_folders(l_folders);
    delete_schema(p_schema_url,p_xmlfile_url);
    register_xml_schema(p_schema_url,p_dir_name);
    register_xml_file(p_xmlfile_url,p_dir_name);
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20004,'Error while working with XML Schema Structure',TRUE);
    END register_xml;
    BEGIN
    register_xml('http://localhost:8080/public/demo/xsd/db_objects.xsd','http://localhost:8080/public/demo/xsd/db_objects.xml','XML_DIR');
    END;
    Thanks
    Sandeep

    I cannot help you, but i can say that I have the same your problem, everything works fine if i run in an anonymous block, while gettin insufficient privileges when run it in a store procedure.

  • Error while registring xml schema

    Hi,
    I am trying to register following xml schema,
    BEGIN
    dbms_xmlschema.registerSchema(
    'ocastatus.xsd',
    '<?xml version="1.0"?>
    <xsd:schema
    targetNamespace="http://xmlbeans.apache.org/ocastatus"
    xmlns="http://xmlbeans.apache.org/ocastatus"
    elementFormDefault="qualified"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xdb="http://xmlns.oracle.com/xdb">
    <xsd:element name="ocaStatus" type="OCASTATUS_TYPEType"/>
    <xsd:complexType name="OCASTATUS_TYPEType" xdb:SQLType="OCASTATUS_TYPE">
    <xsd:sequence>
    <xsd:element name="status" type="STATUS_TYPEType" xdb:SQLName="status" maxOccurs="unbounded" xdb:SQLCollType="STATUS_V"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="STATUS_TYPEType" xdb:SQLType="STATUS_TYPE">
    <xsd:sequence>
    <xsd:element name="statusCode" type="xsd:double" xdb:SQLName="statusCode" xdb:SQLType="NUMBER"/>
    <xsd:element name="statusDate" xdb:SQLName="statusDate" xdb:SQLType="VARCHAR2">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="50"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="userId" xdb:SQLName="userId" xdb:SQLType="VARCHAR2">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="50"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="comment" xdb:SQLName="comment" xdb:SQLType="VARCHAR2">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="100"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>',
    true,
    true,
    false);
    END;
    While doing so, I am getting following error,
    ORA-20001: enable_hierarchy_internal
    ORA-06512: at "XDB.DBMS_XDBZ", line 28
    ORA-06512: at line 1
    ORA-06512: at "XDB.DBMA_XMLSCHEMA_INT", line 3
    ORA-06512: at "XDB.DBMA_XMLSCHEMA", line 14
    ORA-06512: at line 2
    Vendor code 20001 Error at line: 1
    I have no clue about this errors. I don't know if it is linked to user privileges.
    The user I am using has following privileges,
    CREATE SESSION
    CREATE TABLE
    CREATE CLUSTER
    CREATE SEQUENCE
    CREATE PROCEDURE
    CREATE TRIGGER
    CREATE TYPE
    CREATE OPERATOR
    CREATE INDEXTYPE
    Please help.
    Thanks in advance.

    I would need the full database version (all digits) to be able to answer it, so could you please provide this.
    The other, strange thing, in this example that you gave is the ORA-20001 error... This is not (afaik) an Oracle thrown error but a user defined error as shown, for example, in this post http://www.dbmotive.com/oracle_error_codes.php?errcode=20001.
    As it is, IMHO, correctly stated in that post:
    Error messages starting from -20000 until -20999 are user specified error messages.
    Oracle provides these range of codes so applications can raise an application specific error, which will be displayed after the chosen code.
    This is done using the raise_application_error pl/sql function.
    You'll have to contact the application provider should you want to have more detail about the error message.
    Unless the error message is of an Oracle application or functionality, it is useless to contact Oracle for these errors.

  • Performance issues with respect scheme registration,select & insert query

    I am facing performance issues with respect to schema registration,Select & insert query towards 10.2.0.3 version.It is taking around 45 minutes to register schema and it is taking around 5 min to insert a single document into xml db where as it was taking less than min to insert a single document into xml db of 9.2.0.6 version.Would like to know the issue and solution to resolve this issue.Please help me out on this as it is very urgent for me

    Since it appears that this is an XML DB specific question, you're probably better off posting in the XML DB. The folks over there have much more experience with the ins and outs of that particular product.
    Justin

  • How can i change a xmltype column's xml schema?

    i create a table that have a xmltype column.this column is schema-based.
    my problem is ,
    now i want to this column's schema will be redefined to a global schema?
    [b]how can i change the column's schema which already have a schema?

    When a schema is registered a lot of additonal annotations are added to the XML schema by the schema registration process - Look at the version of the XML schema under /sys/schemas/... in the XML DB repository. This information is unqiue to that version of the XML schema and is used internally to manage instance level metadata.
    When instance documents are stored in the DB a set of metadata is generated for each document so that we can make sure that we can maintain DOM Fidelity. This metadata is tied directly to the XML schema the document is associated and is only valid in the context of that XML Schema.
    So when the schema is registered locally and instances are stored the generated metadata is only valid in the context of the local schema. If the same schema is now registered globally new values will be generated for the annotations applied to the global version of the XML schema. Consequently the metadata associated with a document belonging to the local version of the XML schema has no meaning when viewed in the context of the global version of the XML schema.
    The net effect of this is that you will need to copy the data in order to get documents where the metadata for each document is based on the global version of the XML SChema.

  • Error while trying to use BFILENAME during schema registration

    Hi,
    I'm having difficulty in understanding the BFILENAME function while trying to register a schema. The schema is physically present in the following location
    USERNAME: WEBUSER
    LOCATION: XML Schemas ---> MyHeaderSchema.xsd
    And I'm trying to register it as follows:
    declare
    V_XML_SCHEMA XMLTYPE := XMLType(BFILENAME('WEBUSER','MyHeaderSchema.xsd'),nls_charset_id('AL32UTF8'));
    begin
    DBMS_XMLSCHEMA.registerSchema
    SCHEMAURL => 'http://my.schemas.com/header.xsd',
    SCHEMADOC => V_XML_SCHEMA,
    LOCAL => TRUE,
    GENBEAN => FALSE,
    GENTYPES => TRUE,
    GENTABLES => FALSE,
    ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    I get the error:
    Error report:
    ORA-22285: non-existent directory or file for FILEOPEN operation
    ORA-06512: at "SYS.XMLTYPE", line 296
    ORA-06512: at line 2
    22285. 00000 - "non-existent directory or file for %s operation"
    *Cause:    Attempted to access a directory that does not exist, or attempted
    to access a file in a directory that does not exist.
    *Action:   Ensure that a system object corresponding to the specified
    directory exists in the database dictionary, or
    make sure the name is correct.
    Can you please help?

    I was curious if there was already some functionality in SQL Developer I might have missed. So I checked. Apparently SQL Developer still doesn't have any functionality to support XML Schema's in / for XMLDB (I keep them asking, but anyway).
    So an XML Schema is just treated as plain text. Still.
    However, the following worked for me. Is there a difference if I use XDBURIType Vs BFILENAME and do a getBLOB() Vs XMLType?XDBUriType is part of the URIType factory functionality and in this case, XDBUritype enables you to get the content stored out of the XDB Repository
    BFileName give you the possibility to get your content from the server via a BFile locator construct
    getBLOB is an operator on xdburitype and converts the uritype datatype into binary LOB datatype
    XMLType is the datatype that should be used for XML content
    If you use GENTYPES => TRUE then during registration via using DBMS_XMLSCHEMA objects and types will be created to "represent" the "format" of the XML defined by the XML Schema.

  • Error downloading XML schema processor for java from OTN

    I'm getting error downloading this product from otn site. http://technet.oracle.com/tech/xml/schema_java/index.htm
    I login to OTN, go to this site, enter registration information and then I get the following error when I try to submit my info.
    Runtime error occured. Do you wish to debug?
    Line: 20
    Error :'e_mail_valid' is undefined.
    When I say 'No' for debug, it takes me to 'XML parser for java' download page instead of 'XML Schema processor'.
    please help.
    thankx
    null

    The 'e_mail_valid' is undefined" has to do with the format of or lack of the email address. The routing problem is ours and should be fixed later today or by tomorrow morning.
    Thanks,
    Oracle XML Team

Maybe you are looking for

  • ITunes unknown error (-200) (and others)

    Just switched from a iPod mini to an older 20 gig. Tried to sync it. iTunes crashed. Made me reformat the iPod. Lost all music on it. Also, no audio was playing. Told me to update iTunes. (thinking it would solve the sync issue) I did. iTunes wont op

  • My ipod touch 5 does not sync to itunes and does not let me add music to my ipod

    when i connect my ipod to my computer it doesn't let me sync or add music. i tried connecting it to a different computer but it still doesn''t work. when i connect any other devices like my phone and ipad it syncs and adds music but it doesn't work f

  • Install Application error

    I have 2 client workspaces 102 (Live) and 105 (Testing) and also have the same thing replicated in my own environment 102 and 105, the idea is that I develop changes in my 105 workspace and export/import into the client 105 for testing and then the c

  • WM Inventory

    Guys, Our requirement is that we have to perform a 562 on a non serialized material assign a serial number profile and perform a 561 to put it back to stock with a serial number. So when we do a 562 in IM a negative quant in 998 Delta is created.On p

  • Adobe Application (Bridge & photoshop)keep crashing

    HI All, I am having issue with Adobe Bridge and Photo shop. Both are crashing. few weeks ago there was issue with the Hard drive and I thought it could be related to that. I replaced with a new HD and installed windows and Adobe suite from scratch. I