Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server


Published on

Published in: Technology
  • Be the first to comment

UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server

  1. 1. Drag, Drop and other Stuff
  2. 2.  Mark D Drake Senior Product Manager Product: Oracle XML DB Oracle HQ, USA Oracle 20+ years experience
  3. 3.  Marco Gralike Principal Database Consultant DBA; Specialized Oracle XML DB AMIS Services BV, Holland Oracle experience since 1993 Oracle ACE Director OakTable Member
  4. 4. XML DB Repository
  5. 5.  Based on XML Standards: XPath V2 , XSLT V1 , XQuery V1 , XQuery Update ( , XBRL (Extention) XML Handling Stores, Consumes, Generates, Validates XDB Repository HTTP(s), FTP & WebDAV XDB Repository Events No Cost Option, Core database feature
  6. 6.  XDB Repository File / Folder (aka Resources) Resource manipulation DBMS_XDB, DBMS_XDBRESOURCE Default XDB ACL Driven Security XDB Protocol Listener XDB Respository Events XML Schema awareness Extending XML Schema functionality
  7. 7.  XDB$RESOURCE  XDBResource.xsd  XMLType Table (Schema based XML Table) Access to XDB Repository  WebDAV, FTP, HTTP(s)  SQL, PL/SQL, NDWS  PATH_VIEW, RESOURCE_VIEW Select, Update, Delete  UNDER_PATH, EQUALS_PATH
  8. 8.  XML Schema: xdb$resource.xsd XMLType Table PATH_VIEW, RESOURCE_VIEW Non Schema based metadata in LOB Info about: RESID, DisplayName, Owner, Creator, VersionID, ChecktOut, CreationDate, ModifiedDate, SizeOn Disk, ContentSize, ContentType, Comments, Char acterSet, Etc…
  9. 9. Servlet ?MIME Type?Security ?XMLSchema ?XDB Event ?Extention?
  10. 10. Use Case
  11. 11. Database FileServer 2 The MAX Copy a FILE to the Database
  12. 12. EventMIME Event ListenerCheck Handler XML Protocol Server (Listener)
  13. 13. Extract MoveFile Info Store in XDB Repository
  14. 14. Extract File XDB File to Content Server Batch File to XDB “Batch” Directory
  15. 15. Use Case
  16. 16. Database FileServer 2 The MAX Copy a PICTURE to the Database
  17. 17. EventMIME Event ListenerCheck Handler XML Protocol Server (Listener)
  18. 18. Extract Store in XML Table Store in XDB Repository
  19. 19. EXIF KML Display in GUI, Google Map
  20. 20. Methods at Work
  21. 21. Servlet ?MIME Type?Security ?XMLSchema ?XDB Event ?Extention?
  22. 22.  XML Schema - xdbconfig.xsd Notepad, XMLSpy, PL/SQL Secured via WebDAV ACL (xdbadmin) Packages (among others):  DBMS_XDB ▪ Caching, Session, Locking, Security behavior ▪ Enable HTTP/FTP, MIME, Encoding, Virtual Paths ▪ SERVLETS: NDWS, APEX, XDBUrifactory  DBMS_EPG ▪ Creation off Database Access Descriptors
  23. 23. <xdbconfig> <sysconfig> <acl-max-age>15</acl-max-age> <acl-cache-size>32</acl-cache-size> <invalid-pathname-chars/> <case-sensitive>true</case-sensitive> <call-timeout>6000</call-timeout> <max-link-queue>65536</max-link-queue> <max-session-use>100</max-session-use> <persistent-sessions>false</persistent-sessions> <default-lock-timeout>3600</default-lock-timeout> <xdbcore-log-level>0</xdbcore-log-level> <resource-view-cache-size>1048576</resource…size> <xdbcore-xobmem-bound>1024</xdbcore-xobmem-bound> <xdbcore-loadableunit-size>16</xdbcore-……………size> <acl-evaluation-method>ace-order</acl-ev……method> </sysconfig></xdbconfig>
  24. 24. <servlet xmlns=""> <servlet-name>APEX</servlet-name> <servlet-language>PL/SQL</servlet-language> <display-name>APEX</display-name> <plsql xmlns=""> <database-username>ANONYMOUS</database-username> <default-page>apex</default-page> <document-table-name>wwv_flow_file_objects$</doc…name> <document-path>docs</document-path> <document-procedure> wwv_flow_file_mgr.process_download </document-procedure> <nls-language>american_america.al32utf8</nls-language> <request-validation-function> wwv_flow_epg_include_modules.authorize </request-validation-function> </plsql> <security-role-ref> <role-name>anonymousServletRole</role-name> <role-link>anonymousServletRole</role-link> </security-role-ref></servlet>
  25. 25. XML Schema XML SchemaXML Document in XML ? Registered ?Physical XMLType Shred XML into Update Associated ? XMLType XDB$Resource
  26. 26. Methods at Work
  27. 27.  Event Listener  Java Class, PL/SQL Package, Object Type ▪ A Package called: “HANDLE_XDB_EVENTS” Event Handlers  Event handlers processes a single event ▪ Package procedures called “handlePreCreate”, “handlePostCreate, “handlePreVersi onControl”… Resource Configuration File  The glue between Event Listener and Resources
  28. 28.  Render  UnLinkIn  UnCheckOut Create  UnLinkFrom  VersionControl Delete  Lock  UnLock Update  CheckIn  LinkTo LinkIn  CheckOut
  29. 29.  Create handlePreCreate handlePostCreate Delete handlePreDelete handlePostDeleteRender handleRenderLock handlePreLock… handlePostLockURL: XDBEvent XDBEventListener
  30. 30. Methods at Work
  31. 31.  Glue between Event Listener and Resource An XML File  XML Schema - XDBResConfig.xsd Contains (among others):  Events and Source (Event Listener)  Path to “itself” (/public/myResFile.xml)  Pre-conditions (XPATH on XDB$RESOURCE) Is assigned to a Resource (File/Folder)  DBMS_RESCONFIG.AppendResConfig
  32. 32.  Move all files created by BATCH to… Extract Info from picture if extension GIF…<pre-condition> <existsNode> <XPath>/Resource[Creator="BATCH"]</XPath> </existsNode></pre-condition><pre-condition> <existsNode> <XPath>/Resource[ContentType="image/jpg"]</XPath> </existsNode></pre-condition>
  33. 33. Holistic Approach
  34. 34. Servlet ?MIME Type?Security ?XMLSchema ?XDB Event ?Extension?
  35. 35. Everyone is known with EXIF…
  36. 36. Jeffreys EXIF Viewer
  37. 37. Camera Make and ModelAperture, Shutter Speed, Focal LengthISO Speed, Date Taken, DescriptionGeo-coding, Copyright Information EXIF XML Schema is pre-registered with XML DB by Oracle MultiMedia Type ordsys.ordimage extracts EXIF metadata document from a JPG image
  38. 38.  The following embedded image metadata formats are supported by Oracle Multimedia:  EXIF (JPEG/TIFF - JEIDA)  IPTC-IIM (JPEG/TIFF – Adobe)  XMP (GIF/JPEG/TIFF – Adobe/RDF) Wikipedia - EXIF
  39. 39. Oracle® Multimedia Users Guide 11g R2Oracle Multimedia Metadata XML Schemas
  41. 41.  Metadata defined using an XML Schema Metadata stored in a separate table Table includes hidden column RESID  Enables join with RESOURCE_VIEW, PATH_VIEW Applications query and update metadata directly  Improved Indexing Metadata deleted when resource is deleted
  42. 42. Document MIME type JPG Event Listener? EXIF EXIF ExtendedEvent Handler? XML Schema? w/ USER XSD ? Extract JPG Extract JPG Extract JPG File info EXIF info USER metadataXDB$Resource XMLType Table XMLType Table
  43. 43. Oracle XML DB Repository
  44. 44. • XML DB - Beyond the Database, Fileserver Realm• Imagination is your limit, e.g.: - Extending “file” server with Text Search - Extending “file” server with ETL functionality• Extra options: database / fileserver interfacing• Based on standards• No cost option / all database versions
  45. 45.  URL: OTN XMLDB Sample Code  XFILES Version 5  Introduction to Oracle XML DB Repository Events  Oracle XML DB-based Mashup with Google Earth  Oracle XML DB Repository Features  XDB Utilities and more…