1 2 Previous Next 16 Replies Latest reply: Jun 25, 2012 9:59 AM by Marco Gralike RSS

    webdav and xdb, xml-files are automatically deleted (or hidden)

    604709
      Hi All.

      In our project we have mounted webdav from a Linux box against an IBM database server running AIX and Oracle 11g.
      The file system on the Linux box is mounted to the xdb-schema on the dbserver.

      When placing xml-files into the database through the webdav-catalogue on the Linux-box the files are copied over, but almost immediatly removed (or hidden) from the target directory in the database.
      I´m thinking there might be a trigger that tries to validate the xml-file against an xsd that isn´t registered in XDB. The reason for this is that when suffixing these files with something other than .xml the files are kept visible to all users.
      What I´d like to know is how to disable this check/trigger, and which trigger does this.

      Can anybody tell me if my assumtion is correct, and if yes, how to disable this checking?
      Our users in the project will also be given access to folders through this webdav mount, and they will use this as a storage space for other xml-files as well. Files we do not have xsd´s for. Another function for this webdav directory is to serve as a source directory for ODI, and ODI validates the files against the xsd when transferring data to the database, so we don´t need this extra validation in the database.

      Thanks,
      Bob
        • 1. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
          odie_63
          Hi,

          What's the database version? (select * from v$version)
          When placing xml-files into the database through the webdav-catalogue on the Linux-box the files are copied over, but almost immediatly removed (or hidden)
          Does that mean you see them for a short period of time, and then they disappear, or you never see them at all?

          Are you using XML DB events?

          You can check if there's any resource configuration defined, and that may explain this behaviour :
          select x.* 
          from xdb.xdb$resconfig rc
             , xmltable(
                 xmlnamespaces(default 'http://xmlns.oracle.com/xdb/XDBResConfig.xsd')
               , '/ResConfig/event-listeners/listener'
                 passing rc.object_value
                 columns description varchar2(300) path 'description'
                       , schema      varchar2(30)  path 'schema'
                       , source      varchar2(30)  path 'source'
                       , events      varchar2(300) path '(#ora:xq_proc#){string-join(for $i in events/child::* return name($i), ", ")}'
                       , condition   varchar2(300) path 'pre-condition/existsNode/XPath'
               ) x
          ;
          
          DESCRIPTION                                                    SCHEMA    SOURCE                         EVENTS                                             CONDITION
          -------------------------------------------------------------- --------- ------------------------------ -------------------------------------------------- --------------------------------------------------------------------------------
          Register event handlers for users.                             SYS       DBMS_XS_PRINCIPAL_EVENTS_INT   Pre-Create, Post-Create, Pre-Update, Pre-Delete    /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/principal.xsd#user"]
          Register event handlers for role sets.                         SYS       DBMS_XS_ROLESET_EVENTS_INT     Pre-Create, Post-Create, Pre-Update, Pre-Delete    /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/roleset.xsd#roleSet"]
          Register event handlers for roles.                             SYS       DBMS_XS_PRINCIPAL_EVENTS_INT   Pre-Create, Post-Create, Pre-Update, Pre-Delete    /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/principal.xsd#dynamicRol
          Register event handlers for dynamic roles.                     SYS       DBMS_XS_PRINCIPAL_EVENTS_INT   Pre-Create, Post-Create, Pre-Update, Pre-Delete    /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/principal.xsd#role"]
          Register event handlers for function roles.                    SYS       DBMS_XS_PRINCIPAL_EVENTS_INT   Pre-Create, Post-Create, Pre-Update, Pre-Delete    /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/principal.xsd#functionRo
          Register event handlers for Data Security.                     SYS       DBMS_XS_DATA_SECURITY_EVENTS   Post-Update, Post-Delete                           /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/dataSecurity.xsd#DataSec
          Register event handlers for Security Classes.                  SYS       DBMS_XS_SECCLASS_EVENTS        Pre-Update, Pre-Delete                             /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/securityclass.xsd#securi
                                                                         SYS       DBMS_NETWORK_ACL_ADMIN         Pre-Delete                                         
                         PL/SQL Network ACL Resource Configuration                                                                                                   
           
          Handling of Office Open XML spreadsheets                       OOX       OOX_SML_STORE                  Pre-Create, Pre-Delete                             /Resource[ContentType="application/vnd.openxmlformats-officedocument.spreadsheet
           
          9 rows selected
           
          {code}
          
          And if your target folder has any config file associated, for example : 
          {code}
          SQL> select *
            2  from table(dbms_resconfig.getResConfigPaths('/office/excel/docs'));
           
          COLUMN_VALUE
          --------------------------------------------------------------------------------
          /office/excel/conf/sml_rescfg.xml
           
          {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
          • 2. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
            604709
            Hi, and thanks for Your reply.
            I´ve inserted my replies to the questions in Your text below.
            odie_63 wrote:
            Hi,

            What's the database version? (select * from v$version)
            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
            TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0. - Production
            NSLRTL Version 11.2.0.3.0 - Production

            When placing xml-files into the database through the webdav-catalogue on the Linux-box the files are copied over, but almost immediatly removed (or hidden)
            Does that mean you see them for a short period of time, and then they disappear, or you never see them at all?
            Yes, I can see them for a couple of seconds and then they disappear.
            Are you using XML DB events?
            Have tried with xml_db_events both enabled and disabled. Get the same result both ways.

            You can check if there's any resource configuration defined, and that may explain this behaviour :
            select x.* 
            from xdb.xdb$resconfig rc
            , xmltable(
            xmlnamespaces(default 'http://xmlns.oracle.com/xdb/XDBResConfig.xsd')
            , '/ResConfig/event-listeners/listener'
            passing rc.object_value
            columns description varchar2(300) path 'description'
            , schema      varchar2(30)  path 'schema'
            , source      varchar2(30)  path 'source'
            , events      varchar2(300) path '(#ora:xq_proc#){string-join(for $i in events/child::* return name($i), ", ")}'
            , condition   varchar2(300) path 'pre-condition/existsNode/XPath'
            ) x
            ;
            
            DESCRIPTION                                                    SCHEMA    SOURCE                         EVENTS                                             CONDITION
            -------------------------------------------------------------- --------- ------------------------------ -------------------------------------------------- --------------------------------------------------------------------------------
            Register event handlers for users.                             SYS       DBMS_XS_PRINCIPAL_EVENTS_INT   Pre-Create, Post-Create, Pre-Update, Pre-Delete    /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/principal.xsd#user"]
            Register event handlers for role sets.                         SYS       DBMS_XS_ROLESET_EVENTS_INT     Pre-Create, Post-Create, Pre-Update, Pre-Delete    /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/roleset.xsd#roleSet"]
            Register event handlers for roles.                             SYS       DBMS_XS_PRINCIPAL_EVENTS_INT   Pre-Create, Post-Create, Pre-Update, Pre-Delete    /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/principal.xsd#dynamicRol
            Register event handlers for dynamic roles.                     SYS       DBMS_XS_PRINCIPAL_EVENTS_INT   Pre-Create, Post-Create, Pre-Update, Pre-Delete    /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/principal.xsd#role"]
            Register event handlers for function roles.                    SYS       DBMS_XS_PRINCIPAL_EVENTS_INT   Pre-Create, Post-Create, Pre-Update, Pre-Delete    /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/principal.xsd#functionRo
            Register event handlers for Data Security.                     SYS       DBMS_XS_DATA_SECURITY_EVENTS   Post-Update, Post-Delete                           /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/dataSecurity.xsd#DataSec
            Register event handlers for Security Classes.                  SYS       DBMS_XS_SECCLASS_EVENTS        Pre-Update, Pre-Delete                             /r:Resource[r:SchemaElement="http://xmlns.oracle.com/xs/securityclass.xsd#securi
            SYS       DBMS_NETWORK_ACL_ADMIN         Pre-Delete                                         
            PL/SQL Network ACL Resource Configuration                                                                                                   
            
            Handling of Office Open XML spreadsheets                       OOX       OOX_SML_STORE                  Pre-Create, Pre-Delete                             /Resource[ContentType="application/vnd.openxmlformats-officedocument.spreadsheet
            
            9 rows selected
            
            {code}
            I get all but the last one in my result from this query.


            And if your target folder has any config file associated, for example :
            {code}
            SQL> select *
            2 from table(dbms_resconfig.getResConfigPaths('/office/excel/docs'));

            COLUMN_VALUE
            --------------------------------------------------------------------------------
            /office/excel/conf/sml_rescfg.xml

            {code}
            Thanks,
            Bob
            • 3. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
              odie_63
              I get all but the last one in my result from this query.
              Last one is one of mine ;)

              OK, so no XDB events involved.

              Do you see the files in the repository, via RESOURCE_VIEW?
              select * from resource_view where under_path(res, '/your_path_here') = 1;
              You can also try to trace the protocol to see if a delete operation occurs at some point :
              http://www.liberidu.com/blog/2010/01/17/ora-31098-internal-event-to-turn-on-xdb-tracing/
              • 4. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
                Marco Gralike
                Sounds a bit at stuff when I do it via Windows webdav.

                Try copying / getting it in the environment via FTP, because it might be an security (ACL) issue. In other words, you don't have the privilege to copy/create it in the first place. After a "refresh" in your client its gone (aka "it looked like it was copied/created, but it actually never was (accepted/and thus rolled back)). Trying it via FTP instead of WebDAV might give you the info you need, othersize use the event mentioned earlier and trace the steps taken in XDB and see why it fails (or gets undone - although I doubt that)
                • 5. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
                  Marco Gralike
                  -- love the "event" bit in xmltable --

                  ;-)
                  • 6. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
                    604709
                    Hmmm...this is strange.
                    Just to have a go at another test I transferred a renamed xml-file to the same directory. This time without the .xml suffix. And the file is not removed, i.e. it stays where I want it to be!
                    Renaming it back again (on the client) with the .xml suffix and it is removed after transfer again.
                    And transferring it without the .xml suffix and then renaming it back to .xml in the webdav target directory also leaves the file in the transferred folder. It seems like it is trying to validate the xml-file against an xsd when transferred as an xml-file, and it skips that when it does´t think it is an xml-fil.
                    And since our xsd is not registered in the xdb schema (ref. my first post in this thread), the validation obviously fail.

                    So now, the answer to your question in Your last post odi_63, is yes! I can see the files in the rewsource_view (after having done the renaming in the webdav directory).

                    Do you know if there are any triggers in the xdb schema I can turn off, that automatically tries to validate any xml-file that is placed there?

                    Cheers,
                    Bob
                    odie_63 wrote:
                    I get all but the last one in my result from this query.
                    Last one is one of mine ;)

                    OK, so no XDB events involved.

                    Do you see the files in the repository, via RESOURCE_VIEW?
                    select * from resource_view where under_path(res, '/your_path_here') = 1;
                    You can also try to trace the protocol to see if a delete operation occurs at some point :
                    http://www.liberidu.com/blog/2010/01/17/ora-31098-internal-event-to-turn-on-xdb-tracing/
                    • 7. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
                      604709
                      Thanks Marco.
                      I use WinSCP when transferring my files. And the files stays on the server long enough for me to see them in my Putty-window where I am logged in on the server.
                      See my other post (just before this one) for some more info about the behavior of transferring different file types (i.e. with different suffixes).

                      Bob
                      Marco Gralike wrote:
                      Sounds a bit at stuff when I do it via Windows webdav.

                      Try copying / getting it in the environment via FTP, because it might be an security (ACL) issue. In other words, you don't have the privilege to copy/create it in the first place. After a "refresh" in your client its gone (aka "it looked like it was copied/created, but it actually never was (accepted/and thus rolled back)). Trying it via FTP instead of WebDAV might give you the info you need, othersize use the event mentioned earlier and trace the steps taken in XDB and see why it fails (or gets undone - although I doubt that)
                      • 8. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
                        odie_63
                        It seems like it is trying to validate the xml-file against an xsd when transferred as an xml-file, and it skips that when it does´t think it is an xml-fil.
                        And since our xsd is not registered in the xdb schema (ref. my first post in this thread), the validation obviously fail.
                        XML DB will try to do that in the following situations :

                        Do your files have a xsi:schemaLocation or xsi:noNamespaceSchemaLocation attribute?

                        Do you have any schema location mappings configured in the repository?
                        select * 
                        from xmltable(
                               xmlnamespaces(default 'http://xmlns.oracle.com/xdb/xdbconfig.xsd')
                             , 'fn:doc("/xdbconfig.xml")/xdbconfig/sysconfig/schemaLocation-mappings/schemaLocation-mapping'
                               columns "namespace", "element", "schemaURL"
                        );
                        From what I've tested so far, only the second situation is supposed to give an error if the schema doesn't exist.
                        • 9. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
                          604709
                          odie_63 wrote:
                          It seems like it is trying to validate the xml-file against an xsd when transferred as an xml-file, and it skips that when it does´t think it is an xml-fil.
                          And since our xsd is not registered in the xdb schema (ref. my first post in this thread), the validation obviously fail.
                          XML DB will try to do that in the following situations :

                          Do your files have a xsi:schemaLocation or xsi:noNamespaceSchemaLocation attribute?
                          Yes, we use schemaLocation as You can see below:

                          <?xml version="1.0" encoding="UTF-8"?>
                          <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:abc:kontroll:gas:oppgave:v1"
                          xmlns:tns="urn:abc:kontroll:gas:oppgave:v1" xmlns:gass="urn:abc:kontroll:gas:basis:v1"
                          xmlns:type="urn:abc:kontroll:gas:type:v1" xmlns:xdb="http://xmlns.oracle.com/xdb"
                          elementFormDefault="qualified">
                          <import namespace="urn:abc:kontroll:gas:type:v1" schemaLocation="GasType.xsd" />
                          <import namespace="urn:abc:kontroll:gas:basis:v1" schemaLocation="GasBasis.xsd" />

                          Do you have any schema location mappings configured in the repository?
                          select * 
                          from xmltable(
                          xmlnamespaces(default 'http://xmlns.oracle.com/xdb/xdbconfig.xsd')
                          , 'fn:doc("/xdbconfig.xml")/xdbconfig/sysconfig/schemaLocation-mappings/schemaLocation-mapping'
                          columns "namespace", "element", "schemaURL"
                          );
                          This query did not return any rows from our system.
                          From what I've tested so far, only the second situation is supposed to give an error if the schema doesn't exist.
                          Do You know if there is a way to disable this validation?

                          Cheers,
                          Bob
                          • 10. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
                            odie_63
                            Yes, we use schemaLocation as You can see below:

                            <?xml version="1.0" encoding="UTF-8"?>
                            <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:abc:kontroll:gas:oppgave:v1"
                            xmlns:tns="urn:abc:kontroll:gas:oppgave:v1" xmlns:gass="urn:abc:kontroll:gas:basis:v1"
                            xmlns:type="urn:abc:kontroll:gas:type:v1" xmlns:xdb="http://xmlns.oracle.com/xdb"
                            elementFormDefault="qualified">
                            <import namespace="urn:abc:kontroll:gas:type:v1" schemaLocation="GasType.xsd" />
                            <import namespace="urn:abc:kontroll:gas:basis:v1" schemaLocation="GasBasis.xsd" />
                            Nope, I was talking about instance documents, not the schema.
                            Do your instance files have the attribute in their root elements?
                            From what I've tested so far, only the second situation is supposed to give an error if the schema doesn't exist.
                            Do You know if there is a way to disable this validation?
                            There's nothing to disable since there's no mapping configured in the repository.

                            Have you tried tracing the WebDAV protocol as suggested earlier?
                            • 11. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
                              604709
                              odie_63 wrote:
                              Yes, we use schemaLocation as You can see below:

                              <?xml version="1.0" encoding="UTF-8"?>
                              <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:abc:kontroll:gas:oppgave:v1"
                              xmlns:tns="urn:abc:kontroll:gas:oppgave:v1" xmlns:gass="urn:abc:kontroll:gas:basis:v1"
                              xmlns:type="urn:abc:kontroll:gas:type:v1" xmlns:xdb="http://xmlns.oracle.com/xdb"
                              elementFormDefault="qualified">
                              <import namespace="urn:abc:kontroll:gas:type:v1" schemaLocation="GasType.xsd" />
                              <import namespace="urn:abc:kontroll:gas:basis:v1" schemaLocation="GasBasis.xsd" />
                              Nope, I was talking about instance documents, not the schema.
                              Do your instance files have the attribute in their root elements?
                              Sorry!

                              <?xml version="1.0" encoding="UTF-8"?>
                              <tns:gasOppgave xmlns:tns="urn:abc:kontroll:gas:oppgave:v1"
                              xmlns:tns1="urn:abc:kontroll:gas:basis:v1" xmlns:tns2="urn:abc:kontroll:gas:type:v1"

                              xmlns:tns3="urn:iso3166" xmlns:tns4="urn:iso4217" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                              xsi:schemaLocation="urn:abc:kontroll:gas:oppgave:v1 GasOppgave.xsd ">

                              From what I've tested so far, only the second situation is supposed to give an error if the schema doesn't exist.
                              Do You know if there is a way to disable this validation?
                              There's nothing to disable since there's no mapping configured in the repository.

                              Have you tried tracing the WebDAV protocol as suggested earlier?
                              No, not yet. Will try that now.

                              Thanks,
                              Bob
                              • 12. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
                                Marco Gralike
                                Please trace it as suggested. Level 2 should do just fine.

                                There is something going on we just can't put our fingers yet.

                                The quick and dirty workaround would probably be to but not sure if it also will disable the internal stuff going on

                                http://docs.oracle.com/cd/B28359_01/appdev.111/b28369/xdb_repos_events.htm
                                You configure event treatment for Oracle XML DB Repository resources as you would configure any other treatment of repository resources — see "Configuring a Resource".
                                
                                Be default, repository events are enabled, but you can disable them by setting parameter XML_DB_EVENTS to DISABLE. To disable repository events at the session level, use the following SQL*Plus command. You must have role XDBADMIN to do this.
                                
                                ALTER SESSION SET XML_DB_EVENTS = DISABLE;
                                
                                To disable repository events at the system level, use the following SQL*Plus command, and then restart your database; repository events will be disabled for subsequent sessions. You must have privilege ALTER SYSTEM to do this.
                                
                                ALTER SYSTEM SET XML_DB_EVENTS = DISABLE;
                                
                                To enable repository events again, set the value of XML_DB_EVENTS to ENABLE.
                                
                                The rest of this section describes the resource configuration file that you use as a resource to configure event processing for other resources.
                                Because this is WebDAV, you also would need to consider namespace location mapping set in the xdbconfig.xml file of the XDB Repository

                                http://docs.oracle.com/cd/B28359_01/appdev.111/b28369/appaman.htm#BHBJAGHE
                                • 13. Re: webdav and xdb, xml-files are automatically deleted (or hidden)
                                  odie_63
                                  Because this is WebDAV, you also would need to consider namespace location mapping set in the xdbconfig.xml file of the XDB Repository
                                  We've already checked it a few post above ;)
                                  1 2 Previous Next