2 Replies Latest reply: Sep 20, 2012 9:17 AM by mdrake RSS

    Where is xdbconfig.xsd file stored. How to access and modify it

      Can some one tell me where to find the xdbconfig.xsd file in oracle11gr2.

        • 1. Re: Where is xdbconfig.xsd file stored. How to access and modify it
          select schema
          from dba_xml_schemas 
          where schema_url = 'http://xmlns.oracle.com/xdb/xdbconfig.xsd';
          You can also view it from the XML DB repository @ /sys/schemas/PUBLIC/xmlns.oracle.com/xdb/xdbconfig.xsd
          select xdburitype('/sys/schemas/PUBLIC/xmlns.oracle.com/xdb/xdbconfig.xsd').getClob() from dual;
          • 2. Re: Where is xdbconfig.xsd file stored. How to access and modify it
            Are you referring to xdbconfig.xsd or xdbConfig.xml

            xdbConfig.xsd is the XMLSchema that defines the structure for the xdb configuarion file xdbconfig.xml

            You can view the structure of the XML Schema it but you CANNOT modify it.

            It can be found in the reposiitory under the following path
            select * from xmltable('fn:doc("/sys/schemas/PUBLIC/xmlns.oracle.com/xdb/xdbconfig.xsd")')
            or accessed via the ALL_XML_SCHEMAS view
            select schema
              from ALL_XML_SCHEMAS
             where SCHEMA_URL = 'http://xmlns.oracle.com/xdb/xdbconfig.xsd'
            xdbconfig.xml is the configuration document, it is an instance of the type defined by xdbconfig.xsd

            You can modify this document a number of ways..

            The document can be found in the repository
            select * from xmltable('fn:doc("/xdbconfig.xml")')
            select object_value
              from XDB.XDB$CONFIG
            select DBMS_XDB.CFG_GET() 
             from DUAL
            This document can be updated...

            The preferred way of updating it is to use the specific helper functions provided on DBMS_XDB (Note that these functions will start to be migrated to a new package DBMS_XDB_CONFIG in the near future).

            It is also possible to update it using the following methods

            In PL/SQL by using DBMS_XDB.CFG_GET() to read the document into a PL/SQL variable, updateXML etc or XMLQUery or DBMS_XMLDOM to update the in-memory copy and then DBMS_XDB.CFG_UPDATE() to update the configuration file
             procedure setAnonymousAccess(P_STATE VARCHAR2)
              V_XDB_CONFIG XMLType;
              V_XDB_CONFIG := dbms_xdb.cfg_get();
              if (V_XDB_CONFIG.existsNode('/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access') = 0) then
                select insertChildXML
                             XMLType('<allow-repository-anonymous-access xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">' || lower(P_STATE) || '</allow-repository-anonymous-access>'),
                  into V_XDB_CONFIG
                  from dual;
                select updateXML
                  into V_XDB_CONFIG
                  from dual;
              end if;
            In theory you can also perform SQL operations on XDB.XDB$CONFIG, use WebDav to open and edit the document in an DAV enabled XML Editor, or use FTP to unload the document from the repository, edit it by hand and then upload the new copy.

            In general if a helper function exists on DBMS_XDB (or DBMS_XDB_CONFIG) then this is the preferred mechansim.

            WHat are you trying to do