Just here as a small side note, some steps to do a XMLDB clean installation without other more unnecessary functionality. Depending on using the Protocol Server or not, also take into account database parameter settings like SHARED_SERVERS (eg. value=5), JAVA_POOL (XQuery and other support), PGA_AGGREGATED_TARGET (DOM validation), SGA_TARGET or MEMORY_TARGET, LARGE_POOL (shared server). My advise would be to not use automatic memory wizards while using XML DB. Although I don’t have a good example anymore at hand, I have seen no or to late response of the database while working with statements that needed a lot of DOM validation in memory. If possible use unicode characterset for your database, AL32UTF8, to avoid future issues within your environment regarding NLS conversion issues.
Category: Howto
I wondered, for a long time, if it were possible to shred automatically XML documents, via Binary XML XMLType storage, the same way as you are able with Object Relational XMLType storage since the Oracle 9.2.0.3.0 version (the first officially supported XMLDB database version).
Based on “standard” object relational storage you need the following requirements and/or take the following steps:
- Annotate an XML Schema with the XDB namespace and xdb:annotations to your liking
- Register this XML Schema in the XDB Repository
- During registration automatically generate the needed types and tables (based on your xdb:annotations)
- An XML document(s) that validates properly, is valid, against your registered XML Schema.
If done properly, drag & dropping your XML documents via for example WebDAV via the enable protocol server, will cause the XDB functionality to check and validate the given XML documents against the registered XML Schema and insert the content automatically in the generated table(s). This mechanism also works via the FTP protocol functionality off the XDB Protocol Server.
I never got it really to work, at least the mechanism was fuzzy to me. Sometimes it did work as expected, sometimes it didn’t. What I didn’t realize, is that I most of the time use XML documents with multiple namespace references. Until one of my students during an XMLDB training, hit a small bug (8473369), regarding using duplicate namespaces in the “wrong” order. XQuery statement don’t have the problem, XML/SQL does, so I reported it via an Service Request. This made me wonder… Would I have the same issue with the namespace references in the registered XML Schema and the XML document. I still have to check the W3C Official XML Namespace Recommendation regarding this issue though…
If you have seen Anjo’s Kolk’s cool “Oracle Interface for Google Visualization API (external data source interface)” blog post, which partly based on the Oracle XMLDB Protocol Adapter functionality, then be aware that direct access off this functionality via the internet is at your own risk. Of course this also counts for the OTN article given here: Creating Oracle Database-backed iGoogle Gadgets.
To make life a little bit easier, Google also created the Google Secure Data Connector (Google SDC) to make your connection with the database more secure. If applicable you should add this extra security feature, at least if you have the means to do this. You need, among others, a Google App Premier account and are the owner for the domain were the database resides.
If you enable HTTP access via, for example, the XDB Protocol Server via the following DBMS_XDB call:
SQL> call dbms_xdb.setHttpPort(8080);
this enables, besides the HTTP functionality, also the WebDAV protocol server functionality. To get this functionality secured on the internet, you could use Apache as a reverse proxy solution that rewrites on the fly all URL’s that should be protected. As the XMLDB Dev. team go’s, this is the only acceptable secure solution to provide, on the internet, this protocol server functionality based on Oracle XMLDB.
The following is a snippet from a Apache httpd.conf configuration file that could be used for this (ssl is enabled in this example, based on using OpenSSL):