<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6932005449976239416</id><updated>2012-01-25T20:13:54.312-08:00</updated><category term='Lucene Oracle Integration Java Data Cartridge API'/><category term='VPD'/><category term='apex'/><category term='xsl'/><category term='Lucene'/><category term='OJVM'/><category term='Oracle EL VM Linux Mandriva Xen virtualization'/><category term='parallel shared server process'/><category term='Authorization'/><category term='open source'/><category term='Security'/><category term='Oracle'/><category term='cocoon'/><category term='JAAS'/><category term='WS'/><category term='ncomp'/><category term='dbprism'/><category term='DAD'/><category term='binary distribution'/><category term='cms'/><category term='2.9.2'/><category term='aggregate function'/><category term='auto-complete'/><category term='Did You Mean'/><category term='nosql'/><category term='XMLDB WikiPedia Dumps SAXLoader Lucene Domain Index'/><category term='Spring'/><category term='openworld08'/><category term='XMLDB'/><category term='jdk1.5'/><category term='Oracle Java Ant SQLPlus jpub loadjava ncomp'/><category term='jdk1.4'/><category term='Lucene Domain Index'/><category term='near real time search'/><category term='Facets'/><category term='stored procedure'/><category term='talk'/><category term='REST'/><category term='PLSQL sleep procedure Oracle JVM DBMS_LOCK'/><category term='Web Services'/><category term='parallel indexing'/><category term='XMPP'/><category term='Oracle 11g'/><category term='Oracle JVM Unit Testing JUnit Test Driven Development'/><category term='Oracle Web Services Manager'/><category term='SSO'/><category term='Java'/><category term='Oracle Data Cartridge API'/><category term='Java Logging Oracle JVM'/><category term='retro-translator'/><category term='Lucene Oracle Integration Java Data Cartridge API JIT SECURE LOB'/><category term='RMI'/><category term='middle tier authentication'/><category term='JDBC'/><category term='SOAP'/><category term='ODCI API'/><category term='Oracle Domain Index'/><category term='mod_plsql'/><category term='Oracle JVM'/><category term='WikiPedia'/><category term='Restlet'/><category term='Maven'/><category term='wcms'/><category term='Oracle Open World 09'/><category term='Data Source Connection Pooling and Caching'/><category term='Authentication'/><category term='highlighting'/><category term='Oracle Object Types'/><category term='proxy user'/><category term='oow11'/><category term='J2EE'/><category term='Oracle Web Logic'/><category term='oow09'/><title type='text'>Marcelo Ochoa's personal blog</title><subtitle type='html'>This place is a notepad for sharing experience, code and other related stuff to Oracle, Java and XML technologies.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>40</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-4504866310849263156</id><published>2011-11-28T12:33:00.001-08:00</published><updated>2011-11-28T13:37:09.261-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OJVM'/><category scheme='http://www.blogger.com/atom/ns#' term='RMI'/><category scheme='http://www.blogger.com/atom/ns#' term='parallel shared server process'/><title type='text'>Implementing Oracle parallel shared server process in Java inside the Database</title><content type='html'>&lt;div style="text-align: justify;"&gt;Behind the implementation of latest &lt;a href="http://sourceforge.net/projects/ldi/" target="_blank"&gt;LDI&lt;/a&gt; open source project and the &lt;a href="http://www.scotas.com/product-scotas-ols" target="_blank"&gt;OLS&lt;/a&gt; products there is a&amp;nbsp;functionality not well know by Oracle Java database developers, I called it Parallel Shared Server process.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The idea is to have an Oracle shared server process running during the&amp;nbsp;&amp;nbsp;&lt;span class="Apple-style-span" style="text-align: -webkit-auto;"&gt;life-time of the&amp;nbsp;&lt;/span&gt;instance, which means a process automatically started during database &lt;i&gt;startup&lt;/i&gt; and stopped during database &lt;i&gt;shutdown&lt;/i&gt;.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;So which functionality this process can implement?, on LDI is an RMI server, on OLS is lightweight HTTP server, but basically you can implement anything you need for example getting information from another process and fill some table, getting&amp;nbsp;statistical, consuming web services, etc. etc.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Let see in some example how it works.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;We will create a TEST user and creates some Java classes running a simple Hello World RMI server.&lt;/div&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;SQL&amp;gt;&amp;nbsp;conn / as sysdba&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;SQL&amp;gt; create user test identified by test&lt;br /&gt;&amp;nbsp; 2 &amp;nbsp;default tablespace users&lt;br /&gt;&amp;nbsp; 3 &amp;nbsp;temporary tablespace temp&lt;br /&gt;&amp;nbsp; 4 &amp;nbsp;quota unlimited on users;&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;SQL&amp;gt; grant connect,resource,create any job to TEST;&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;SQL&amp;gt;&amp;nbsp;exec dbms_java.grant_permission( '&lt;/b&gt;&lt;/span&gt;&lt;b style="font-size: small;"&gt;TEST&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;', 'SYS:java.net.SocketPermission', 'localhost:1024-', 'listen,resolve');&lt;br /&gt;SQL&amp;gt; exec dbms_java.grant_permission( '&lt;/b&gt;&lt;/span&gt;&lt;b style="font-size: small;"&gt;TEST&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;', 'SYS:java.net.SocketPermission', 'localhost:1024-', 'accept, resolve');&lt;br /&gt;SQL&amp;gt; exec dbms_java.grant_permission( '&lt;/b&gt;&lt;/span&gt;&lt;b style="font-size: small;"&gt;TEST&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;', 'SYS:java.net.SocketPermission', 'localhost:1024-', 'connect, resolve');&lt;br /&gt;SQL&amp;gt; exec dbms_java.grant_permission( '&lt;/b&gt;&lt;/span&gt;&lt;b style="font-size: small;"&gt;TEST&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;', 'SYS:java.lang.RuntimePermission', 'setContextClassLoader', '' );&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;The RMI interface and server implementation running on TEST user.&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;SQL&amp;gt; conn test/test&lt;br /&gt;SQL&amp;gt; create or replace and compile java source named "mytest.Hello" as&lt;br /&gt;package mytest;&lt;br /&gt;import java.rmi.Remote;&lt;br /&gt;import java.rmi.RemoteException;&lt;br /&gt;public interface Hello extends Remote {&lt;br /&gt;&amp;nbsp; &amp;nbsp; String sayHello() throws RemoteException;&lt;br /&gt;&amp;nbsp; &amp;nbsp; int nextCount() throws RemoteException;&lt;br /&gt;}&lt;br /&gt;/&lt;br /&gt;SQL&amp;gt; create or replace and compile java source named "mytest.HelloImpl" as&lt;br /&gt;package mytest;&lt;br /&gt;import java.rmi.Naming;&lt;br /&gt;import java.rmi.RemoteException;&lt;br /&gt;import java.rmi.RMISecurityManager;&lt;br /&gt;import java.rmi.registry.LocateRegistry;&lt;br /&gt;import java.rmi.server.UnicastRemoteObject;&lt;br /&gt;public class HelloImpl extends UnicastRemoteObject implements Hello {&lt;br /&gt;&amp;nbsp; &amp;nbsp; static int counter = 0;&lt;br /&gt;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; public HelloImpl() throws RemoteException {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super();&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; public String sayHello() {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return "Hello World!";&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; public static void main(String[] args) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Create and install a security manager&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (System.getSecurityManager() == null) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.setSecurityManager(new RMISecurityManager());&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HelloImpl obj = new HelloImpl();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LocateRegistry.createRegistry(1099);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Bind this object instance to the name "HelloServer"&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Naming.rebind("//localhost/HelloServer", obj);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("HelloServer bound in registry");&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (Exception e) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("HelloImpl err: " + e.getMessage());&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; public synchronized int nextCount() {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return counter++;&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;/&lt;br /&gt;SQL&amp;gt; create or replace procedure HelloServ(srvName IN VARCHAR2) as LANGUAGE JAVA NAME&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'mytest.HelloImpl.main(java.lang.String [])';&lt;br /&gt;/&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;SQL&amp;gt; begin&lt;br /&gt;&amp;nbsp; -- Start a Cron like process (DBMS_SCHEDULER)&lt;br /&gt;&amp;nbsp; DBMS_SCHEDULER.CREATE_JOB(&lt;br /&gt;&amp;nbsp; &amp;nbsp;job_name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; &amp;nbsp;'HelloServJob',&lt;br /&gt;&amp;nbsp; &amp;nbsp;job_type &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; &amp;nbsp;'PLSQL_BLOCK',&lt;br /&gt;&amp;nbsp; &amp;nbsp;job_action &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; &amp;nbsp;'begin&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;HelloServ(''HelloServer'');&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;exception when others then&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; null;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;end;',&lt;br /&gt;&amp;nbsp; &amp;nbsp;start_date &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; &amp;nbsp;SYSDATE,&lt;br /&gt;&amp;nbsp; &amp;nbsp;enabled &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; false,&lt;br /&gt;&amp;nbsp; &amp;nbsp;auto_drop &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; false);&lt;br /&gt;&amp;nbsp; DBMS_SCHEDULER.SET_ATTRIBUTE_NULL (&lt;br /&gt;&amp;nbsp; &amp;nbsp;name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; &amp;nbsp; 'HelloServJob',&lt;br /&gt;&amp;nbsp; &amp;nbsp;attribute &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; &amp;nbsp; 'MAX_FAILURES');&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;commit;&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;div&gt;Now we can register two database instance trigger to automatically start and stop the job.&lt;/div&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;SQL&amp;gt; conn / as sysdba&lt;br /&gt;SQL&amp;gt; CREATE OR REPLACE TRIGGER start_test_srv&lt;br /&gt;&amp;nbsp; AFTER STARTUP ON DATABASE&lt;br /&gt;BEGIN&lt;br /&gt;&amp;nbsp; -- Start a Cron like process (DBMS_SCHEDULER)&lt;br /&gt;&amp;nbsp; DBMS_SCHEDULER.ENABLE('TEST.HelloServJob');&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;SQL&amp;gt; CREATE OR REPLACE TRIGGER stop_test_srv&lt;br /&gt;&amp;nbsp; BEFORE SHUTDOWN ON DATABASE&lt;br /&gt;BEGIN&lt;br /&gt;&amp;nbsp; -- Start a Cron like process (DBMS_SCHEDULER)&lt;br /&gt;&amp;nbsp; DBMS_SCHEDULER.STOP_JOB('TEST.HelloServJob',force=&amp;gt;true);&lt;br /&gt;EXCEPTION WHEN OTHERS THEN&lt;br /&gt;&amp;nbsp; null;&lt;br /&gt;END;&lt;br /&gt;/&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;div&gt;If we process to do a &lt;i&gt;shutdown/startup&lt;/i&gt; sequence the server will up and running, also we can start the server manually by executing:&lt;/div&gt;&lt;div&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;SQL&amp;gt; conn / as sysdba&lt;br /&gt;SQL&amp;gt; exec DBMS_SCHEDULER.ENABLE('TEST.HelloServJob');&lt;br /&gt;SQL&amp;gt; commit;&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;after doing that we can see at $ORACLE_BASE/diag/rdbms/orcl/orcl/trace a .trc file&amp;nbsp;associated&amp;nbsp;with the parallel shared server process which is up and running:&lt;/div&gt;&lt;div&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;-bash-4.2$ cat orcl_j000_10411.trc&lt;br /&gt;Trace file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_j000_10411.trc&lt;br /&gt;Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;ORACLE_HOME = /u01/app/oracle/product/11_2_0_2_0/dbhome_1&lt;br /&gt;System name: &amp;nbsp; &amp;nbsp;Linux&lt;br /&gt;Node name: &amp;nbsp; &amp;nbsp; &amp;nbsp;localhost.localdomain&lt;br /&gt;Release: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.6.38.7-server-1mnb2&lt;br /&gt;Version: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#1 SMP Sun May 22 22:59:25 UTC 2011&lt;br /&gt;Machine: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i686&lt;br /&gt;Instance name: orcl&lt;br /&gt;Redo thread mounted by this instance: 1&lt;br /&gt;Oracle process number: 25&lt;br /&gt;Unix process pid: 10411, image: oracle@localhost.localdomain (J000)&lt;br /&gt;&lt;br /&gt;*** 2011-11-28 18:05:41.091&lt;br /&gt;*** SESSION ID:(151.35) 2011-11-28 18:05:41.091&lt;br /&gt;*** CLIENT ID:() 2011-11-28 18:05:41.091&lt;br /&gt;*** SERVICE NAME:(SYS$USERS) 2011-11-28 18:05:41.091&lt;br /&gt;*** MODULE NAME:(DBMS_SCHEDULER) 2011-11-28 18:05:41.091&lt;br /&gt;*** ACTION NAME:(HELLOSERVJOB) 2011-11-28 18:05:41.091&lt;br /&gt;&lt;br /&gt;HelloServer bound in registry&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;and this process is listening into the default &lt;i&gt;RMI&lt;/i&gt; port 1099, we can see that using:&lt;/div&gt;&lt;div&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;-bash-4.2$ netstat -anp|grep ora_j0&lt;br /&gt;(Not all processes could be identified, non-owned process info&lt;br /&gt;&amp;nbsp;will not be shown, you would have to be root to see it all.)&lt;br /&gt;tcp &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp;0 :::19189 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:::* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LISTEN &amp;nbsp; &amp;nbsp; &amp;nbsp;10411/ora_j000_orcl&lt;br /&gt;tcp &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp;0 :::1099 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; :::* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LISTEN &amp;nbsp; &amp;nbsp; &amp;nbsp;10411/ora_j000_orcl&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;and that's all, we can connect using an &lt;i&gt;RMI&lt;/i&gt; client from another client session, for example:&lt;/div&gt;&lt;div&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;SQL&amp;gt; create or replace and compile java source named "mytest.HelloClient" as&lt;br /&gt;package mytest;&lt;br /&gt;import java.rmi.Naming;&lt;br /&gt;import java.rmi.RemoteException;&lt;br /&gt;public class HelloClient {&lt;br /&gt;&amp;nbsp; &amp;nbsp; Hello obj = null;&lt;br /&gt;&amp;nbsp; &amp;nbsp; public HelloClient() {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj = (Hello)Naming.lookup("//localhost/HelloServer");&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (Exception e) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("HelloApplet exception: " + e.getMessage());&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; public String sayHello() throws RemoteException {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return obj.sayHello();&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; public int nextCount() throws RemoteException {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return obj.nextCount();&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; public static void main(String[] args) throws RemoteException {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HelloClient helloClient = new HelloClient();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(helloClient.sayHello());&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(helloClient.nextCount());&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;/&lt;br /&gt;SQL&amp;gt; create or replace procedure HelloClient(srvName IN VARCHAR2) as LANGUAGE JAVA NAME&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;'mytest.HelloClient.main(java.lang.String [])';&lt;br /&gt;/&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;blockquote class="tr_bq" style="font-weight: bold;"&gt;SQL&amp;gt; set define ?&lt;br /&gt;SQL&amp;gt; set serverout on&lt;br /&gt;SQL&amp;gt; exec dbms_java.set_output(32000);&lt;br /&gt;SQL&amp;gt; exec HelloClient('HelloServer');&lt;br /&gt;0&lt;br /&gt;SQL&amp;gt; exec HelloClient('HelloServer');&lt;br /&gt;1&lt;/blockquote&gt;&lt;/span&gt;&lt;/div&gt;Note that the server is&amp;nbsp;state-full&amp;nbsp;which means that preserve the state across calls, if we exit from above &lt;i&gt;SQLPlus&lt;/i&gt; and connect again we will see that:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;blockquote class="tr_bq" style="font-weight: bold;"&gt;SQL&amp;gt; set define ?&lt;br /&gt;SQL&amp;gt; set serverout on&lt;br /&gt;SQL&amp;gt; exec dbms_java.set_output(32000);&lt;br /&gt;SQL&amp;gt; exec HelloClient('HelloServer');&lt;br /&gt;2&lt;br /&gt;SQL&amp;gt; exec HelloClient('HelloServer');&lt;br /&gt;3&lt;/blockquote&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Concluding this post I would like to remark that this parallel shared server process is running into &lt;i&gt;RDBMS&lt;/i&gt; space and is not like starting an &lt;i&gt;RMI&lt;/i&gt; server into the middle tier. the big difference is that all &lt;i&gt;SQL&lt;/i&gt; access is implemented accessing directly to the &lt;i&gt;RDBMS&lt;/i&gt; structures into the &lt;i&gt;SGA&lt;/i&gt; because is using the internal &lt;i&gt;JDBC&lt;/i&gt; driver.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-4504866310849263156?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/4504866310849263156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/4504866310849263156'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2011/11/implementing-oracle-parallel-shared.html' title='Implementing Oracle parallel shared server process in Java inside the Database'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-7137511722414495487</id><published>2011-11-25T11:44:00.001-08:00</published><updated>2011-11-25T12:04:12.183-08:00</updated><title type='text'>New release of Lucene Domain Index based on 3.4.0 code</title><content type='html'>This new release of &lt;i&gt;Lucene Domain Index (&lt;a href="http://ludoix.wordpress.com/" target="_blank"&gt;LDI&lt;/a&gt;)&lt;/i&gt; has been in the new &lt;a href="https://sourceforge.net/scm/?type=svn&amp;amp;group_id=405422" target="_blank"&gt;SVN&lt;/a&gt; for a long time, but due a lot of works with the&amp;nbsp;commercial&amp;nbsp;version &lt;a href="http://www.scotas.com/" target="_blank"&gt;Scotas&lt;/a&gt;&amp;nbsp;never went public in binary installation :(&lt;br /&gt;Several thing happen during this time:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;New web site (thanks a lot to Peter Wehner for the&amp;nbsp;conversion&amp;nbsp;from the Google docs)&lt;/li&gt;&lt;li&gt;New hosting at SF.net (now is separate &lt;a href="http://sourceforge.net/scm/?type=svn&amp;amp;group_id=405422" target="_blank"&gt;SVN&lt;/a&gt; from the previous one CVS at &lt;a href="http://sourceforge.net/projects/dbprism/" target="_blank"&gt;DBPrism&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The change log of this version is:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Use latest merge policy implementation &lt;i&gt;TieredMergePolicy&lt;/i&gt;&lt;/li&gt;&lt;li&gt;Use total RAM reported by &lt;i&gt;getJavaPoolSize&lt;/i&gt;() when setting MaxBufferedDocs&lt;/li&gt;&lt;li&gt;Better error&amp;nbsp;reporting&amp;nbsp;when an Analyzer is not found.&lt;/li&gt;&lt;li&gt;Replaced execute immediate with open-fech-close functionality to avoid core&amp;nbsp;dump on 10g when&amp;nbsp;double&amp;nbsp;check for deleted rowid&lt;/li&gt;&lt;li&gt;Included a&amp;nbsp;back-port&amp;nbsp;version of JUnit4 to jdk1.4 version for 10g&amp;nbsp;releases&lt;/li&gt;&lt;li&gt;Added a parallel updater process, when working in &lt;b&gt;&lt;i&gt;OnLine&lt;/i&gt;&lt;/b&gt; mode this process do&amp;nbsp;write operations on &lt;b&gt;&lt;i&gt;LDI&lt;/i&gt;&lt;/b&gt; structure on behalf of the AQ process&lt;/li&gt;&lt;li&gt;Delete do not longer required a write exclusive lock on index storage, now deletes&amp;nbsp;are also&amp;nbsp;en-queued&amp;nbsp;as inserts or updates&lt;/li&gt;&lt;li&gt;Updated source to &lt;i&gt;Lucene&lt;/i&gt; 3.4.0 code, removed some deprecated API&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Download latest binary distribution at &lt;a href="http://sourceforge.net/projects/ldi/files/3.4.0/" target="_blank"&gt;3.4.0&lt;/a&gt; directory of SF.net download area (tested with 10g/11gR2).&lt;br /&gt;The addition of a new parallel shared server process is the major change which speed up a lot &lt;i&gt;DML&lt;/i&gt; operations, I'll write in a new post on how this parallel shared server technique works.&lt;br /&gt;Please report any issue during the installation or bugs at the &lt;a href="http://sourceforge.net/projects/ldi/support" target="_blank"&gt;Support Area&lt;/a&gt; of the project.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-7137511722414495487?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/7137511722414495487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/7137511722414495487'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2011/11/new-release-of-lucene-domain-index.html' title='New release of Lucene Domain Index based on 3.4.0 code'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-5834248250146758868</id><published>2011-09-26T06:41:00.000-07:00</published><updated>2011-09-26T06:41:22.179-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OJVM'/><category scheme='http://www.blogger.com/atom/ns#' term='near real time search'/><category scheme='http://www.blogger.com/atom/ns#' term='nosql'/><category scheme='http://www.blogger.com/atom/ns#' term='oow11'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Long time no post</title><content type='html'>&lt;br /&gt;I found that my last post was on Sep. 14 2010, that's too bad.&lt;br /&gt;The reason of that is the &lt;b&gt;&lt;i&gt;startup&lt;/i&gt;&lt;/b&gt; called &lt;a href="http://www.scotas.com/"&gt;Scotas&lt;/a&gt;&amp;nbsp;I worked on that almost since December of 2010 to&amp;nbsp;engineering&amp;nbsp;a next level of &lt;a href="http://marceloochoa.blogspot.com/2007/09/running-lucene-inside-your-oracle-jvm.html"&gt;Oracle and Lucene&lt;/a&gt; project integration, this is by adding the &lt;a href="http://lucene.apache.org/solr/"&gt;Solr&lt;/a&gt; stack.&lt;br /&gt;Its a natural evolution, &lt;b&gt;&lt;i&gt;Solr&lt;/i&gt;&lt;/b&gt; provides a lot of common functionality working on top of &amp;nbsp;&lt;b&gt;&lt;i&gt;Lucene&lt;/i&gt;&lt;/b&gt; required for the enterprise level solution.&lt;br /&gt;But the integration required a set of implementation&amp;nbsp;challenges&amp;nbsp;to work, once of them is the implementation of long live shared server process running in Java and which implements a new dedicated &lt;b&gt;&lt;i&gt;HTTP&lt;/i&gt;&lt;/b&gt; listener working as an &lt;b&gt;&lt;i&gt;Oracle&lt;/i&gt;&lt;/b&gt; slave process, I will explain this topic on another technical post.&lt;br /&gt;Another additions included in a set of products are the &lt;b&gt;&lt;i&gt;push technology&lt;/i&gt;&lt;/b&gt; spread on the integration with &lt;a href="http://www.scotas.com/product-scotas-solr-push-connector"&gt;Solr running externally&lt;/a&gt;, &lt;a href="http://www.scotas.com/product-scotas-elastic-search"&gt;ElasticSearch&lt;/a&gt;, &lt;a href="http://www.scotas.com/product-scotas-cassandra"&gt;Cassandra&lt;/a&gt;&amp;nbsp;and &lt;a href="http://www.scotas.com/product-scotas-hbase"&gt;HBase&lt;/a&gt;.&lt;br /&gt;Behind this technology we extended the idea of Oracle/Solr integration, the &lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28425/toc.htm"&gt;Oracle ODCI API&lt;/a&gt;,. which enabled a &lt;b&gt;&lt;i&gt;NRT&lt;/i&gt;&lt;/b&gt; (&lt;b&gt;&lt;i&gt;Near Real Time&lt;/i&gt;&lt;/b&gt;) synchronization of the enterprise data with &lt;b&gt;&lt;i&gt;NoSQL&lt;/i&gt;&lt;/b&gt; layer for example.&lt;br /&gt;&lt;b&gt;&lt;i&gt;Near Real Time&lt;/i&gt;&lt;/b&gt; means that once you commit the changes on the RDBMS layer thy are propagated automatically to the other side practically with 0 delay, and for the two way replicator such as &lt;b&gt;&lt;i&gt;Solr PC&lt;/i&gt;&lt;/b&gt; and &lt;b&gt;&lt;i&gt;ElasticSearch&lt;/i&gt;&lt;/b&gt; deletions are in real-time avoiding the false positive hits of deleted rows.&lt;br /&gt;&lt;b&gt;&lt;i&gt;Near Real Time&lt;/i&gt;&lt;/b&gt;&amp;nbsp;synchronization is &lt;b&gt;declarative&lt;/b&gt;, &lt;b&gt;no&lt;/b&gt;&amp;nbsp;&lt;b&gt;programming&lt;/b&gt; effort is required and allows multiples columns of one table, or multiples columns of many tables connected by a foreign key.&lt;br /&gt;Well next week is the &lt;a href="http://www.oracle.com/openworld/index.html"&gt;OOW 2011&lt;/a&gt;, I'll Be there and I Hope You Will, Too and for anybody that are&amp;nbsp;coming&amp;nbsp;to the event and are interested on that technology we could meet there, just drop me an email to &lt;i&gt;mochoa-at-&lt;at&gt;scotas.com&lt;/at&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt; &lt;a href="http://www.oracle.com/go/?&amp;amp;Src=7013425&amp;amp;Act=215&amp;amp;pcode=WWMK10042957MPP055"&gt;&lt;img border="0" src="http://www.oracleimg.com/ocom/groups/public/@ocom/documents/digitalasset/352041.gif" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-5834248250146758868?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/5834248250146758868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/5834248250146758868'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2011/09/long-time-no-post.html' title='Long time no post'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-5718249898701692171</id><published>2010-09-14T14:39:00.000-07:00</published><updated>2010-09-14T14:39:49.951-07:00</updated><title type='text'>New Oracle Lucene Domain Index release based on Lucene 3.0.2</title><content type='html'>Just a few words to announce a &lt;a href="http://sourceforge.net/projects/dbprism/files/odi/3.0.2.1.0/"&gt;new release&lt;/a&gt; of &lt;a href="http://docs.google.com/View?docid=ddgw7sjp_569gf8c7cd8"&gt;Oracle Lucene Domain Index&lt;/a&gt;, this zip is valid for 10g and 11g database version (10g using&amp;nbsp;back-ported&amp;nbsp;classes from 1.5 to 1.4)&lt;br /&gt;This release is compiled using &lt;a href="http://lucene.apache.org/java/3_0_2/"&gt;Lucene 3.0.2&lt;/a&gt; version and incorporates a set of new features added, here the list:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Added a long awaited functionality, a parallel/shared/slave search process&amp;nbsp;used during a start-fetch-close and CountHits function&lt;/li&gt;&lt;li&gt;Added lfreqterms ancillary operator returning the freq terms array of rows&amp;nbsp;visited&lt;/li&gt;&lt;li&gt;Added lsimilarity ancillary operator returning a computed Levenshtein distance&amp;nbsp;of the row visited&lt;/li&gt;&lt;li&gt;Added a ldidyoumean pipeline table function using &lt;i&gt;DidYouMean.indexDictionary&lt;/i&gt;&amp;nbsp;storage&lt;/li&gt;&lt;li&gt;Added test using &lt;a href="http://sqlunit.sourceforge.net/"&gt;SQLUnit&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The bigger addition is the &lt;b&gt;&lt;i&gt;Parallel-Shared-Slave&lt;/i&gt;&lt;/b&gt; search process, this architectural change was in my to-do list for a long time and finally I added in this release :)&lt;br /&gt;The idea behind this is to have a new Oracle process started by the &lt;i&gt;DBMS_SCHEDULER&lt;/i&gt; sub-system during the database startup process and stopped&amp;nbsp;immediately&amp;nbsp;before shutdown.&lt;br /&gt;Now this process is&amp;nbsp;responsible for implementing the &lt;i&gt;ODCI&lt;/i&gt; methods &lt;i&gt;start-fetch-close/count-hit&lt;/i&gt; on behalf of the client process (process&amp;nbsp;associated&amp;nbsp;to an specific user session) which connect to the shared-slave process by using &lt;i&gt;RMI&lt;/i&gt;.&lt;br /&gt;With this new architecture we have two principal&amp;nbsp;benefits:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Reduce memory&amp;nbsp;consumption&lt;/li&gt;&lt;li&gt;Increase Lucene Cache Hits&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Less memory&amp;nbsp;consumption because the internal &lt;i&gt;OJVM&lt;/i&gt; implementation is attached to a client session, so the Java space used by &lt;i&gt;Lucene&lt;/i&gt;&amp;nbsp;structures&amp;nbsp;is isolated and&amp;nbsp;independent&amp;nbsp;from another concurrent session, now all &lt;i&gt;Lucene&lt;/i&gt; memory structures used during index scan process are created in a shared process and then not replicated.&lt;br /&gt;Also if one session submits a &lt;i&gt;Lucene&lt;/i&gt; search, this search is cached for subsequent queries, all subsequent queries&amp;nbsp;coming&amp;nbsp;from the same client session or any other which are&amp;nbsp;associated to the same index and with the same Query string implies a hit.&lt;br /&gt;I'll explain more in detail this new architecture in another post also showing how many parallel process can work together when using Parallel Indexing and Searching.&lt;br /&gt;On the other hand next week I'll be at the&amp;nbsp;&lt;a href="http://www.oracle.com/us/openworld/index.htm"&gt;Oracle OpenWorld 2010&lt;/a&gt; in &lt;b&gt;SFO&lt;/b&gt; presenting the session:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Schedule&lt;/b&gt;: Tuesday: 09:30AM&lt;br /&gt;&lt;b&gt;Session ID&lt;/b&gt;: S315660&lt;br /&gt;&lt;b&gt;Title&lt;/b&gt;: Database Applications Lifecycle Management&lt;br /&gt;&lt;b&gt;Event&lt;/b&gt;: JavaOne and Oracle Develop&lt;br /&gt;&lt;b&gt;Stream(s)&lt;/b&gt;: ORACLE DEVELOP&lt;br /&gt;&lt;b&gt;Track(s)&lt;/b&gt;: Database Development&lt;br /&gt;&lt;b&gt;Abstract&lt;/b&gt;: Complex applications, such as Java running inside the database, require an application lifecycle management to develop and delivery good code. This session will cover some best practices, tools, and experience managing and delivering code for running inside the database, including tools for debugging, automatic test, packaging, deployment, and release management. Some of the tools presented will include Apache Maven, JUnit, log4j, Oracle JDeveloper, and others integrated into the Oracle Java Virtual Machine (JVM) development environment.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;See you there or at any of &lt;a href="http://www.oracle.com/us/openworld/062332.html"&gt;networking planned events&lt;/a&gt; :)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-5718249898701692171?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/5718249898701692171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/5718249898701692171'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2010/09/new-oracle-lucene-domain-index-release.html' title='New Oracle Lucene Domain Index release based on Lucene 3.0.2'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-6193368139632879343</id><published>2010-06-29T07:30:00.000-07:00</published><updated>2010-06-29T07:30:43.659-07:00</updated><title type='text'>Near-shore development in Tandil-Argentina</title><content type='html'>This post is bit off topic about Oracle, but not at all.&lt;br /&gt;I remember read by a first time the term &lt;b&gt;near-shore&lt;/b&gt; development during &lt;b&gt;&lt;i&gt;OOW08&lt;/i&gt;&lt;/b&gt; in a &lt;a href="http://www.informationweek.com/news/global-cio/outsourcing/showArticle.jhtml?articleID=210602256&amp;amp;queryText=near%20shore"&gt;Information Week&lt;/a&gt; newsletter free at &lt;i&gt;OTN Lounge&lt;/i&gt;.&lt;br /&gt;Two years ago I see the increasing on development using this model in my City &lt;i&gt;Tandil&lt;/i&gt;, 400Km far from Buenos Aires in Argentina.&lt;br /&gt;Specially, I am working as external consultant with the company &lt;a href="http://www.temperies.com/en/index.html"&gt;Temperies&lt;/a&gt; which was founded and growing in Tandil unlike other companies which are part of the&amp;nbsp;&lt;a href="http://www.pct.org.ar/3-AcercaParque/35-Clusters/1-pinfo/index.html"&gt;Technology&amp;nbsp;Park&lt;/a&gt;&amp;nbsp;and came from Buenos Aires.&lt;br /&gt;But why this market still growing in Tandil with well know economy changes?&lt;br /&gt;First Why Tandil?&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Is a very nice small city (130000 habitants)&amp;nbsp;surrounded by hills where the quality of life makes the difference in term of productivity of the development team, this is one of the bigger difference against other Argentine cities such as Buenos Aires, Cordoba or Rosario. Any worker can get his workplace in less than five minutes walking.&lt;/li&gt;&lt;li&gt;Has a recognized University&amp;nbsp;in &lt;a href="http://www.exa.unicen.edu.ar/"&gt;Computer Science&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Is cheap to live here, so salaries are not so high.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Second Why Argentina?&lt;br /&gt;&amp;nbsp;&amp;nbsp;- Is a country with a&amp;nbsp;big&amp;nbsp;difference in term of US$/Euro exchange rate compared with another countries like Chile for example, and&amp;nbsp;believe me when an near-shore project is evaluated this point is very important because with the same money you can do the project several times :)&lt;br /&gt;&amp;nbsp;&amp;nbsp;- Most of the computer science graduated and under-graduated students&amp;nbsp;have very good knowledge of English.&lt;br /&gt;&amp;nbsp;&amp;nbsp;- The time zone of Argentine is in middle of Europe and US West coast, so projects can be perfectly managed around the team&amp;nbsp;synchronization, if we work with San Francisco, we work during our afternoon, if we work with Germany, we work during our morning, and thats all.&lt;br /&gt;Finally I want to remark that there are plenty of offers in term of Software Factories in Tandil, from small companies with 10 to 20 employees to big factories with more than one&amp;nbsp;hundred employees&amp;nbsp;to fit with every need.&lt;br /&gt;As I set at the beginning of this post I am working with &lt;b&gt;&lt;i&gt;Temperies&lt;/i&gt;&lt;/b&gt; a mid-range Software Factory which, in addition to the list of goodness exposed previously, have an strong&amp;nbsp;commitment with Agile&amp;nbsp;practices, Oracle and a&amp;nbsp;widely experience with success stories in near-shoring projects around the world, and obviously the CIOs are good friends of mine :)&lt;br /&gt;Well if anybody want to go deeper in this area just drop me an email to marcelo.ochoa &lt;at&gt; gmail.com or see you at the &lt;a href="http://www.oracle.com/us/openworld/index.html"&gt;Oracle Open World in September&lt;/a&gt;.&lt;/at&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-6193368139632879343?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/6193368139632879343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/6193368139632879343'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2010/06/near-shore-development-in-tandil.html' title='Near-shore development in Tandil-Argentina'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-8152533569976452165</id><published>2010-06-08T14:04:00.000-07:00</published><updated>2010-06-08T14:04:10.981-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jdk1.5'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Domain Index'/><category scheme='http://www.blogger.com/atom/ns#' term='jdk1.4'/><category scheme='http://www.blogger.com/atom/ns#' term='retro-translator'/><category scheme='http://www.blogger.com/atom/ns#' term='ncomp'/><title type='text'>Dealing with JDK1.5 libraries on Oracle 10g</title><content type='html'>Modern libraries are compiled with JDK 1.5 and the question is How to deal with these libraries on an &lt;a href="http://download.oracle.com/docs/cd/B19306_01/java.102/b14187/toc.htm"&gt;Oracle 10g OJVM&lt;/a&gt;.&lt;br /&gt;Some examples are &lt;a href="http://lucene.apache.org/java/3_0_1/"&gt;Lucene 3.x&lt;/a&gt; branch or &lt;a href="http://hadoop.apache.org/"&gt;Hadoop&lt;/a&gt;. The solution that I tested is using a &lt;a href="http://retrotranslator.sourceforge.net/"&gt;Java Retro Translator&lt;/a&gt; and some complementary libraries.&lt;br /&gt;I have tested this solution in &lt;a href="http://docs.google.com/View?docid=ddgw7sjp_54fgj9kg"&gt;Lucene Domain Index&lt;/a&gt; &lt;a href="http://dbprism.cvs.sourceforge.net/viewvc/dbprism/odi/"&gt;3.x&lt;/a&gt; branch with success.&lt;br /&gt;As you can see on the CVS there is &lt;a href="http://dbprism.cvs.sourceforge.net/viewvc/dbprism/odi/db/build.xml?revision=1.5&amp;amp;view=markup"&gt;build.xml&lt;/a&gt; file which performs all the retro translator steps. Here an step by step explanation of the process:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Load all required libraries provided by Retro translator project which implements features not&amp;nbsp;available on JDK 1.4/1.3 runtime, this is done on the target&amp;nbsp;&lt;b&gt;&lt;i&gt;load-retrotranslator-sys-code.&lt;/i&gt;&lt;/b&gt; &amp;nbsp;This target loads many libraries on SYS schema due are&amp;nbsp;immutable, or with low&amp;nbsp;probability&amp;nbsp;of change.&amp;nbsp;It will change if we upgrade a retro-translator version. All libraries are then compiled to assembler using NCOMP utility, target&amp;nbsp;&lt;b&gt;&lt;i&gt;ncomp-runtime-retrotranslator-sys-code&lt;/i&gt;&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Then we can convert libraries compiled with JDK1.5, in this &lt;i&gt;build.xml&lt;/i&gt; file the Lucene and Lucene Domain Index implementation, to a JDK1.4 target runtime. This is done on the targets&amp;nbsp;&lt;b&gt;&lt;i&gt;backport-code-lucene&lt;/i&gt;&lt;/b&gt; and &lt;b&gt;&lt;i&gt;backport-code-odi&lt;/i&gt;&lt;/b&gt;, on first target We converts all Lucene libraries excluding JUnit and Test code, these libraries require as a dependency JUnit and retro-translator jars. Second target converts Lucene Domain Index jar depending on Lucene core and Oracle's libs. The back-port operation generates a file named &lt;i&gt;lucene-odi-all-${version}.jar&lt;/i&gt; with Lucene and Lucene Domain Index code ready to run on JDK1.4 runtime.&lt;/li&gt;&lt;li&gt;Once We have the code back-ported to a JDK1.4 runtime We can upload and NCOMP into Oracle 10g, this is done on targets&amp;nbsp;&lt;b&gt;&lt;i&gt;load-lucene-odi-backported-code&lt;span class="Apple-style-span" style="font-style: normal; font-weight: normal;"&gt; and&amp;nbsp;&lt;b&gt;&lt;i&gt;ncomp-lucene-all.&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;And that's all!!, the code works fine on my Oracle 10.2 database - Linux :), finally&amp;nbsp;users of 11g and 10g databases can deploy &lt;a href="http://sourceforge.net/projects/dbprism/files/odi/3.0.1.1.0/lucene-odi-bin-3.0.1.1.0.zip/download"&gt;Lucene Domain Index&lt;/a&gt; implementation using one distribution file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-8152533569976452165?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/8152533569976452165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/8152533569976452165'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2010/06/dealing-with-jdk15-libraries-on-oracle.html' title='Dealing with JDK1.5 libraries on Oracle 10g'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-1368334310393913969</id><published>2010-05-08T08:44:00.000-07:00</published><updated>2010-05-08T08:44:55.023-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='auto-complete'/><category scheme='http://www.blogger.com/atom/ns#' term='parallel indexing'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Domain Index'/><title type='text'>Auto complete functionality with latest Lucene Domain Index</title><content type='html'>A few days ago I uploaded two new releases of Oracle Lucene Domain Index, once based on &lt;a href="http://lucene.apache.org/java/2_9_2/"&gt;Lucene 2.9.2&lt;/a&gt; core base (&lt;a href="http://sourceforge.net/projects/dbprism/files/ojvm/2.9.2.1.1/lucene-ojvm-bin-10g-2.9.2.1.1.zip/download"&gt;10g&lt;/a&gt;, &lt;a href="http://sourceforge.net/projects/dbprism/files/ojvm/2.9.2.1.1/lucene-ojvm-bin-11g-2.9.2.1.1.zip/download"&gt;11g&lt;/a&gt;) and another based on &lt;a href="http://lucene.apache.org/java/3_0_1/"&gt;3.0.1&lt;/a&gt; release (&lt;a href="http://sourceforge.net/projects/dbprism/files/odi/3.0.1.1.0/lucene-odi-bin-3.0.1.1.0.zip/download"&gt;10g/11g&lt;/a&gt;).&lt;br /&gt;The question is why 3.0.1 release only have one installation file?&lt;br /&gt;This is because the code base of Lucene 3.x branch is only compatible with JDK1.5 so to get Lucene 3.x release working on 10g databases which is based on JDK1.4 I included a &lt;a href="http://retrotranslator.sourceforge.net/"&gt;retro-translator&lt;/a&gt;, this library gets code compiled in 1.5 format and converts it to 1.4, I'll explain more in details this process in another post.&lt;br /&gt;The important point is, &lt;i&gt;I want to still supporting Lucene Domain Index for Oracle 10g&lt;/i&gt; because the installed base of this release is big even with the end of official support next July.&lt;br /&gt;On the other hand this new release includes another great contribution from &lt;b&gt;Pedro Pinheiro&lt;/b&gt;, an auto-complete pipeline table function. This reinforce the goal of Lucene Domain Index that with a few new classes and some PLSQL wrapper you can extend LDI to your need.&lt;br /&gt;Here a simple example:&lt;br /&gt;I am creating and populating a simple table with a english-spanish dictionary lookup:&lt;br /&gt;&lt;blockquote&gt;create table dicc (&lt;br /&gt;&amp;nbsp;&amp;nbsp; term varchar(256),&lt;br /&gt;&amp;nbsp;&amp;nbsp; def &amp;nbsp;varchar2(4000))&lt;br /&gt;/&lt;br /&gt;-- Populate dictionary with 10K terms and definitions&lt;br /&gt;@@dicc-values&lt;/blockquote&gt;then a Lucene Domain Index for auto-complete functionality:&lt;br /&gt;&lt;blockquote&gt;create index dicc_lidx on dicc(term) indextype is lucene.luceneindex&lt;br /&gt;parameters('ExtraCols:def;LogLevel:INFO;FormatCols:&lt;b&gt;TERM(ANALYZED_WITH_POSITIONS_OFFSETS)&lt;/b&gt;;PerFieldAnalyzer:TERM(org.apache.lucene.analysis.WhitespaceAnalyzer),DEF(org.apache.lucene.analysis.StopAnalyzer)');&lt;/blockquote&gt;Note that TERM column is analyzed storing term positions offset.&lt;br /&gt;With this index created we can query using auto complete pipeline table function as follow:&lt;br /&gt;&lt;blockquote&gt;SQL&amp;gt; select * from table(lautocomplete('DICC_LIDX','TERM','th',15)) t;&lt;br /&gt;&lt;br /&gt;TERM &amp;nbsp; &amp;nbsp;DOCFREQ                                                                                                                                                                                                                                                                    &lt;br /&gt;there &amp;nbsp; &amp;nbsp; &amp;nbsp; 3                                                                                                                                  &lt;br /&gt;theory &amp;nbsp; &amp;nbsp; 2&lt;br /&gt;thaw &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;br /&gt;then &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;br /&gt;therefore 2&lt;br /&gt;thence &amp;nbsp; &amp;nbsp; 1&lt;br /&gt;their &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;br /&gt;thanks &amp;nbsp; &amp;nbsp; 1&lt;br /&gt;theft &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;br /&gt;theatrical 1&lt;br /&gt;the &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;br /&gt;theme &amp;nbsp; &amp;nbsp; 1&lt;br /&gt;that &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;br /&gt;thermal &amp;nbsp; 1&lt;br /&gt;thank &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;br /&gt;15 rows selected.&lt;br /&gt;Elapsed: 00:00:00.01&lt;/blockquote&gt;First argument of this function is your index name, second argument is the column used for auto complete, third argument is the string used for lookup and last argument is how many terms are returned. By default rows are returned order by &lt;b&gt;&lt;i&gt;docFreq&lt;/i&gt;&lt;/b&gt; descending. Here other example:&lt;br /&gt;&lt;blockquote&gt;SQL&amp;gt; select * from table(lautocomplete('DICC_LIDX','TERM','spor',10)) t;&lt;br /&gt;TERM &amp;nbsp; &amp;nbsp; &amp;nbsp;DOCFREQ&lt;br /&gt;sport &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;br /&gt;sportsman 1&lt;br /&gt;sporadic &amp;nbsp; 1&lt;br /&gt;Elapsed: 00:00:00.02&lt;/blockquote&gt;For the example table which includes 10102 rows the execution time of above examples is around &lt;b&gt;&lt;i&gt;21ms&lt;/i&gt;&lt;/b&gt;, not bad for a notebook.&lt;br /&gt;Another new feature of this release is parallel index on RAM, which is enable by default with this release, indexing on RAM means that when you are working in &lt;b&gt;&lt;i&gt;OnLine&lt;/i&gt;&lt;/b&gt; mode a batch of new rows to be added to the index are processed in parallel (&lt;b&gt;&lt;i&gt;ParallelDegree&lt;/i&gt;&lt;/b&gt; parameter) more information is on &lt;a href="http://docs.google.com/View?docid=ddgw7sjp_571cdccw6db#3_1_8_Parallel_Index_Operation_2561108749359846"&gt;Lucene Domain Index documentation on-line&lt;/a&gt;,&amp;nbsp;if you have a server with multi-core processor or a RAC installation with sufficient RAM this feature speed up your indexing time by 40% eliminating the BLOB access during a partial index creation.&lt;br /&gt;Well next post will be about how to deal with Libraries compiled using JDK1.5 on Oracle 10g Databases. Stay tunned...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-1368334310393913969?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/1368334310393913969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/1368334310393913969'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2010/05/auto-complete-functionality-with-latest.html' title='Auto complete functionality with latest Lucene Domain Index'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-5842248860143883695</id><published>2010-03-29T07:12:00.000-07:00</published><updated>2010-03-29T07:35:32.499-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Did You Mean'/><category scheme='http://www.blogger.com/atom/ns#' term='2.9.2'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Domain Index'/><title type='text'>New release of Lucene Domain Index based on Lucene 2.9.2</title><content type='html'>Here we are, latest release of &lt;b&gt;&lt;i&gt;Lucene Domain Index&lt;/i&gt;&lt;/b&gt; is ready for downloading at &lt;a href="http://sourceforge.net/projects/dbprism/files/"&gt;SF.net download area&lt;/a&gt;.&lt;br /&gt;As usual this is a new production release based on latest production release of &lt;a href="http://lucene.apache.org/java/2_9_2/"&gt;Apache Lucene Project&lt;/a&gt;, but we always included some new functionalities :)&lt;br /&gt;This release includes an&amp;nbsp;interesting&amp;nbsp;contribution from Pedro Pinheiro &lt;i&gt;&lt;b&gt;Lucene Did You Mean&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;, to implement this functionality a dictionary can be created by calling:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;blockquote&gt;BEGIN&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; DidYouMean.indexDictionary('SOURCE_BIG_LIDX','TEXT');&lt;br /&gt;END;&lt;/blockquote&gt;&lt;i&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-style: normal; font-weight: normal;"&gt;this&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal; font-weight: normal;"&gt;dictionary&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal; font-weight: normal;"&gt;&amp;nbsp;is orthogonal to the Domain Index updates and should be&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal; font-weight: normal;"&gt;maintained&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal; font-weight: normal;"&gt;&amp;nbsp;externally by calling again above procedure if there are a lot of changes on the column(s) which was used as index terms.&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Then you can easily query Did You Mean words by using a function:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;blockquote&gt;SQL&amp;gt; select DidYouMean.suggest('SOURCE_BIG_LIDX','souce vody') from dual;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;source body&lt;/blockquote&gt;&lt;i&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-style: normal; font-weight: normal;"&gt;More information about this package is at Lucene Domain Index documentation available for download as &lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal; font-weight: normal;"&gt;&lt;a href="http://sourceforge.net/projects/dbprism/files/ojvm/2.9.2.1.0/Lucene_Domain_Index.pdf/download"&gt;PDF&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal; font-weight: normal;"&gt; or on-line through &lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal; font-weight: normal;"&gt;&lt;a href="http://docs.google.com/Doc?docid=0AVfwyTi0k18ZZGRndzdzanBfNTRmZ2o5a2c"&gt;Google Docs&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal; font-weight: normal;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Enjoy this new release!!!&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;Last minute comments&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;: We are working with &lt;a href="http://lucene.apache.org/java/3_0_1/"&gt;Lucene 3.0.1 release&lt;/a&gt; which works perfect on 11g databases because is only available for JDK1.5 API, but as everybody knows 10g installation are widely used aound the world, so We are working in a Lucene Domain Index 3.0.1 distribution&amp;nbsp;back-ported&amp;nbsp;to JDK1.4 using a &lt;a href="http://retrotranslator.sourceforge.net/"&gt;retro-translator&lt;/a&gt;, once We have a full tested release it will be available for download, stay tunned.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-5842248860143883695?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/5842248860143883695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/5842248860143883695'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2010/03/new-release-of-lucene-domain-index.html' title='New release of Lucene Domain Index based on Lucene 2.9.2'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-3686993861181619999</id><published>2010-02-16T04:39:00.000-08:00</published><updated>2010-02-16T04:41:24.196-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='parallel indexing'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Domain Index'/><title type='text'>New release of Lucene Domain Index based on Lucene 2.9.1</title><content type='html'>We have released a new Lucene Domain Index (&lt;b&gt;&lt;i&gt;LDI&lt;/i&gt;&lt;/b&gt;) based on 2.9.1 core base.&lt;br /&gt;&lt;div&gt;Since &lt;a href="http://lucene.apache.org/java/docs/#6+November+2009+-+Lucene+Java+2.9.1+available"&gt;Lucene 2.9.1&lt;/a&gt; is on the road from several months ago why this new release of &lt;b&gt;&lt;i&gt;LDI&lt;/i&gt;&lt;/b&gt; came delayed?&lt;/div&gt;&lt;div&gt;The answer is because We added parallel processing support.&lt;/div&gt;&lt;div&gt;This new feature is enabled by a new &lt;b&gt;&lt;i&gt;LDI&lt;/i&gt;&lt;/b&gt; parameter &lt;b&gt;&lt;i&gt;ParallelDegree&lt;/i&gt;&lt;/b&gt;, by setting this parameter with a value greater than 1 &lt;b&gt;&lt;i&gt;LDI&lt;/i&gt;&lt;/b&gt; creates multiples Lucene directory storages to process insertions in parallel.&lt;/div&gt;&lt;div&gt;Let see a practical example:&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;create index source_big_lidx on test_source_big(text)&lt;br /&gt;indextype is lucene.luceneindex&amp;nbsp;parameters('&lt;b&gt;&lt;i&gt;BatchCount:250;ParallelDegree:2;SyncMode:OnLine&lt;/i&gt;&lt;/b&gt;;LogLevel:INFO;AutoTuneMemory:true;PerFieldAnalyzer:line(org.apache.lucene.analysis.KeywordAnalyzer),TEXT(org.apache.lucene.analysis.SimpleAnalyzer);FormatCols:line(0000);ExtraCols:line "line"');&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Above example create a &lt;i&gt;&lt;b&gt;LDI&lt;/b&gt;&lt;/i&gt; with &lt;b&gt;&lt;i&gt;ParallelDegree&lt;/i&gt;&lt;/b&gt; equal to 2 and &lt;b&gt;&lt;i&gt;BatchCount&lt;/i&gt;&lt;/b&gt; equal to 250. Parallel degree is only used when &lt;b&gt;&lt;i&gt;SyncMode&lt;/i&gt;&lt;/b&gt; is &lt;b&gt;&lt;i&gt;OnLine&lt;/i&gt;&lt;/b&gt;, future &lt;b&gt;&lt;i&gt;LDI&lt;/i&gt;&lt;/b&gt; releases will includes parallel operations when &lt;b&gt;&lt;i&gt;SyncMode&lt;/i&gt;&lt;/b&gt; is &lt;b&gt;&lt;i&gt;Deferred&lt;/i&gt;&lt;/b&gt;.&lt;/div&gt;&lt;div&gt;Once this DML operation is executed &lt;b&gt;&lt;i&gt;LDI&lt;/i&gt;&lt;/b&gt; creates three &lt;i&gt;OJVMDirectory&lt;/i&gt; &lt;i&gt;Lucene&lt;/i&gt; stores, two for parallel index operations and the master store, then&amp;nbsp;batches&amp;nbsp;of 250 rows are enqueued for indexing in parallel mode.&lt;/div&gt;&lt;div&gt;Parallel insert implies a parallel operation (document&amp;nbsp;creation and insertion in a secondary store) and serialized &lt;a href="http://www.asteriosk.gr/blog/2009/03/31/merging-multiple-lucene-indexes/"&gt;merge&lt;/a&gt;&amp;nbsp;in the master store.&lt;/div&gt;&lt;div&gt;Machines with multi-core chips or RAC installations will speed up the &lt;b&gt;&lt;i&gt;LDI&lt;/i&gt;&lt;/b&gt; index creation/rebuild, obviously when an &lt;i&gt;IO&lt;/i&gt; concurrence is the bottleneck there is no performance improvement when &lt;b&gt;&lt;i&gt;ParallelDegree&lt;/i&gt;&lt;/b&gt;&amp;gt;1. Look at this screenshot on my notebook&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_ynfsOwQFaM0/S3qHIdcT3qI/AAAAAAAAAUA/wukAEAVwUMo/s1600-h/lucene-parallel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="95" src="http://1.bp.blogspot.com/_ynfsOwQFaM0/S3qHIdcT3qI/AAAAAAAAAUA/wukAEAVwUMo/s400/lucene-parallel.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;As you can see two background processes (&lt;i&gt;AQ&lt;/i&gt; processes named &lt;i&gt;ora_j*_test&lt;/i&gt;) are running consuming most of the CPU usage, these are &lt;b&gt;&lt;i&gt;LDI&lt;/i&gt;&lt;/b&gt; operations (insert|merge), also you can see two DB Writer process trying to write in parallel the information that &lt;b&gt;&lt;i&gt;LDI&lt;/i&gt;&lt;/b&gt; is generating.&lt;/div&gt;&lt;div&gt;A complete list of changes of this new release is at &lt;a href="http://sourceforge.net/projects/dbprism/files/ojvm/2.9.1.1.0/ChangeLog.txt/view"&gt;ChangeLog.txt file&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;Downloads for &lt;a href="http://sourceforge.net/projects/dbprism/files/ojvm/2.9.1.1.0/lucene-ojvm-bin-11g-2.9.1.1.0.zip/download"&gt;11g&lt;/a&gt; and &lt;a href="http://sourceforge.net/projects/dbprism/files/ojvm/2.9.1.1.0/lucene-ojvm-bin-10g-2.9.1.1.0.zip/download"&gt;10g&lt;/a&gt; in binary format are SF.net project section &lt;a href="http://sourceforge.net/projects/dbprism/files/"&gt;download&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;Source code, obviously, is available through &lt;a href="http://sourceforge.net/projects/dbprism/develop"&gt;CVS access&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;On line documentation is available in &lt;a href="http://sourceforge.net/projects/dbprism/files/ojvm/2.9.1.1.0/Lucene_Domain_Index.pdf/download"&gt;PDF&lt;/a&gt; or as &lt;a href="http://docs.google.com/View?id=ddgw7sjp_54fgj9kg"&gt;Google Document&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-3686993861181619999?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/3686993861181619999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/3686993861181619999'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2010/02/new-release-of-lucene-domain-index.html' title='New release of Lucene Domain Index based on Lucene 2.9.1'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_ynfsOwQFaM0/S3qHIdcT3qI/AAAAAAAAAUA/wukAEAVwUMo/s72-c/lucene-parallel.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-2193253472610557763</id><published>2009-12-14T16:11:00.000-08:00</published><updated>2011-03-28T03:36:33.362-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Source Connection Pooling and Caching'/><category scheme='http://www.blogger.com/atom/ns#' term='JDBC'/><title type='text'>Revisiting JDBC Connection Pooling and Spring Data Source implementation</title><content type='html'>&lt;span style="font-family: 'Times New Roman'; font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="font-family: 'Times New Roman'; font-size: medium;"&gt;&lt;span style="font-size: medium;"&gt;&lt;span style="font-family: inherit;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', Verdana, Arial, sans-serif;"&gt;Today, I have revisited the Oracle Implementation of &lt;a href="http://download.oracle.com/docs/cd/E11882_01/java.112/e16548/ociconpl.htm#CIHFFCEC"&gt;OCI Connection Pooling&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Times New Roman'; font-size: medium;"&gt;&lt;span style="font-size: medium;"&gt;&lt;span style="font-family: inherit;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', Verdana, Arial, sans-serif;"&gt;Using my previous post&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: 'Times New Roman'; font-size: medium;"&gt;&lt;span style="color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;h3 class="post-title entry-title" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www2.blogblog.com/rounders3/icon_arrow.gif); background-origin: initial; background-position: 10px 0.5em; background-repeat: no-repeat no-repeat; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dotted; border-bottom-width: 1px; border-left-color: rgb(187, 187, 187); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(187, 187, 187); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(187, 187, 187); border-top-style: dotted; border-top-width: 0px; color: #333333; display: block; font: normal normal bold 135%/normal 'Trebuchet MS', Verdana, Arial, sans-serif; line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 2px; padding-left: 29px; padding-right: 14px; padding-top: 2px;"&gt;&lt;a href="http://marceloochoa.blogspot.com/2007/10/using-native-oracle-data-source-and.html" style="color: #333333; text-decoration: none;"&gt;Using native Oracle Data Source and connection caching/pooling from Spring&lt;/a&gt;&lt;/h3&gt;&lt;div&gt;&lt;span style="color: black; line-height: normal;"&gt;&lt;span style="font-family: inherit;"&gt;&lt;span style="font-size: medium;"&gt;I have updated the file examples:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://mochoa.sites.exa.unicen.edu.ar/Home/presentations/jdbc.properties?attredirects=0&amp;amp;d=1"&gt;jdbc.properties&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://mochoa.sites.exa.unicen.edu.ar/Home/presentations/applicationContext.xml?attredirects=0&amp;amp;d=1"&gt;applicationContext.xml&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: black; line-height: normal;"&gt;&lt;span style="font-family: inherit;"&gt;&lt;span style="font-size: medium;"&gt;The idea behind this tip is the same, do the connection pooling implementation by using the JDBC driver which is faster and safer.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: black; line-height: normal;"&gt;&lt;span style="font-family: inherit;"&gt;&lt;span style="font-size: medium;"&gt;If you are using an old database version, for example 10g, you can try installing at the middle tier the &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.oracle.com/technology/software/tech/oci/instantclient/index.html"&gt;&lt;span style="font-family: inherit;"&gt;&lt;span style="font-size: medium;"&gt;Install Client&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: inherit;"&gt;&lt;span style="font-size: medium;"&gt; which is available for multiples platform, including Mac OS/X&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: black;"&gt;&lt;span style="line-height: normal;"&gt;&lt;span style="font-family: inherit;"&gt;&lt;span style="font-size: medium;"&gt;HTH, Marcelo.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-2193253472610557763?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/2193253472610557763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/2193253472610557763'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2009/12/revisiting-jdbc-connection-pooling-and.html' title='Revisiting JDBC Connection Pooling and Spring Data Source implementation'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-9021535555126709682</id><published>2009-10-06T10:56:00.000-07:00</published><updated>2009-10-06T11:20:13.298-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OJVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Open World 09'/><category scheme='http://www.blogger.com/atom/ns#' term='talk'/><title type='text'>Experiences on Java programming within the databases, tips &amp; tricks, tools, open source libraries and more</title><content type='html'>&lt;div&gt;This is the topic of my talk during &lt;a href="http://wiki.oracle.com/page/Oracle+OpenWorld+Unconference"&gt;unconference&lt;/a&gt; this year (Tuesday - Oct 13 - 10am - Overlook II) but, What is an unconference?&lt;br /&gt;An unconference is a conference where the content of the sessions is driven and created by the participants, generally day-by-day during the course of the event, rather than by a single organizer, or small group of organizers, in advance (&lt;a href="http://en.wikipedia.org/wiki/Unconference"&gt;Source: Wikipedia&lt;/a&gt;). Unconferences came from the realization that "the sum of the expertise of the people in the audience is greater than the sum of expertise of the people on stage" (&lt;a href="http://scripting.wordpress.com/2006/03/05/what-is-an-unconference/"&gt;Source: Dave Winer&lt;/a&gt;).&lt;br /&gt;During this talk I would like to transfer my experience on Java programming withing the Database since 1999.&lt;br /&gt;Specially looking for three scenarios of work:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Traditional Java Stored Procedure programming&lt;/li&gt;&lt;li&gt;HTPP/HTTPS services through the XMLDB Servlet connector&lt;/li&gt;&lt;li&gt;Domain Index and pipe-line table function&lt;/li&gt;&lt;/ul&gt;This scenarios are covered by different Open Source projects used as practical examples &lt;a href="http://www.dbprism.com.ar/en/j2-CMS/"&gt;DBPrism CMS&lt;/a&gt;, &lt;a href="http://wiki.restlet.org/docs_2.0/13-restlet/28-restlet/84-restlet.html"&gt;XMLDB Restlet Connector&lt;/a&gt; and &lt;a href="http://docs.google.com/View?id=ddgw7sjp_54fgj9kg"&gt;Lucene Domain Index&lt;/a&gt;.&lt;br /&gt;Each projects included several Open Source Libraries used and many tools for doing deployment and installing.&lt;br /&gt;I hope I can see you all there next week... Marcelo&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-9021535555126709682?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/9021535555126709682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/9021535555126709682'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2009/10/experiences-on-java-programming-within.html' title='Experiences on Java programming within the databases, tips &amp; tricks, tools, open source libraries and more'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-3971772302673416654</id><published>2009-09-30T04:47:00.000-07:00</published><updated>2009-09-30T06:58:52.887-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='ODCI API'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Oracle Integration Java Data Cartridge API'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Domain Index'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene'/><title type='text'>New release of Lucene Domain Index based on Lucene 2.9.0</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "&gt;&lt;div&gt;A new binary distribution of Lucene Domain Index (2.9.0.1.0) for Oracle 10g/11g has been released.&lt;/div&gt;  Lucene Domain Index is integration of Lucene Project running inside the Oracle JVM and integrated to the SQL layer by adding a new index type.&lt;br /&gt;  This new version uses latest Lucene 2.9.0 core libraries and introduces some of the changes on API.&lt;br /&gt;  Here complete list of changes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Tested with Oracle 11gR2, 11gR1 and 10.2 databases.&lt;/li&gt;&lt;li&gt;DefaultUserDataStore do a SAX parsing to get text nodes and attributes from an XMLType value.&lt;/li&gt;&lt;li&gt;A SimpleLRUCache is used to load rowids and his associated Lucene doc id, this reduce memory consumption when querying very big tables. A new parameter has been added, CachedRowIdSize by default 10000 to control the size of the LRU cache.&lt;/li&gt;&lt;li&gt;Lucene Domain Index core was updated to use TopFieldCollector and to avoid computation time when lscore() is not used.&lt;/li&gt;&lt;li&gt;Two new parameter has been added NormalizeScore which control when to track the Max Score and  when querying, both parameters are consequence of new Lucene Collector API and boost the performance when querying.&lt;/li&gt;&lt;li&gt;A table alias L$MT is defined for the master table associated to the index to be used in complex queries associating columns from master tables and columns from dependant tables.&lt;/li&gt;&lt;/ul&gt;Full documentation is at &lt;a href="http://docs.google.com/View?id=ddgw7sjp_54fgj9kg"&gt;Google Doc&lt;/a&gt;.&lt;br /&gt;Download binary version for Oracle &lt;a href="http://sourceforge.net/projects/dbprism/files/ojvm/2.9.0.1.0/lucene-ojvm-bin-10g-2.9.0.1.0.zip/download"&gt;10g&lt;/a&gt; and &lt;a href="http://sourceforge.net/projects/dbprism/files/ojvm/2.9.0.1.0/lucene-ojvm-bin-11g-2.9.0.1.0.zip/download"&gt;11g&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:arial, sans-serif;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 13px; "&gt;One of the biggest changed introduced into Lucene core libraries are in the TopCollector API, it introduces optimizations when you don't need to compute the score, track maximum score and preserve the Lucene document ID in order.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:arial, sans-serif;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 13px;"&gt;This changes are reflected in Lucene Domain Index through the usage of &lt;b&gt;lscore()&lt;/b&gt; ancilliary operator. For example:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:arial, sans-serif;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 13px;"&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;create table emails (&lt;/div&gt;&lt;div&gt; emailFrom VARCHAR2(256),&lt;/div&gt;&lt;div&gt; emailTo VARCHAR2(256),&lt;/div&gt;&lt;div&gt; subject VARCHAR2(4000),&lt;/div&gt;&lt;div&gt; emailDate DATE,&lt;/div&gt;&lt;div&gt; bodyText CLOB)&lt;/div&gt;&lt;div&gt;/&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;and an index created as:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;create index emailbodyText on emails(bodyText) indextype is lucene.LuceneIndex &lt;/div&gt;&lt;div&gt;parameters('Analyzer:org.apache.lucene.analysis.StopAnalyzer;ExtraCols:emailDate "emailDate",subject "subject",emailFrom "emailFrom",emailTo "emailTo"');&lt;/div&gt;&lt;div&gt;-- required to Sort by subject&lt;/div&gt;&lt;div&gt;alter index emailbodyText parameters('FormatCols:subject(NOT_ANALYZED),emailFrom(NOT_ANALYZED),emailTo(NOT_ANALYZED)');&lt;/div&gt;&lt;div&gt;-- do not track max score&lt;/div&gt;&lt;div&gt;alter index emailbodyText parameters('NormalizeScore:false');&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;this queries reflect when score is computed or not.&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;div&gt;SELECT /*+ DOMAIN_INDEX_SORT */ lscore(1) sc,subject &lt;/div&gt;&lt;div&gt;   FROM emails where emailfrom like '%@gmail.com' and &lt;/div&gt;&lt;div&gt;   lcontains(bodytext,'subject:lucene injection',1)&gt;0&lt;/div&gt;&lt;div&gt;   order by lscore(1) DESC;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Lucene score is computed and do not track maximum score, the result will be returned using relevance order descendant, default Lucene ordering no extra effort.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;div&gt;SELECT /*+ DOMAIN_INDEX_SORT */ subject &lt;/div&gt;&lt;div&gt;   FROM emails &lt;/div&gt;&lt;div&gt;   where lcontains(bodytext,'subject:lucene injection','subject:ASC',1)&gt;0;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Lucene score is not computed and obviously the maximum score is not tracked.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Note&lt;/b&gt; that if we are querying using the optimizer hint &lt;b&gt;DOMAIN_INDEX_SORT&lt;/b&gt; and &lt;b&gt;lcontains(..,'subject:ASC',..)&lt;/b&gt; the score value is not relevant the result will be returned using the column subject ascending.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Similar result can be obtained using &lt;b&gt;order by&lt;/b&gt; SQL, but to do that the RDBMS first collects all the rows that match to lcontains() operator and then do an order by, the difference in this simple test is an optimizer cost 3 over 2.&lt;/div&gt;&lt;div&gt;The NormalizeScore parameter is by default true, to get back compatibility, applications which assume an score in range 0..1 will run without any change, but if you want to get faster response time by avoiding max score computation you can change it by using alter index parameters DDL command.&lt;/div&gt;&lt;div&gt;To see which really means NormalizeScore parameter look a this example using WikiPedia English dump:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;select /*+ FIRST_ROWS DOMAIN_INDEX_SORT */ lscore(1),&lt;/div&gt;&lt;div&gt;extractValue(object_value,'/page/title'),&lt;/div&gt;&lt;div&gt;extractValue(object_value,'/page/revision/timestamp') "revisionDate"&lt;/div&gt;&lt;div&gt;from pages where lcontains(object_value,'rownum:[1 TO 2] AND sport','revisionDate:ASC',1)&gt;0;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;with NormalizeScore:false returns:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div style="text-align: justify;"&gt;1.56775963306427001953125     SCCA                       25-FEB-02 03.43.11.000000000 PM +00:00&lt;/div&gt;&lt;div style="text-align: justify;"&gt;1.79172527790069580078125     Sports utility vehicle&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;04-APR-02 10.31.41.000000000 PM +00:00&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;with NormalizeScore:true returns:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div style="text-align: justify;"&gt;0.875                                        SCCA                       25-FEB-02 03.43.11.000000000 PM +00:00&lt;/div&gt;&lt;div style="text-align: justify;"&gt;1                                              Sports utility vehicle   04-APR-02 10.31.41.000000000 PM +00:00&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Both results are logically because we are looking for a result order by revisionDate:ASC, but the score computed is different.&lt;/div&gt;&lt;div&gt;Well, I will be at &lt;a href="http://www.oracle.com/openworld/index.html"&gt;Oracle Open World 09&lt;/a&gt;, if anybody want to know more about this kind of internal implementation I will talk at the &lt;a href="http://wiki.oracle.com/page/Oracle+OpenWorld+Unconference/"&gt;Oracle Unconference&lt;/a&gt; and obviously we can meet at the OTN Lounge, see you there Marcelo.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-3971772302673416654?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/3971772302673416654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/3971772302673416654'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2009/09/new-release-of-lucene-domain-index.html' title='New release of Lucene Domain Index based on Lucene 2.9.0'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-6996161565940549616</id><published>2009-06-17T05:28:00.000-07:00</published><updated>2009-06-17T06:27:00.090-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Object Types'/><category scheme='http://www.blogger.com/atom/ns#' term='oow09'/><category scheme='http://www.blogger.com/atom/ns#' term='ODCI API'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Domain Index'/><title type='text'>Unleash Oracle ODCI API - OOW09 Voting Session</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;a href="http://oracle.com/openworld"&gt;Oracle Open World&lt;/a&gt; Voting session is a new way to create the conference session agenda.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I have submited two speaker session, one named "&lt;a href="https://mix.oracle.com/oow/proposals/10413-unleash-oracle-odci-api"&gt;Unleash Oracle ODCI API&lt;/a&gt;" that is ready for voting at &lt;a href="http://blogs.oracle.com/otn/2009/06/oracle_openworld_2009_voteases.html"&gt;Oracle Mix comunity&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.oracle.com/pls/db111/to_toc?pathname=appdev.111/b28425/toc.htm"&gt;Oracle Data Cartridge API&lt;/a&gt; is provided to implement many powerful functionality such as new Domain Indexes, pipeline tables, and aggregated functions.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The presentation will include an introduction to this API showing many of his features using as example the code of a Lucene Domain Index which is a mix between &lt;a href="http://www.oracle.com/pls/db111/to_toc?pathname=java.111/b31225/toc.htm"&gt;Java running inside the OJVM&lt;/a&gt; and &lt;a href="http://www.oracle.com/pls/db111/to_toc?pathname=appdev.111/b28371/toc.htm"&gt;Oracle Object types&lt;/a&gt;.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://docs.google.com/Doc?id=ddgw7sjp_54fgj9kg"&gt;Lucene Domain Index&lt;/a&gt; is an open source project which integrates the &lt;a href="http://lucene.apache.org/java/docs/"&gt;Apache Lucene IR library&lt;/a&gt; as a new Domain Index, providing features has free text searching, faceting, highlighting, filtering at index level, multi table/column indexes and more for 10g/11g databases.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Basically I would like to introduce this exciting API which allows developers to interact directly with the RDBMS engine and adding some examples in Java that are not included into the Oracle Documentation.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Well if you want to see this session at OOW09 please &lt;a href="https://mix.oracle.com/oow/proposals/10413-unleash-oracle-odci-api"&gt;click here&lt;/a&gt;, see you there....&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-6996161565940549616?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/6996161565940549616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/6996161565940549616'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2009/06/unleash-oracle-odci-api-oow09-voting.html' title='Unleash Oracle ODCI API - OOW09 Voting Session'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-2965675912986646378</id><published>2009-04-07T13:16:00.000-07:00</published><updated>2011-04-12T05:11:49.635-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='SOAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='WS'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Web Services Manager'/><category scheme='http://www.blogger.com/atom/ns#' term='Authorization'/><title type='text'>Oracle Web Services Manager book</title><content type='html'>Recently I received a copy of the book &lt;a href="http://www.packtpub.com/oracle-web-services-manager/book"&gt;Oracle Web Services Manager&lt;/a&gt; as courtesy of Pack  Publishing editorial.&lt;br /&gt;As everybody knows, I am more familiar with REST WS than SOAP and WS-* security standards, so I have read entirely the book :)&lt;br /&gt;This book have a very good introduction to all security related stuff and also a comprehensive introduction to the product Oracle Web Services Manager.&lt;br /&gt;For anybody who want to deploy secure WS using Oracle WS Manager the book will introduce you gradually ,and by examples, on all the steps related to authorization, authentication, digital signatures and many other topics.&lt;br /&gt;On the client side the examples are in .Net technology (I prefer Java) but its a minor disappointment with the complete book content.&lt;br /&gt;For anybody who want to take a closer look before buy the book, here a sample chapter on &lt;br /&gt;&lt;blockquote&gt;&lt;a href="http://mochoa.sites.exa.unicen.edu.ar/Home/presentations/OracleWebservicesManager-AuthenticationandAuthorization.zip?attredirects=0&amp;amp;d=1"&gt;Oracle Web services Manager-Authentication and Authorization&lt;/a&gt;&lt;/blockquote&gt;for downloading.&lt;br /&gt;Enjoy the book....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-2965675912986646378?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/2965675912986646378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/2965675912986646378'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2009/04/oracle-web-services-manager-book.html' title='Oracle Web Services Manager book'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-2564921339018907902</id><published>2009-03-27T07:22:00.000-07:00</published><updated>2009-03-27T09:48:21.812-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='aggregate function'/><category scheme='http://www.blogger.com/atom/ns#' term='OJVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Facets'/><category scheme='http://www.blogger.com/atom/ns#' term='ODCI API'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Domain Index'/><title type='text'>Doing facets with latest Lucene Domain Index 2.4.1.1.0</title><content type='html'>As usual, I am using the announce of new release of &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=56183&amp;amp;package_id=255524&amp;amp;release_id=671419"&gt;Lucene Domain Index&lt;/a&gt; to comments some internal detail of &lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28425/toc.htm"&gt;Oracle ODCI API&lt;/a&gt;.&lt;br /&gt;Today, I will show how to use and works Lucene Domain Index facets.&lt;br /&gt;Latest release implements an aggregate function&lt;span style="font-weight: bold; font-style: italic;"&gt; lfacets()&lt;/span&gt; which performs bit set and grouping with Lucene. I am used &lt;a href="http://sujitpal.blogspot.com/2007/04/lucene-search-within-search-with.html"&gt;this article&lt;/a&gt; as a jump start for doing facets.&lt;br /&gt;Also I found another post on how to implement an &lt;a href="http://unclechrisblog.blogspot.com/2008/06/aggregate-function-for-collection-types.html"&gt;aggregated function &lt;/a&gt;using ODCI API, but as with the&lt;a href="http://marceloochoa.blogspot.com/2009/03/highlighting-features-with-latest.html"&gt; pipeline table function&lt;/a&gt; implementation there is no documentation nor examples on how to do it with Java inside the database.&lt;br /&gt;I am using same approach as the pipeline table function, a mix of&lt;a href="http://dbprism.cvs.sourceforge.net/viewvc/dbprism/ojvm/db/CreateAggregateFunction.sql?revision=1.2&amp;amp;view=markup"&gt; PLSQL code&lt;/a&gt; plus an &lt;a href="http://dbprism.cvs.sourceforge.net/viewvc/dbprism/ojvm/src/java/org/apache/lucene/search/facets/ojvm/HitCounter.java?revision=1.2&amp;amp;view=markup"&gt;internal implementation using Java&lt;/a&gt;.&lt;br /&gt;As you can see on the code there is an object type named &lt;span style="font-weight: bold; font-style: italic;"&gt;facets_agg_type&lt;/span&gt; which is the implementation of &lt;span style="font-weight: bold; font-style: italic;"&gt;lfacets()&lt;/span&gt; aggregated function, under the hood it creates the structure of the return type and call to the Java class which is doing a bit-set-AND operations on Lucene filters.&lt;br /&gt;As an example let me show how to do facets with &lt;a href="http://marceloochoa.blogspot.com/2007/12/uploading-wikipedia-dumps-to-oracle.html"&gt;WikiPedia Spanish dump uploaded to Oracle XMLDB&lt;/a&gt;. I can query PAGES table with lcontains() operator as:&lt;blockquote&gt;select /*+ DOMAIN_INDEX_SORT */ extractValue(object_value,'/page/title')&lt;br /&gt;from pages where&lt;br /&gt;lcontains(object_value,&lt;br /&gt;'rownum:[20 TO 30] AND musica AND revisionDate:[20070101 TO 20070718]')&gt;0;&lt;/blockquote&gt;But faceting is for doing grouping similar to&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ynfsOwQFaM0/ScztflDmfzI/AAAAAAAAALo/7Y3igKpaD9g/s1600-h/facets.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 589px; height: 185px;" src="http://3.bp.blogspot.com/_ynfsOwQFaM0/ScztflDmfzI/AAAAAAAAALo/7Y3igKpaD9g/s400/facets.jpg" alt="" id="BLOGGER_PHOTO_ID_5317886386796658482" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;so using some categories already defined into &lt;a href="http://es.wikipedia.org/wiki/Wikipedia:Portada"&gt;WikiPedia Spanish&lt;/a&gt; web site.&lt;br /&gt;I can create a simple table with the criteria for categorizing WikiPedia corpus.&lt;br /&gt;Here a table with parent relation ship to organize the categories:&lt;br /&gt;&lt;blockquote&gt;create table wiki_categories (&lt;br /&gt;cat_code    number(4),&lt;br /&gt;cat_name    varchar2(256),&lt;br /&gt;cat_parent  number(4),&lt;br /&gt;CONSTRAINT PK_WIKI_CATEGORIES PRIMARY KEY (cat_code),&lt;br /&gt;CONSTRAINT FK_CAT_PARENT FOREIGN KEY (cat_parent)&lt;br /&gt;     REFERENCES wiki_categories (cat_code)&lt;br /&gt;);&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;insert into wiki_categories values (1,'Ciencias naturales y formales',null);&lt;br /&gt;insert into wiki_categories values (2,'Ciencias humanas y sociales',null);&lt;br /&gt;insert into wiki_categories values (3,'Artes',null);&lt;br /&gt;insert into wiki_categories values (4,'Sociedad',null);&lt;br /&gt;insert into wiki_categories values (5,'Tecnologías',null);&lt;br /&gt;&lt;br /&gt;insert into wiki_categories values (6,'Astronomía',1);&lt;br /&gt;insert into wiki_categories values (7,'Biología',1);&lt;br /&gt;....&lt;br /&gt;insert into wiki_categories values (38,'Exploración espacial',5);&lt;br /&gt;insert into wiki_categories values (39,'Biotecnología',5);&lt;br /&gt;insert into wiki_categories values (40,'Informática',5);&lt;br /&gt;insert into wiki_categories values (41,'Ingeniería',5);&lt;br /&gt;insert into wiki_categories values (42,'Medicina',5);&lt;/blockquote&gt;So with these categories I can use lfacets() aggregated function as:&lt;br /&gt;&lt;blockquote&gt;select ljoin(lfacets('PAGES_LIDX_ALL,'||&lt;br /&gt;  case level when 1 then 'text:('|| cat_name||')'&lt;br /&gt;  ELSE 'text:('|| PRIOR cat_name||'),text:('|| cat_name||')'&lt;br /&gt;  END&lt;br /&gt;  )), cat_code,level&lt;br /&gt;  FROM wiki_categories&lt;br /&gt;  start with cat_parent is null&lt;br /&gt;  CONNECT BY PRIOR cat_code = cat_parent&lt;br /&gt;  group by cat_code,level;&lt;/blockquote&gt;or:&lt;br /&gt;&lt;blockquote&gt;select ljoin(lfacets('PAGES_LIDX_ALL,'||&lt;br /&gt;  case level when 1 then 'text:('|| cat_name||')'&lt;br /&gt;  ELSE 'text:('|| PRIOR cat_name||'),text:('|| cat_name||')'&lt;br /&gt;  END&lt;br /&gt;  )), cat_parent&lt;br /&gt;  FROM wiki_categories&lt;br /&gt;  start with cat_parent is null&lt;br /&gt;  CONNECT BY PRIOR cat_code = cat_parent&lt;br /&gt;  group by cat_parent;&lt;/blockquote&gt;getting a result for the second case as:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;text:(Ciencias naturales y formales),text:(Astronomía)(1280),text:(Ciencias naturales y formales),text:(Biología)(5144),text:(Ciencias naturales y formales),text:(Matemática)(4729),text:(Ciencias naturales y formales),text:(Física)(8708),text:(Ciencias naturales y formales),text:(Química)(4745),text:(Ciencias naturales y formales),text:(Botánica)(3697)&lt;br /&gt;&lt;br /&gt;text:(Ciencias humanas y sociales),text:(Comunicación)(7319),text:(Ciencias humanas y sociales),text:(Filosofía)(6393),text:(Ciencias humanas y sociales),text:(Sociología)(2004),text:(Ciencias humanas y sociales),text:(Religión)(6429),text:(Ciencias humanas y sociales),text:(Psicología)(2508),text:(Ciencias humanas y sociales),text:(Política)(27356),text:(Ciencias humanas y sociales),text:(Mitología)(2672),text:(Ciencias humanas y sociales),text:(Lingüística)(2611),text:(Ciencias humanas y sociales),text:(Mitología)(2672),text:(Ciencias humanas y sociales),text:(Historia)(35727),text:(Ciencias humanas y sociales),text:(Egiptología)(91),text:(Ciencias humanas y sociales),text:(Derecho)(18586),text:(Ciencias humanas y sociales),text:(Economía)(9755)&lt;br /&gt;&lt;br /&gt;text:(Artes),text:(Anime y manga)(1604),text:(Artes),text:(Arquitectura)(1981),text:(Artes),text:(Literatura)(2154),text:(Artes),text:(Teatro)(2818),text:(Artes),text:(Televisión)(1861),text:(Artes),text:(Pintura)(3323),text:(Artes),text:(Danza)(876),text:(Artes),text:(Música)(3643),text:(Artes),text:(Cine)(2235)&lt;br /&gt;text:(Sociedad),text:(Gastronomía)(443),text:(Sociedad),text:(Videojuegos)(360),text:(Sociedad),text:(LGBT)(267),text:(Sociedad),text:(Deporte)(3647)&lt;br /&gt;&lt;br /&gt;text:(Tecnologías),text:(Exploración espacial)(1375),text:(Tecnologías),text:(Biotecnología)(232),text:(Tecnologías),text:(Ingeniería)(1654),text:(Tecnologías),text:(Informática)(2017),text:(Tecnologías),text:(Medicina)(1085)&lt;br /&gt;&lt;br /&gt;text:(Ciencias naturales y formales)(62689),text:(Tecnologías)(13772),text:(Ciencias humanas y sociales)(80857),text:(Sociedad)(25372),text:(Artes)(14515)&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Note that I am using &lt;span style="font-weight: bold; font-style: italic;"&gt;ljoin&lt;/span&gt; function which converts &lt;span style="font-weight: bold; font-style: italic;"&gt;agg_tbl&lt;/span&gt; type (TABLE OF) to a coma separated string.&lt;br /&gt;The computation of the whole &lt;span style="font-style: italic;"&gt;WikiPedia&lt;/span&gt; dump, around 1 million of documents in my notebook took:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;INFO: key '96' main category 'text:(Ciencias naturales y formales)'&lt;br /&gt;INFO: sub category 'text:(Astronomía)'&lt;br /&gt;INFO: sub category 'text:(Biología)'&lt;br /&gt;INFO: sub category 'text:(Matemática)'&lt;br /&gt;INFO: sub category 'text:(Física)'&lt;br /&gt;INFO: sub category 'text:(Química)'&lt;br /&gt;INFO: sub category 'text:(Botánica)'&lt;br /&gt;INFO: Terminating category: 'text:(Ciencias naturales y formales)' Elapsed time: 58 millisecond.&lt;br /&gt;INFO: key '97' main category 'text:(Ciencias humanas y sociales)'&lt;br /&gt;INFO: sub category 'text:(Comunicación)'&lt;br /&gt;INFO: sub category 'text:(Filosofía)'&lt;br /&gt;INFO: sub category 'text:(Sociología)'&lt;br /&gt;INFO: sub category 'text:(Religión)'&lt;br /&gt;INFO: sub category 'text:(Psicología)'&lt;br /&gt;INFO: sub category 'text:(Política)'&lt;br /&gt;INFO: sub category 'text:(Mitología)'&lt;br /&gt;INFO: sub category 'text:(Lingüística)'&lt;br /&gt;INFO: sub category 'text:(Mitología)'&lt;br /&gt;INFO: sub category 'text:(Historia)'&lt;br /&gt;INFO: sub category 'text:(Egiptología)'&lt;br /&gt;INFO: sub category 'text:(Derecho)'&lt;br /&gt;INFO: sub category 'text:(Economía)'&lt;br /&gt;INFO: Terminating category: 'text:(Ciencias humanas y sociales)' Elapsed time: 115 millisecond.&lt;br /&gt;INFO: key '98' main category 'text:(Artes)'&lt;br /&gt;INFO: sub category 'text:(Anime y manga)'&lt;br /&gt;INFO: sub category 'text:(Arquitectura)'&lt;br /&gt;INFO: sub category 'text:(Literatura)'&lt;br /&gt;INFO: sub category 'text:(Teatro)'&lt;br /&gt;INFO: sub category 'text:(Televisión)'&lt;br /&gt;INFO: sub category 'text:(Pintura)'&lt;br /&gt;INFO: sub category 'text:(Danza)'&lt;br /&gt;INFO: sub category 'text:(Música)'&lt;br /&gt;INFO: sub category 'text:(Cine)'&lt;br /&gt;INFO: Terminating category: 'text:(Artes)' Elapsed time: 97 millisecond.&lt;br /&gt;INFO: key '99' main category 'text:(Sociedad)'&lt;br /&gt;INFO: sub category 'text:(Gastronomía)'&lt;br /&gt;INFO: sub category 'text:(Videojuegos)'&lt;br /&gt;INFO: sub category 'text:(LGBT)'&lt;br /&gt;INFO: sub category 'text:(Deporte)'&lt;br /&gt;INFO: Terminating category: 'text:(Sociedad)' Elapsed time: 18 millisecond.&lt;br /&gt;INFO: key '100' main category 'text:(Tecnologías)'&lt;br /&gt;INFO: sub category 'text:(Exploración espacial)'&lt;br /&gt;INFO: sub category 'text:(Biotecnología)'&lt;br /&gt;INFO: sub category 'text:(Ingeniería)'&lt;br /&gt;INFO: sub category 'text:(Informática)'&lt;br /&gt;INFO: sub category 'text:(Medicina)'&lt;br /&gt;INFO: Terminating category: 'text:(Tecnologías)' Elapsed time: 18 millisecond.&lt;br /&gt;INFO: key '101' main category '-ALL-'&lt;br /&gt;INFO: sub category 'text:(Ciencias naturales y formales)'&lt;br /&gt;INFO: sub category 'text:(Tecnologías)'&lt;br /&gt;INFO: sub category 'text:(Ciencias humanas y sociales)'&lt;br /&gt;INFO: sub category 'text:(Sociedad)'&lt;br /&gt;INFO: sub category 'text:(Artes)'&lt;br /&gt;INFO: Terminating category: '-ALL-' Elapsed time: 111 millisecond.&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-style: italic;"&gt;Not so bad&lt;/span&gt; considering that I am using a notebook and is not a server optimized for databases purpose. But Oracle have another good chance to speed up this query, a &lt;a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/schema.htm#CNCPT411"&gt;materialized view&lt;/a&gt;, let do that:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:100%;"&gt;CREATE MATERIALIZED VIEW wiki_facets&lt;br /&gt;PARALLEL&lt;br /&gt;BUILD IMMEDIATE&lt;br /&gt;REFRESH FORCE AS&lt;br /&gt;select ljoin(lfacets('PAGES_LIDX_ALL,'||&lt;br /&gt;  case level when 1 then 'text:('|| cat_name||')'&lt;br /&gt;  ELSE 'text:('|| PRIOR cat_name||'),text:('|| cat_name||')'&lt;br /&gt;  END&lt;br /&gt;  )), cat_parent&lt;br /&gt;  FROM wiki_categories&lt;br /&gt;  start with cat_parent is null&lt;br /&gt;  CONNECT BY PRIOR cat_code = cat_parent&lt;br /&gt;  group by cat_parent;&lt;/span&gt;&lt;/blockquote&gt;which obviously produce same result:&lt;br /&gt;&lt;blockquote&gt;SQL&gt; set timing on&lt;br /&gt;SQL&gt; select * from wiki_facets;&lt;br /&gt;... same output here ....&lt;br /&gt;Elapsed: 00:00:00.00&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;/blockquote&gt;but with &lt;span style="font-weight: bold; font-style: italic;"&gt;no efforts&lt;/span&gt;!!!&lt;br /&gt;You can refresh your materialized view at any point in time depend on your applications constraints.&lt;br /&gt;Under the hood an aggregated function call to the &lt;span style="font-weight: bold; font-style: italic;"&gt;ODCI API&lt;/span&gt; first to get the bit set (array of bits marked to 1, one for each document that match) of the first category, for example text:(Ciencias naturales y formales), then it will iterate over all his sub categories:&lt;br /&gt;text:(Astronomía)(1280),&lt;br /&gt;text:(Biología)(5144)&lt;br /&gt;text:(Matemática)(4729)&lt;br /&gt;text:(Física)(8708)&lt;br /&gt;text:(Química)(4745)&lt;br /&gt;text:(Botánica)(3697)&lt;br /&gt;but on each iteration the main category is already computed. Also for caching purposes the Lucene Filter created to get a bit set with the matching documents is stored in Lucene Domain Index memory structures to be re-used by &lt;span style="font-weight: bold; font-style: italic;"&gt;countHits&lt;/span&gt; function or &lt;span style="font-weight: bold; font-style: italic;"&gt;lcontains()&lt;/span&gt; operator.&lt;br /&gt;So if you execute a query like:&lt;br /&gt;&lt;blockquote&gt;select LuceneDomainIndex.countHits('&lt;span style="font-size:100%;"&gt;PAGES_LIDX_ALL&lt;/span&gt;','&lt;span style="font-size:85%;"&gt;text:(Astronomía)&lt;/span&gt;') from dual;&lt;/blockquote&gt;&lt;br /&gt;A Lucene Filter required to get the number of hits is already filled by&lt;span style="font-weight: bold; font-style: italic;"&gt; lfacets()&lt;/span&gt; function.&lt;br /&gt;I have updated&lt;a href="http://docs.google.com/Doc?id=ddgw7sjp_54fgj9kg"&gt; Lucene Domain Index documentation&lt;/a&gt; with latest functionality you can read on-line or download as PDF from SF.net web site, and remember that I'll talking about Java inside the database and some internal details of Oracle-Lucene integration next month at &lt;a href="http://www.cloug.org/Eventos.html"&gt;CLOUG 2009&lt;/a&gt;, see you there....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-2564921339018907902?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/2564921339018907902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/2564921339018907902'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2009/03/doing-facets-with-latest-lucene-domain.html' title='Doing facets with latest Lucene Domain Index 2.4.1.1.0'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ynfsOwQFaM0/ScztflDmfzI/AAAAAAAAALo/7Y3igKpaD9g/s72-c/facets.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-1892094263170735448</id><published>2009-03-23T14:53:00.000-07:00</published><updated>2009-03-23T14:59:38.615-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAAS'/><category scheme='http://www.blogger.com/atom/ns#' term='apex'/><category scheme='http://www.blogger.com/atom/ns#' term='VPD'/><category scheme='http://www.blogger.com/atom/ns#' term='proxy user'/><category scheme='http://www.blogger.com/atom/ns#' term='middle tier authentication'/><title type='text'>APEX proxy user support with DBPrism, aka middle tier authentication</title><content type='html'>FYI a post which I had started in October 2008, now is ready but it was stored in this &lt;a href="http://marceloochoa.blogspot.com/2008/10/apex-proxy-user-support-with-dbprism.html"&gt;link&lt;/a&gt;.&lt;br /&gt;Basically it covers a step by step guide to use APEX with proxy user support, aka middle tier authentication, very important if you want to use APEX with VPD database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-1892094263170735448?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/1892094263170735448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/1892094263170735448'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2009/03/apex-proxy-user-support-with-dbprism.html' title='APEX proxy user support with DBPrism, aka middle tier authentication'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-3713756389762025845</id><published>2009-03-09T10:44:00.000-07:00</published><updated>2009-03-09T11:09:29.820-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OJVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Domain Index'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene'/><category scheme='http://www.blogger.com/atom/ns#' term='binary distribution'/><title type='text'>New binary release of Lucene Domain Index for 10g-11g</title><content type='html'>Lucene Dev team just released a new production version (2.4.1) of the &lt;a href="http://lucene.apache.org/java/docs/index.html"&gt;Lucene IR library&lt;/a&gt;, it was not announce yet, but its available at &lt;a href="http://www.apache.org/dist/lucene/java/"&gt;Apache download area&lt;/a&gt;.&lt;br /&gt;So We released a new &lt;a href="https://sourceforge.net/project/showfiles.php?group_id=56183&amp;amp;package_id=255524&amp;amp;release_id=666920"&gt;binary distribution&lt;/a&gt; compiled and tested with this new release.&lt;br /&gt;There is only one change which fix an incompatibility issue between 10g and 11g database inside the pipeline table functions used for highlighting, the problem was related to how the internal JDBC driver return a column of SQL Date as object, 11g returns a&lt;span style="font-style: italic;"&gt; java.sql.Timestamp &lt;/span&gt;and 10g returns a &lt;span style="font-style: italic;"&gt;java.sql.Date&lt;/span&gt;. This affects the run-time behavior of the pipeline table functions which on the fly translates the Java Result Set to PLSQL execution layer.&lt;br /&gt;I have made some test with Lucene 2.9 code base, available through CVS, and Lucene Domain Index works fine a fastest than previous releases, as usual with any Lucene code release.&lt;br /&gt;This compilation can be done following the instruction of &lt;a href="http://docs.google.com/Doc?id=ddgw7sjp_54fgj9kg"&gt;Lucene Domain Index documentation&lt;/a&gt;, section 2.3 - &lt;span style="font-weight: bold; font-style: italic;"&gt;Install instruction for compiling from sources&lt;/span&gt;.&lt;br /&gt;Finally remember that Lucene Domain Index is an updated solution for Oracle applications written in any language, Phyton, Ruby, .Net, PHP, PLSQL,... ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-3713756389762025845?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/3713756389762025845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/3713756389762025845'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2009/03/new-binary-release-of-lucene-domain.html' title='New binary release of Lucene Domain Index for 10g-11g'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-198172717462775001</id><published>2009-03-04T02:20:00.000-08:00</published><updated>2009-03-05T03:49:56.324-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='highlighting'/><category scheme='http://www.blogger.com/atom/ns#' term='OJVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Domain Index'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene'/><title type='text'>Highlighting features with latest Lucene Domain Index 2.4.0.1.0 - Part II - pipeline table function</title><content type='html'>Some time highlighting functionality affects more than one column, so&lt;span style="font-style: italic;"&gt; &lt;a href="http://marceloochoa.blogspot.com/2009/03/hihghlighting-features-with-latest.html"&gt;lhighlight()&lt;/a&gt;&lt;/span&gt;&lt;a href="http://marceloochoa.blogspot.com/2009/03/hihghlighting-features-with-latest.html"&gt; operator&lt;/a&gt; is not enough.  I have plan to add more functionality to &lt;span style="font-style: italic;"&gt;lhighlight()&lt;/span&gt; in next release, for example, to support highlighting on other columns rather than the master column, this parameter will eliminate previous limitation but will require that columns to highlight should be stored into Lucene index structure.&lt;br /&gt;So, I decided to use &lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28425/pipe_paral_tbl.htm#i1007118"&gt;pipeline table functions&lt;/a&gt; &lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28425/pipelined_example.htm#CHDHDHEE"&gt;implemented in Java&lt;/a&gt;, another exciting functionality provided by &lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28425/toc.htm"&gt;ODCI API&lt;/a&gt;, but the problem is that the example and the documentation do not provides any hint on how to deal with transients types (&lt;span style="font-weight: bold;"&gt;AnyData&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;AnyDataSet&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;AnyType&lt;/span&gt;), &lt;span style="font-weight: bold;"&gt;AnyDataSet&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;AnyType&lt;/span&gt; allows you to create a function which returns any kind of queries, a required condition for a general purpose highlighting function.&lt;br /&gt;Digging the web, I found only one valuable example of pipeline table function working with &lt;span style="font-weight: bold;"&gt;AnyType&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;AnyDataSet&lt;/span&gt; in &lt;span style="font-weight: bold;"&gt;PLSQL&lt;/span&gt;, the article  from &lt;a href="http://www.oracle-developer.net/display.php?id=422"&gt;oracle-developer.net by Adrian Billington&lt;/a&gt; was a good jump-start for the solution.&lt;br /&gt;According to Oracle 11g &lt;span style="font-weight: bold;"&gt;JDBC&lt;/span&gt; documentation there is support for &lt;a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28279/chapter1.htm#FEATURENO07438"&gt;&lt;span style="font-weight: bold;"&gt;AnyData&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;AnyDataSet&lt;/span&gt; and &lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28279/chapter1.htm#FEATURENO07438"&gt;AnyType&lt;/a&gt; &lt;/span&gt;but are not allowed in Call Spec definition :( also this is only valid for 11g and I want to still supporting Lucene Domain Index for 10g databases.&lt;br /&gt;Finally the solution was to use a mix between &lt;span style="font-weight: bold;"&gt;PLSQL&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;Java&lt;/span&gt;. Developers who are interested to see how can do that could take look at the code on line, &lt;a href="http://dbprism.cvs.sourceforge.net/viewvc/dbprism/ojvm/db/CreatePipelineFunction.sql?revision=1.6&amp;amp;view=markup"&gt;CreatePipelineFunction.sql&lt;/a&gt;  and &lt;a href="http://dbprism.cvs.sourceforge.net/viewvc/dbprism/ojvm/src/java/org/apache/lucene/search/highlight/ojvm/Highlighter.java?revision=1.6&amp;amp;view=markup"&gt;Highlighter.java&lt;/a&gt;, the trick was to return from Java execution environment one row at time in object type having a place holder for each base SQL type, this type is &lt;a href="http://dbprism.cvs.sourceforge.net/viewvc/dbprism/ojvm/db/LuceneDomainIndexCommonTypes.sql?revision=1.3&amp;amp;view=markup"&gt;rt_fetch_attributes&lt;/a&gt; and a collection &lt;a href="http://dbprism.cvs.sourceforge.net/viewvc/dbprism/ojvm/db/LuceneDomainIndexCommonTypes.sql?revision=1.3&amp;amp;view=markup"&gt;RowInfo&lt;/a&gt;. If anyone have a better option please drop me an email or put a comment here!!.&lt;br /&gt;OK, after this in depth introduction lets see some example of using highlighting features by using pipeline table functions, there are two options:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Phighlight&lt;/span&gt;(index_name &lt;span style="font-weight: bold;"&gt;VARCHAR2&lt;/span&gt;, qry &lt;span style="font-weight: bold;"&gt;VARCHAR2&lt;/span&gt;, cols &lt;span style="font-weight: bold;"&gt;VARCHAR2&lt;/span&gt;, stmt &lt;span style="font-weight: bold;"&gt;IN&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;VARCHAR2&lt;/span&gt;) &lt;span style="font-weight: bold;"&gt;RETURN&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;ANYDATASET&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Rhighlight&lt;/span&gt;(index_name &lt;span style="font-weight: bold;"&gt;VARCHAR2&lt;/span&gt;, qry &lt;span style="font-weight: bold;"&gt;VARCHAR2&lt;/span&gt;, cols &lt;span style="font-weight: bold;"&gt;VARCHAR2&lt;/span&gt;, rType &lt;span style="font-weight: bold;"&gt;IN&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;VARCHAR2&lt;/span&gt;, rws &lt;span style="font-weight: bold;"&gt;IN SYS_REFCURSOR&lt;/span&gt;) &lt;span style="font-weight: bold;"&gt;RETURN&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;ANYDATASET&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-style: italic;"&gt;Phighlight()&lt;/span&gt; accepts a query source with the data to highlight as &lt;span style="font-weight: bold;"&gt;VARCHAR2&lt;/span&gt; to be prepared and executed by using &lt;span style="font-weight: bold;"&gt;DBMS_SQL&lt;/span&gt; package. &lt;span style="font-style: italic;"&gt;Rhighlight()&lt;/span&gt; accepts a &lt;span style="font-weight: bold;"&gt;SYS_REFCURSOR&lt;/span&gt; as argument but requires an extra argument to know which kind of result set type the query will return. For example:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;SELECT * FROM&lt;br /&gt;TABLE(&lt;span style="font-weight: bold; font-style: italic;"&gt;phighlight&lt;/span&gt;(&lt;br /&gt;      'EMAILBODYTEXT',&lt;br /&gt;      'lucene OR mysql',&lt;br /&gt;      'SUBJECT,BODYTEXT',&lt;br /&gt;      'select lscore(1) sc,e.* from eMails e&lt;br /&gt;      where lcontains(bodytext,''security OR mysql'',''subject:ASC'',1)&gt;0'&lt;br /&gt;  ));&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;EMAILBODYTEXT&lt;/span&gt; is a Lucene Domain Index defined for table &lt;span style="font-weight: bold;"&gt;eMails&lt;/span&gt; as:&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;create table &lt;span style="font-weight: bold;"&gt;eMails&lt;/span&gt; (&lt;br /&gt;emailFrom VARCHAR2(256),&lt;br /&gt;emailTo VARCHAR2(256),&lt;br /&gt;subject VARCHAR2(4000),&lt;br /&gt;emailDate DATE,&lt;br /&gt;bodyText CLOB)&lt;br /&gt;&lt;br /&gt;create index emailbodyText on &lt;span style="font-weight: bold;"&gt;eMails&lt;/span&gt;(bodyText)&lt;br /&gt;indextype is lucene.LuceneIndex&lt;br /&gt;parameters('Analyzer:org.apache.lucene.analysis.StopAnalyzer;&lt;br /&gt;ExtraCols:emailDate "emailDate",subject "subject",emailFrom "emailFrom",emailTo "emailTo"');&lt;/span&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;'lucene OR mysql'&lt;/span&gt; is Lucene Query used for highlighting, it should be equals to second argument of &lt;span style="font-style: italic;"&gt;lcontains()&lt;/span&gt; to be consistent, except for the Lucene Domain Index extension &lt;span style="font-weight: bold; font-style: italic;"&gt;rownum:[n TO m] AND&lt;/span&gt; used for pagination purpose.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;'SUBJECT,BODYTEXT'&lt;/span&gt; are a coma separated list of columns to be highlighted, any other columns of the query result will be passed as is. Note that I am using uppercase because I am not defining alias at the SQL query, also only columns returned by &lt;span style="font-weight: bold;"&gt;JDBC&lt;/span&gt; as type &lt;span style="font-weight: bold;"&gt;String&lt;/span&gt; or &lt;span style="font-weight: bold;"&gt;CLOB&lt;/span&gt; will be highlighted.&lt;br /&gt;Last argument of &lt;span style="font-style: italic;"&gt;phighlight()&lt;/span&gt; is any SQL query to be parsed by &lt;span style="font-weight: bold;"&gt;DBMS_SQL&lt;/span&gt; package, this query must return columns of JDBC types &lt;span style="font-weight: bold;"&gt;String&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;BigDecimal&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;Timestamp&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;CLOB&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;TIMESTAMP&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;TIMESTAMPTZ&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;TIMESTAMPLTZ&lt;/span&gt;. Remember to use double single quotes ('') for escaping the SQL quote (') inside this argument.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;SUBJECT&lt;/span&gt; column have results highlighted as "&lt;span style="font-style: italic;"&gt;Re: &amp;lt;B&amp;gt;lucene&amp;lt;/B&amp;gt; injection&lt;/span&gt;", ..., "&lt;span style="font-style: italic;"&gt;&amp;lt;B&amp;gt;lucene&amp;lt;/B&amp;gt; injection&lt;/span&gt;".&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;BODYTEXT &lt;/span&gt;column have values as "&lt;span style="font-style: italic;"&gt;On Dec 21, 2006, at 4:56 AM, Deepan wrote:&gt; I am bothered about security problems with &amp;lt;B&amp;gt;lucene&amp;lt;/B&amp;gt;. Is it vulnerable to&gt; any kind of injection like &amp;lt;B&amp;gt;mysql&amp;lt;/B&amp;gt; injection? many times the query from&gt; user is passed to &amp;lt;B&amp;gt;lucene&amp;lt;/B&amp;gt; for search without validating.Rest easy.  There are no known security issues with &amp;lt;B&amp;gt;Lucene&amp;lt;/B&amp;gt;, and ithas even undergone a recent static code analysis by Fortify (see thelucene-dev e-mail list&lt;/span&gt;",..,"&lt;span style="font-style: italic;"&gt;I am bothered about security problems with &amp;lt;B&amp;gt;lucene&amp;lt;/B&amp;gt;. Is it vulnerable to any kind of injection like &amp;lt;B&amp;gt;mysql&amp;lt;/B&amp;gt; injection? many times the query fromuser is passed to &amp;lt;B&amp;gt;lucene&amp;lt;/B&amp;gt; for search without validating.&lt;/span&gt;".&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;A variant of &lt;span style="font-style: italic;"&gt;phighlight()&lt;/span&gt; is &lt;span style="font-style: italic;"&gt;rhighlight()&lt;/span&gt; which, in my opinion, is better than the above because eliminate the risk of &lt;span style="font-weight: bold;"&gt;SQL&lt;/span&gt; Injection by passing an insecure &lt;span style="font-weight: bold;"&gt;SQL&lt;/span&gt; string, here an example:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;SELECT * FROM&lt;br /&gt;TABLE(&lt;span style="font-style: italic;"&gt;rhighlight&lt;/span&gt;(&lt;br /&gt;      'EMAILBODYTEXT',&lt;br /&gt;      'lucene OR mysql',&lt;br /&gt;      'SUBJECT,BODYTEXT',&lt;br /&gt;      'EMAILRSET',&lt;br /&gt;      CURSOR(select /*+ DOMAIN_INDEX_SORT FIRST_ROW */ lscore(1) sc,e.*&lt;br /&gt;      from eMails e where lcontains(bodytext,'security OR mysql','subject:ASC',1)&gt;0)&lt;br /&gt;  ));&lt;/span&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;'EMAILRSET'&lt;/span&gt; is collection of &lt;span style="font-weight: bold;"&gt;EMAILR&lt;/span&gt; type an object type defined to hold the result of the query passed as CURSOR(..). A SYS_REFCURSOR could be passed as argument from JDBC as .setObject(n,java.sql.ResultSet) method. This collection look like:&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;CREATE TYPE &lt;span style="font-weight: bold; font-style: italic;"&gt;EMAILR&lt;/span&gt; AS OBJECT&lt;br /&gt;(&lt;br /&gt; sc NUMBER,&lt;br /&gt; emailFrom VARCHAR2(256),&lt;br /&gt; emailTo VARCHAR2(256),&lt;br /&gt; subject VARCHAR2(4000),&lt;br /&gt; emailDate DATE,&lt;br /&gt; bodyText CLOB&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE TYPE &lt;span style="font-weight: bold;"&gt;EMAILRSET&lt;/span&gt; AS TABLE OF &lt;span style="font-weight: bold; font-style: italic;"&gt;EMAILR&lt;/span&gt;;&lt;/span&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;last argument uses &lt;span style="font-weight: bold;"&gt;CURSOR&lt;/span&gt; function to pass an &lt;span style="font-weight: bold;"&gt;SQL&lt;/span&gt; query as &lt;span style="font-weight: bold;"&gt;SYS_REFCURSOR&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;The result of above query is the same as the previous one, but its using named types instead of transients types.&lt;br /&gt;As you can see pipeline table functions are a powerful solution to do special treatment to queries. I mean some time you can not express all functionality in pure SQL or a functionality like highlighting can not be implemented in PLSQL, in that cases implementing pipeline table  functions in Java using Oracle OJVM is the only solution.&lt;br /&gt;At last, Lucene is close to get a next production release 2.4.1, my next post will be when this release is public and I'll upload a new version of Lucene Domain Index compiled a tested with it.&lt;br /&gt;Also Lucene Domain Index and many other tips using Java inside the Database will be explained in my planned presentation at &lt;a href="http://www.cloug.org/Eventos.html"&gt;CLOUG 2009&lt;/a&gt;, see you there...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-198172717462775001?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/198172717462775001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/198172717462775001'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2009/03/highlighting-features-with-latest.html' title='Highlighting features with latest Lucene Domain Index 2.4.0.1.0 - Part II - pipeline table function'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-9035970525501039991</id><published>2009-03-03T02:20:00.000-08:00</published><updated>2009-03-04T02:45:15.185-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='highlighting'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Data Cartridge API'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Domain Index'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle JVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene'/><title type='text'>Highlighting features with latest Lucene Domain Index 2.4.0.1.0 - Part I - lhighlight() ancillary operator</title><content type='html'>Once of the features more wanted of Lucene Domain Index was &lt;span style="font-weight: bold; font-style: italic;"&gt;highlighting. &lt;/span&gt;Highlighting features in Lucene core distributions is provided from a long time ago, but the question was how to integrate it easy in the SQL syntax.&lt;br /&gt;I decided to implement two kinds of highlighting in this &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=56183&amp;amp;package_id=255524&amp;amp;release_id=656144"&gt;release&lt;/a&gt; (&lt;a href="http://sourceforge.net/project/showfiles.php?group_id=56183&amp;amp;package_id=255524&amp;amp;release_id=656144"&gt;2.4.0.1.0&lt;/a&gt;), which is a maintenance release for Lucene 2.4.0 core.&lt;br /&gt;First is by using&lt;span style="font-weight: bold; font-style: italic;"&gt; lhighlight(NUMBER):VARCHAR2&lt;/span&gt; ancillary operator, ancillary operators are functions bounded to the current &lt;span style="font-style: italic; font-weight: bold;"&gt;lcontains()&lt;/span&gt; execution, these are connected with the correlation &lt;span style="font-weight: bold;"&gt;ID&lt;/span&gt;, the &lt;span style="font-weight: bold;"&gt;NUMBER&lt;/span&gt; argument of &lt;span style="font-weight: bold; font-style: italic;"&gt;lhighlight()&lt;/span&gt; and last argument of &lt;span style="font-weight: bold; font-style: italic;"&gt;lcontains()&lt;/span&gt;, for example:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;SQL&gt; SELECT /*+ DOMAIN_INDEX_SORT */ lhighlight(&lt;span style="font-weight: bold; font-style: italic;"&gt;1&lt;/span&gt;) txt,lscore(&lt;span style="font-weight: bold; font-style: italic;"&gt;1&lt;/span&gt;) sc,subject&lt;br /&gt;2  FROM emails where lcontains(bodytext,'security OR mysql','subject:ASC',&lt;span style="font-weight: bold; font-style: italic;"&gt;1&lt;/span&gt;)&gt;0;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;Above query will return rows with a VARCHAR2 value having the matching text in &lt;span style="font-weight: bold; font-style: italic;"&gt;bodytext&lt;/span&gt; column highlighted using a tag &amp;lt;B&amp;gt;security&amp;lt;/B&amp;gt;, the rest of the row will be the score and the subject of the email.&lt;br /&gt;There are two important points here, the piece of text highlighted is returned as &lt;span style="font-weight: bold;"&gt;VARCHAR2&lt;/span&gt;, it means his length will be less than 32K, this is not a big issue because usually the highlighted text is an small part of the whole text showed to users in order to provide more information for manually disambiguation. On the other hand ancillary operators receives from the RDBMS engine the text to highlight, not all SQL types are supported, current implementation is built for VARCHAR2, CLOB amd XMLType columns.&lt;br /&gt;Unlike Lucene highlighting implementations columns to be highlighted are not stored in Lucene index structure, this is because the RDBMS engine automatically loads and transfers the content to highlight to the ancillary operator implementation.&lt;br /&gt;The limitation of &lt;span style="font-weight: bold; font-style: italic;"&gt;lhighlight()&lt;/span&gt; function is that it can only works with the master column of the index and Lucene Domain Index can index multiple columns at once, for example for an index created with the &lt;a href="http://marceloochoa.blogspot.com/2007/12/uploading-wikipedia-dumps-to-oracle.html"&gt;WikiPedia Spanish dump&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;create index pages_lidx_all on pages p (value(p))&lt;br /&gt;indextype is Lucene.LuceneIndex&lt;br /&gt;parameters('PopulateIndex:false;DefaultColumn:text;SyncMode:Deferred;LogLevel:INFO;&lt;br /&gt;Analyzer:org.apache.lucene.analysis.SpanishWikipediaAnalyzer;&lt;br /&gt;ExtraCols:extractValue(object_value,''/page/title'') "title",&lt;br /&gt;extractValue(object_value,''/page/revision/comment'') "comment",&lt;br /&gt;extract(object_value,''/page/revision/text/text()'') "text",&lt;br /&gt;extractValue(object_value,''/page/revision/timestamp'') "revisionDate";&lt;br /&gt;FormatCols:revisionDate(day);&lt;span style="font-weight: bold; font-style: italic;"&gt;IncludeMasterColumn:false&lt;/span&gt;;&lt;br /&gt;LobStorageParameters:PCTVERSION 0 ENABLE STORAGE IN ROW CHUNK 32768 CACHE READS FILESYSTEM_LIKE_LOGGING');&lt;/span&gt;&lt;/blockquote&gt;In the above index definition the master column is not indexed as is, only the virtual columns &lt;span style="font-weight: bold;"&gt;title&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;comment&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;text&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;revisionDate&lt;/span&gt; are indexed, but highlighting features still evaluated with the whole row info which is of type &lt;span style="font-weight: bold;"&gt;XMLType&lt;/span&gt;, so an example query will look like:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;SQL&gt; select /*+ DOMAIN_INDEX_SORT */ lhighlight(1),&lt;span style="font-style: italic;"&gt;extractValue(object_value,'/page/title')&lt;/span&gt; from pages where lcontains(object_value,'rownum:[1 TO 10] AND (musica tango rock)',1)&gt;0;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;page xmlns="http://www.mediawiki.org/xml/export-0.3/" &amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;  &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;title&amp;gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;B&amp;gt;Música&amp;lt;/B&amp;gt; de Argentina... [[Latinoamérica|latinoamericanos]] con más desarrollo en su [[&amp;lt;B&amp;gt;música&amp;lt;/B&amp;gt;]].&lt;br /&gt;&lt;br /&gt;Se encuentra una gran... argentinos, un instrumento tradicional andino]]&lt;br /&gt;Aún se mantiene la &amp;lt;B&amp;gt;música&amp;lt;/B&amp;gt; de los [[Indígenas_en_Argentina... de grandes corrientes de [[inmigración|inmigrantes]] europeos, la &amp;lt;B&amp;gt;música&amp;lt;/B&amp;gt; argentina se enriqueció&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Música de Argentina&lt;/span&gt;&lt;br /&gt;musical emparentado con la [[habanera]] y el [[&amp;lt;B&amp;gt;tango&amp;lt;/B&amp;gt; (&amp;lt;B&amp;gt;música&amp;lt;/B&amp;gt;)|&amp;lt;B&amp;gt;tango&amp;lt;/B&amp;gt;]].&lt;br /&gt;&lt;br /&gt;==Diferencias con el &amp;lt;B&amp;gt;tango&amp;lt;/B&amp;gt;==&lt;br /&gt;&lt;br /&gt;Aunque tanto la milonga como el &amp;lt;B&amp;gt;tango&amp;lt;/B&amp;gt; están en [[compás]] de 2/4, las 8 [[semicorchea]]s de la milonga están distribuidas en 3 + 3 + 2 en cambio el &amp;lt;B&amp;gt;tango&amp;lt;/B&amp;gt; posee un ritmo más «cuadrado». Las letras...]] criticó en algún momento el &amp;lt;B&amp;gt;tango&amp;lt;/B&amp;gt; y prefirió la milonga, que no trasmite la melancolía&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Milonga (género musical)&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;Text in &lt;span style="font-style: italic;"&gt;italic&lt;/span&gt; are only remarked to see the differences between the highlighted text and column title which is part of result.&lt;br /&gt;On next post I'll talk about highlighting features using &lt;span style="font-weight: bold; font-style: italic;"&gt;pipeline table functions&lt;/span&gt; implemented in Java, a big deal because there is not too much information and no native support for ANYDataSet results, stay tuned.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-9035970525501039991?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/9035970525501039991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/9035970525501039991'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2009/03/hihghlighting-features-with-latest.html' title='Highlighting features with latest Lucene Domain Index 2.4.0.1.0 - Part I - lhighlight() ancillary operator'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-4416110983798286729</id><published>2008-11-10T02:58:00.000-08:00</published><updated>2008-11-10T05:40:34.237-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dbprism'/><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><category scheme='http://www.blogger.com/atom/ns#' term='apex'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Web Logic'/><title type='text'>Using APEX into Oracle WebLogic Server 10.3</title><content type='html'>This post is about how to use APEX applications running inside &lt;a href="http://www.oracle.com/technology/software/products/ias/index.html"&gt;Oracle WebLogic Server 10.3&lt;/a&gt;&lt;br /&gt;I am not an Web Logic specialist so with a little help from &lt;a href="http://www.oracle.com/technology/software/products/jdev/htdocs/soft11.html"&gt;Oracle JDeveloper 11g&lt;/a&gt; I can deploy latest &lt;a href="http://www.dbprism.com.ar/live/setLang.html?locale=en-us&amp;amp;redirectUrl=/index.html"&gt;DBPrism Servlet Engine&lt;/a&gt; to run &lt;a href="http://www.oracle.com/technology/products/database/application_express/download.html"&gt;APEX&lt;/a&gt; applications like the Apache mod_plsql embedded gateway.&lt;br /&gt;The easy way to deploy APEX applications is using a WAR file download from SourceForge.net web site.&lt;br /&gt;1.- Download latest &lt;a href="http://prdownloads.sourceforge.net/dbprism/dpls-2.1.2.1-production.war?download"&gt;DBPrism dpls WAR&lt;/a&gt; and rename as &lt;span style="font-weight: bold; font-style: italic;"&gt;dpls.war&lt;/span&gt;.&lt;br /&gt;2.- Create JDeveloper project from a WAR file, remember start JDeveloper with a J2EE role. Following screenshots shows the step by step guide.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ynfsOwQFaM0/SRggObQ0u9I/AAAAAAAAAKQ/_hsQhaa1eeE/s1600-h/dpls-deploy-4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 124px; height: 200px;" src="http://4.bp.blogspot.com/_ynfsOwQFaM0/SRggObQ0u9I/AAAAAAAAAKQ/_hsQhaa1eeE/s200/dpls-deploy-4.png" alt="" id="BLOGGER_PHOTO_ID_5266995196418374610" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ynfsOwQFaM0/SRggbxrT_8I/AAAAAAAAAKY/s1otV7MvwEE/s1600-h/dpls-deploy-5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 143px;" src="http://1.bp.blogspot.com/_ynfsOwQFaM0/SRggbxrT_8I/AAAAAAAAAKY/s1otV7MvwEE/s200/dpls-deploy-5.png" alt="" id="BLOGGER_PHOTO_ID_5266995425773354946" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ynfsOwQFaM0/SRggy3uyj-I/AAAAAAAAAKg/SltIctrkprE/s1600-h/dpls-deploy-6.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 150px;" src="http://4.bp.blogspot.com/_ynfsOwQFaM0/SRggy3uyj-I/AAAAAAAAAKg/SltIctrkprE/s200/dpls-deploy-6.png" alt="" id="BLOGGER_PHOTO_ID_5266995822535544802" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ynfsOwQFaM0/SRghCf_AetI/AAAAAAAAAKo/2Gfe8NMsNJs/s1600-h/dpls-deploy-7.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 150px;" src="http://4.bp.blogspot.com/_ynfsOwQFaM0/SRghCf_AetI/AAAAAAAAAKo/2Gfe8NMsNJs/s200/dpls-deploy-7.png" alt="" id="BLOGGER_PHOTO_ID_5266996091039021778" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ynfsOwQFaM0/SRghTQp6I6I/AAAAAAAAAKw/u-bpMFTXGJE/s1600-h/dpls-deploy-8.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 150px;" src="http://2.bp.blogspot.com/_ynfsOwQFaM0/SRghTQp6I6I/AAAAAAAAAKw/u-bpMFTXGJE/s200/dpls-deploy-8.png" alt="" id="BLOGGER_PHOTO_ID_5266996378981770146" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ynfsOwQFaM0/SRghn3auy6I/AAAAAAAAAK4/miUADif7cIg/s1600-h/dpls-deploy-9.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 150px;" src="http://4.bp.blogspot.com/_ynfsOwQFaM0/SRghn3auy6I/AAAAAAAAAK4/miUADif7cIg/s200/dpls-deploy-9.png" alt="" id="BLOGGER_PHOTO_ID_5266996732984478626" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ynfsOwQFaM0/SRgiXbkpiCI/AAAAAAAAALA/m_vuklq7Xxs/s1600-h/dpls-deploy-10.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 136px; height: 200px;" src="http://1.bp.blogspot.com/_ynfsOwQFaM0/SRgiXbkpiCI/AAAAAAAAALA/m_vuklq7Xxs/s200/dpls-deploy-10.png" alt="" id="BLOGGER_PHOTO_ID_5266997550143604770" border="0" /&gt;&lt;/a&gt;3.- &lt;a href="http://www.oracle.com/technology/products/database/application_express/download.html"&gt;Download&lt;/a&gt; and &lt;a href="http://download.oracle.com/docs/cd/E10513_01/doc/install.310/e10496/toc.htm"&gt;install&lt;/a&gt; APEX if your target database do not have APEX installed. Remember:&lt;br /&gt;&lt;blockquote&gt;3.a &lt;a href="http://download.oracle.com/docs/cd/E10513_01/doc/install.310/e10496/db_install.htm#CIHBHAFJ"&gt;Change the Password for the ADMIN Account&lt;/a&gt;&lt;br /&gt;3.b &lt;a href="http://download.oracle.com/docs/cd/E10513_01/doc/install.310/e10496/db_install.htm#CIHHCJCD"&gt;Unlock the APEX_PUBLIC_USER Database User&lt;/a&gt;&lt;br /&gt;3.c &lt;a href="http://download.oracle.com/docs/cd/E10513_01/doc/install.310/e10496/db_install.htm#CIHEEEAE"&gt;Change the Password for the APEX_PUBLIC_USER Database User&lt;/a&gt;&lt;br /&gt;&lt;/blockquote&gt;4.- Edit prism.xconf file to define your target database, prism.xconf file is under &lt;span style="font-weight: bold; font-style: italic;"&gt;[Web Content]/WEB-INF&lt;/span&gt; project directory, change properties.&lt;br /&gt;&lt;blockquote&gt;4.a &lt;span style="font-style: italic; font-weight: bold;"&gt;demo.db &lt;/span&gt;with your JDBC thin or OCI connect string&lt;br /&gt;4.b &lt;span style="font-weight: bold;"&gt;DAD_apex&lt;/span&gt; &lt;span style="font-weight: bold; font-style: italic;"&gt;dbpassword&lt;/span&gt; with the value defined in 3.c&lt;/blockquote&gt;&lt;br /&gt;5.- Create a WAR file with APEX's static resources following:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;[mochoa@mochoa ~]$ cd /usr/local/apex/images/&lt;br /&gt;[mochoa@mochoa images]$ zip -r /home/mochoa/jdevhome/mywork/cms-2.1-applib/i.zip .&lt;br /&gt;.....&lt;br /&gt; adding: jump.gif (deflated 21%)&lt;br /&gt; adding: wwv_edit2_old.gif (deflated 86%)&lt;br /&gt;[mochoa@mochoa images]$ mv /home/mochoa/jdevhome/mywork/cms-2.1-applib/i.zip /home/mochoa/jdevhome/mywork/cms-2.1-applib/i.war&lt;/span&gt;&lt;/blockquote&gt;6.- Create a JDeveloper project named &lt;span style="font-weight: bold; font-style: italic;"&gt;APEX-static&lt;/span&gt; following the steps of section 2 but using &lt;span style="font-weight: bold; font-style: italic;"&gt;i.war&lt;/span&gt; file created in the step 5. This project will look like:&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ynfsOwQFaM0/SRgr5x3yg-I/AAAAAAAAALI/d_44ZoCsFWU/s1600-h/dpls-deploy-11.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 142px;" src="http://4.bp.blogspot.com/_ynfsOwQFaM0/SRgr5x3yg-I/AAAAAAAAALI/d_44ZoCsFWU/s200/dpls-deploy-11.png" alt="" id="BLOGGER_PHOTO_ID_5267008035849667554" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;6.a Edit &lt;span style="font-weight: bold; font-style: italic;"&gt;web.xml&lt;/span&gt; file of APEX-static project removing Faces Servlet entries. This file is located at &lt;span style="font-weight: bold; font-style: italic;"&gt;[Web Content]/WEB-INF&lt;/span&gt; project directory.&lt;br /&gt;6.b Remove all libraries dependency defined in this project due it only contains static resources, righ click on the project node and choose &lt;span style="font-weight: bold; font-style: italic;"&gt;Project properties-&gt;Libraries and Classpath&lt;/span&gt;, the list must be empty.&lt;br /&gt;&lt;/blockquote&gt;7.- Start Oracle Web Logic 10.3 embedded web server using JDeveloper menu &lt;span style="font-weight: bold; font-style: italic;"&gt;Run&lt;/span&gt; -&gt; &lt;span style="font-weight: bold; font-style: italic;"&gt;Start Server Instance&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;, console log will show something like:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;/home/mochoa/.jdeveloper/system11.1.1.0.31.51.56/DefaultDomain/bin/startWebLogic.sh&lt;br /&gt;[waiting for the server to complete its initialization...]&lt;br /&gt;.&lt;br /&gt;&lt;nov&gt; &lt;notice&gt; &lt;weblogicserver&gt; &lt;bea-000360&gt; &lt;server&gt;&lt;br /&gt;DefaultServer startup time: 39999 ms.&lt;br /&gt;DefaultServer started.&lt;/span&gt;&lt;/blockquote&gt;8.- Deploy APEX-static project, right click on the project node and choose option &lt;span style="font-weight: bold; font-style: italic;"&gt;Deploy-&gt;i-&gt;to-&gt;IntegratedWLSConnection&lt;/span&gt;. The log window will show something like:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;----  Deployment started.  ----    Nov 10, 2008 10:54:59 AM&lt;br /&gt;Target platform is  (Weblogic 10.3).&lt;br /&gt;Running dependency analysis...&lt;br /&gt;Building...&lt;br /&gt;2008-11-10 10:55:03.712: Writing WAR file to /home/mochoa/jdeveloper/mywork/DBPrism/APEX-static/deploy/i.war&lt;br /&gt;2008-11-10 10:55:08.837: Wrote WAR file to /home/mochoa/jdeveloper/mywork/DBPrism/APEX-static/deploy/i.war&lt;br /&gt;Redeploying Application...&lt;br /&gt;Application Redeployed Successfully.&lt;br /&gt;Elapsed time for deployment:  22 seconds&lt;br /&gt;----  Deployment finished.  ----    Nov 10, 2008 10:55:20 AM&lt;/span&gt;&lt;/blockquote&gt;You can test i.war deployment with this URL &lt;span style="font-style: italic;"&gt;http://localhost:7101/i/htmldb/apex_logo.gif&lt;/span&gt; an Oracle Application Express logo is shown.&lt;br /&gt;9.- Deploy APEX-dpls project, rigth click on the project node and choose &lt;span style="font-weight: bold; font-style: italic;"&gt;Deploy-dpls-to-IntegratedWLSConnection&lt;/span&gt;, console log will show something like:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;----  Deployment started.  ----    Nov 10, 2008 10:59:29 AM&lt;br /&gt;Target platform is  (Weblogic 10.3).&lt;br /&gt;Running dependency analysis...&lt;br /&gt;Building...&lt;br /&gt;2008-11-10 10:59:40.775: Writing WAR file to /home/mochoa/jdeveloper/mywork/DBPrism/APEX-dpls/deploy/dpls.war&lt;br /&gt;2008-11-10 10:59:40.917: Wrote WAR file to /home/mochoa/jdeveloper/mywork/DBPrism/APEX-dpls/deploy/dpls.war&lt;br /&gt;Redeploying Application...&lt;br /&gt;Application Redeployed Successfully.&lt;br /&gt;Elapsed time for deployment:  56 seconds&lt;br /&gt;----  Deployment finished.  ----    Nov 10, 2008 11:00:25 AM&lt;/span&gt;&lt;/blockquote&gt;You can test dpls.war deployment with this URL &lt;span style="font-style: italic;"&gt;http://localhost:7101/dpls/&lt;/span&gt; a &lt;span style="font-weight: bold;"&gt;DBPrism&lt;/span&gt; project welcome page is shown.&lt;br /&gt;10.- Start your Oracle database if is not already done.&lt;br /&gt;11.- Log into APEX admin page using the link &lt;span style="font-style: italic;"&gt;http://localhost:7101/dpls/apex/apex_admin&lt;/span&gt; using &lt;span style="font-weight: bold;"&gt;ADMIN&lt;/span&gt; password defined into the step 3.a&lt;br /&gt;&lt;br /&gt;Finally I want to remark that &lt;span style="font-weight: bold; font-style: italic;"&gt;APEX-WebLogic&lt;/span&gt; integration implemented with &lt;span style="font-weight: bold; font-style: italic;"&gt;DBPrism mod_plsql&lt;/span&gt; emulation has some benefits from a traditional &lt;a href="http://download.oracle.com/docs/cd/E10513_01/doc/install.310/e10496/db_install.htm#CIHBHCDE"&gt;mod_plsql&lt;/a&gt; or &lt;a href="http://christopherbeck.wordpress.com/2008/09/15/weblogic-server-and-apex/"&gt;mod_proxy&lt;/a&gt; deployment:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You can integrate to other J2EE development trough JSP forward or include tags, which means that you can create a J2EE application mixing traditional JSP/ADF Faces components with some parts implemented in APEX integrated through &lt;span style="font-style: italic;"&gt;taglibs&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;You have a lot of logging using Apache Log4J, logging information can be customized with the file &lt;span style="font-style: italic; font-weight: bold;"&gt;log4j.properties&lt;/span&gt; located into &lt;span style="font-weight: bold; font-style: italic;"&gt;APEX-dpls&lt;/span&gt; project, &lt;span style="font-weight: bold; font-style: italic;"&gt;[Application Sources]&lt;/span&gt; project directory.&lt;/li&gt;&lt;li&gt;You can use Oracle Proxy user support into APEX application, I will write a post ASAP with changes into &lt;span style="font-weight: bold; font-style: italic;"&gt;APEX-dpls&lt;/span&gt; project to enable &lt;span style="font-weight: bold; font-style: italic;"&gt;JAAS&lt;/span&gt; authentication integration into APEX.&lt;/li&gt;&lt;/ul&gt;Enjoy APEX inside your Oracle WLS, Marcelo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-4416110983798286729?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/4416110983798286729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/4416110983798286729'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2008/11/using-apex-into-oracle-weblogic-server.html' title='Using APEX into Oracle WebLogic Server 10.3'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ynfsOwQFaM0/SRggObQ0u9I/AAAAAAAAAKQ/_hsQhaa1eeE/s72-c/dpls-deploy-4.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-1767131911010879806</id><published>2008-10-10T13:28:00.000-07:00</published><updated>2008-10-10T13:47:03.133-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OJVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Data Cartridge API'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Domain Index'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene'/><title type='text'>New binary release of Lucene Oracle Data Cartridge using Lucene 2.4.0</title><content type='html'>A new binary release of Oracle Lucene Integration project is ready for &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=56183&amp;amp;package_id=255524&amp;amp;release_id=632228"&gt;downloading&lt;/a&gt; at SourceForge.net.&lt;br /&gt;This release is tested with 10g and 11g databases on Linux, user must choose which release download according to the target database.&lt;br /&gt;Thanks to Lucene developer group to release a new version faster than the others, obviously this new release of Lucene Data Cartridge for Oracle databases gets better results with the inclusion of latest binary components.&lt;br /&gt;From my side this is a list of latest additions:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Added parameter for CLOB enconding&lt;/li&gt;&lt;li&gt;More Like this function&lt;/li&gt;&lt;li&gt;NGram analyzer&lt;/li&gt;&lt;li&gt;EnglishWikipediaAnalyzer&lt;/li&gt;&lt;li&gt;DataStore interface include API for setting current connection&lt;/li&gt;&lt;li&gt;Now analyzers, queries, snowball and wikipedia contrib packages are required&lt;/li&gt;&lt;/ul&gt;Remember that the full documentation of the projects is at &lt;a href="http://docs.google.com/Doc?id=ddgw7sjp_54fgj9kg"&gt;Google Docs&lt;/a&gt;.&lt;br /&gt;Also there is an On Line version of my presentation at the Oracle Open World 08 as &lt;a href="http://docs.google.com/Presentation?id=ddgw7sjp_156gf9hczxv"&gt;Google Presenter&lt;/a&gt;.&lt;br /&gt;This presentation is focused on the benefits of indexing inside the Database to get better performance by reducing network traffic and better solution for real time search engine applications by using a native/integrated solution with RDBMS engine.&lt;br /&gt;Cheers, Marcelo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-1767131911010879806?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/1767131911010879806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/1767131911010879806'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2008/10/new-binary-release-of-lucene-oracle.html' title='New binary release of Lucene Oracle Data Cartridge using Lucene 2.4.0'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-2009765566868235236</id><published>2008-10-09T05:03:00.000-07:00</published><updated>2008-10-09T05:35:02.345-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><category scheme='http://www.blogger.com/atom/ns#' term='XMLDB'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='dbprism'/><category scheme='http://www.blogger.com/atom/ns#' term='xsl'/><category scheme='http://www.blogger.com/atom/ns#' term='stored procedure'/><category scheme='http://www.blogger.com/atom/ns#' term='cocoon'/><category scheme='http://www.blogger.com/atom/ns#' term='wcms'/><title type='text'>New DBPrism CMS released</title><content type='html'>Here a new release of &lt;a href="http://www.dbprism.com.ar/live/setLang.html?locale=en-us&amp;amp;redirectUrl=/j2-CMS/index.html"&gt;DBPrism CMS&lt;/a&gt;!!!&lt;br /&gt;After more than a year of usage of 2.1.1 without any bug reported this new release have a &lt;a href="http://www.dbprism.com.ar/live/setLang.html?locale=en-us&amp;amp;redirectUrl=/j3-Download/j2-cms.html"&gt;lot of new functionality&lt;/a&gt; implemented by our staff.&lt;br /&gt;AFAIK DBPrism CMS is the only WCMS (Web Content Management System) which stores content's authors XML information inside the &lt;a href="http://www.oracle.com/technology/tech/xml/xmldb/index.html"&gt;XMLDB repository&lt;/a&gt;.&lt;br /&gt;Also is based on &lt;a href="http://www.dbprism.com.ar/index.html"&gt;DBPrism Servlet Engine&lt;/a&gt; implementation and like &lt;a href="http://www.oracle.com/technology/apex/index.html"&gt;Oracle APEX&lt;/a&gt;, it implements his functionality as Java Stored Procedure, but leaving the presentation concerns into the middle tier layer by using &lt;a href="http://cocoon.apache.org/"&gt;Cocoon Presentation Framework&lt;/a&gt;.&lt;br /&gt;This architecture's design provides to web master/developer the functionality of a complete Web server re-design only by modifying a few XSL style sheets and CSS pages, once the changes are committed the complete web site is updated on the next click.&lt;br /&gt;Also by using Apache &lt;a href="http://forrest.apache.org/dtdx/document-v20.dtdx.html"&gt;document-v20.xsd&lt;/a&gt; document structure, the web site can be targeted to mobile devices, PDF or any other output format only by adding new XSL transformations.&lt;br /&gt;&lt;a href="http://www.dbprism.com.ar/j3-Download/"&gt;Try it for free is Open Source&lt;/a&gt; ;)&lt;br /&gt;Marcelo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-2009765566868235236?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/2009765566868235236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/2009765566868235236'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2008/10/new-dbprism-cms-released.html' title='New DBPrism CMS released'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-1640399384064997126</id><published>2008-10-03T12:01:00.000-07:00</published><updated>2009-03-23T14:48:23.236-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DAD'/><category scheme='http://www.blogger.com/atom/ns#' term='JAAS'/><category scheme='http://www.blogger.com/atom/ns#' term='apex'/><category scheme='http://www.blogger.com/atom/ns#' term='VPD'/><category scheme='http://www.blogger.com/atom/ns#' term='proxy user'/><category scheme='http://www.blogger.com/atom/ns#' term='middle tier authentication'/><title type='text'>APEX proxy user support with DBPrism, aka middle tier authentication</title><content type='html'>Here a simple quick list to get Apex using proxy user support with  DBPrism standard distribution which by default includes Jetty web server.&lt;br /&gt;The guide can be useful for other J2EE servlet container such as OC4J or &lt;a href="http://marceloochoa.blogspot.com/2008/11/using-apex-into-oracle-weblogic-server.html"&gt;WebLogic&lt;/a&gt; which can re-use Jetty WAR/EAR configuration to deploy Apex applications.&lt;br /&gt;First Download and Install latest Apex distribution, if you don't have it already installed.&lt;br /&gt;Download from:&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/products/database/application_express/download.html"&gt;&lt;/a&gt;&lt;blockquote&gt;&lt;a href="http://www.oracle.com/technology/products/database/application_express/download.html"&gt;http://www.oracle.com/technology/products/database/application_express/download.html&lt;/a&gt;&lt;/blockquote&gt;&lt;br /&gt;In my test using Oracle 11g standard edition One, I have unzipped it into /usr/local directory and executed&lt;br /&gt;&lt;blockquote&gt;sqlplus "sys/syspass as sysdba" @apexins SYSAUX SYSAUX TEMP /i/&lt;/blockquote&gt;Requirements to run DBPrism and Jetty&lt;br /&gt;&lt;ul&gt;&lt;li&gt;JDK 1.5+&lt;/li&gt;&lt;li&gt;Ant 1.7.0+&lt;/li&gt;&lt;li&gt;&lt;a href="http://sourceforge.net/project/showfiles.php?group_id=56183&amp;amp;package_id=51348&amp;amp;release_id=638632"&gt;DBPrism 2.1.2.1+&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://sourceforge.net/project/showfiles.php?group_id=56183&amp;amp;package_id=74007&amp;amp;release_id=631528"&gt;DBPrism CMS 2.1.2+ appli&lt;/a&gt;b (it includes Jetty)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Compress as Jar archive all images and static Apex's resources.&lt;br /&gt;&lt;blockquote&gt;-bash-3.2$ cd /usr/local/apex/images&lt;br /&gt;-bash-3.2$ jar cvf /tmp/i.jar *&lt;br /&gt;added manifest                                                                                                                                                       &lt;br /&gt;adding: 16admin.gif(in = 130) (out= 133)(deflated -2%)                                                                                                               &lt;br /&gt;adding: 1pixelbeige.gif(in = 43) (out= 38)(deflated 11%)&lt;br /&gt;....&lt;br /&gt;-bash-3.2$ cp/tmp/ i.jar /home/mochoa/jdevhome/mywork/cms-2.1-applib/&lt;span style="font-weight: bold; font-style: italic;"&gt;i.war&lt;/span&gt;&lt;/blockquote&gt;Edit Apache Ant &lt;span style="font-weight: bold; font-style: italic;"&gt;build.xml&lt;/span&gt; file into DBPrism distribution and un-comment the step which un-compress above file after the WAR is deployed, &lt;span style="font-weight: bold; font-style: italic;"&gt;build.xml&lt;/span&gt; file look like:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;target name="jetty-deploy" description="Deploy Jetty files on tmp"&gt;&lt;br /&gt;....&lt;br /&gt;&amp;lt;unzip src="${EXTRA_LIB_DIR}/i.war" dest="${tmp}/webapps/${project.web}/i"/&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Edit &lt;span style="font-weight: bold; font-style: italic;"&gt;common.xml&lt;/span&gt; file with your target database, specially properties:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;property name="database" value="test"/&gt;&lt;br /&gt;&amp;lt;property name="thin_string" value="localhost:1521:test"/&gt;&lt;br /&gt;&amp;lt;property name="jdbc_string" value="jdbc:oracle:thin:@${thin_string}"/&gt;&lt;br /&gt;&amp;lt;property name="apex_pass" value="apex_pass" value="apex"/&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Unlock database user &lt;span style="font-style: italic;"&gt;apex_public_user&lt;/span&gt;:&lt;br /&gt;&lt;blockquote&gt;SQL&gt; alter user apex_public_user identified by &lt;span style="font-weight: bold; font-style: italic;"&gt;apex&lt;/span&gt; account unlock; &lt;/blockquote&gt;&lt;br /&gt;Edit a user who want to connect with proxy user support, for example &lt;span style="font-style: italic;"&gt;SCOTT&lt;/span&gt;:&lt;br /&gt;&lt;blockquote&gt;SQL&gt; alter user scott grant connect through apex_public_user; &lt;/blockquote&gt;&lt;br /&gt;Edit &lt;span style="font-weight: bold; font-style: italic;"&gt;$PRISM_HOME/conf/prism.xconf&lt;/span&gt; file and activate proxy user support for apex DAD:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;caetgory name="DAD_apex"/&gt;&lt;br /&gt;&amp;lt;property name="dbusername" value="apex_public_user"/&gt;&lt;br /&gt;&amp;lt;property name="dbpassword" value="@APEX_PASS@"/&gt;&lt;br /&gt;&amp;lt;property name="connectString" value="${demo.db}"/&gt;&lt;br /&gt;&amp;lt;property name="useProxyUser" value="true"/&gt;&lt;br /&gt;....&lt;br /&gt;&amp;lt;/category&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Another important point is that &lt;span style="font-weight: bold; font-style: italic;"&gt;build.xml&lt;/span&gt; and &lt;span style="font-weight: bold; font-style: italic;"&gt;common.xml&lt;/span&gt; files relies on &lt;span style="font-weight: bold; font-style: italic;"&gt;JAVA_HOME&lt;/span&gt; and &lt;span style="font-weight: bold; font-style: italic;"&gt;ORACLE_HOME&lt;/span&gt; environments variables, please check them before start Ant.&lt;br /&gt;Edit &lt;span style="font-weight: bold; font-style: italic;"&gt;$PRISM_HOME/conf/demoRealm.properties&lt;/span&gt; activating &lt;span style="font-style: italic;"&gt;scott&lt;/span&gt; to be validated by middle tier authentication:&lt;br /&gt;&lt;blockquote&gt;apex_demo: apex_demo,apex_users&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;scott: tiger,apex_users,apex_admins&lt;/span&gt;&lt;br /&gt;admin: admin,apex_admins &lt;/blockquote&gt;&lt;br /&gt;Un-comment security section at &lt;span style="font-weight: bold; font-style: italic;"&gt;$PRISM_HOME/conf/web.xml&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;security-constraint&gt;&lt;br /&gt;&amp;lt;web-resource-collection&gt;&lt;br /&gt;&amp;lt;web-resource-name&gt;DBPrism Apex Admin&amp;lt;/web-resource-name&gt;&lt;br /&gt;&amp;lt;url-pattern&gt;/apex/apex_admin&amp;lt;/url-pattern&gt;&lt;br /&gt;&amp;lt;/web-resource-collection&gt;&lt;br /&gt;&amp;lt;auth-constraint&gt;&lt;br /&gt;&amp;lt;role-name&gt;apex_admins&amp;lt;/role-name&gt;&lt;br /&gt;&amp;lt;/auth-constraint&gt;&lt;br /&gt;&amp;lt;/security-constraint&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;security-constraint&gt;&lt;br /&gt;&amp;lt;web-resource-collection&gt;&lt;br /&gt;&amp;lt;web-resource-name&gt;DBPrism Apex&amp;lt;/web-resource-name&gt;&lt;br /&gt;&amp;lt;url-pattern&gt;/apex/*&amp;lt;/url-pattern&gt;&lt;br /&gt;&amp;lt;/web-resource-collection&gt;&lt;br /&gt;&amp;lt;auth-constraint&gt;&lt;br /&gt;&amp;lt;role-name&gt;apex_admins&amp;lt;/role-name&gt;&lt;br /&gt;&amp;lt;role-name&gt;apex_users&amp;lt;/role-name&gt;&lt;br /&gt;&amp;lt;/auth-constraint&gt;&lt;br /&gt;&amp;lt;/security-constraint&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Enable &lt;span style="font-weight: bold; font-style: italic;"&gt;Basic&lt;/span&gt; or &lt;span style="font-weight: bold; font-style: italic;"&gt;Form&lt;/span&gt; authentication for middle tier authentication:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;login-config&gt;&lt;br /&gt;&amp;lt;auth-method&gt;FORM&amp;lt;/auth-method&gt;&lt;br /&gt;&amp;lt;realm-name&gt;DBPrism Demo Realm&amp;lt;/realm-name&gt;&lt;br /&gt;&amp;lt;form-login-config&gt;&lt;br /&gt;&amp;lt;form-login-page&gt;/logon.html?param=test&amp;lt;/form-login-page&gt;&lt;br /&gt;&amp;lt;form-error-page&gt;/logonError.html?param=test&amp;lt;/form-error-page&gt;&lt;br /&gt;&amp;lt;/form-login-config&gt;&lt;br /&gt;&amp;lt;/login-config&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Start Jetty web server with:&lt;br /&gt;&lt;blockquote&gt;ant run&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;Log with your browser into http://localhost:8888/&lt;br /&gt;A DPPrism demo page is show&lt;br /&gt;Also there are links to log into Apex administrative and regular pages:&lt;br /&gt;&lt;blockquote&gt;http://localhost:8888/apex/&lt;br /&gt;http://localhost:8888/apex/apex_admin&lt;/blockquote&gt;&lt;br /&gt;First Jetty will ask you for your middle tier credentials (defined into &lt;span style="font-weight: bold; font-style: italic;"&gt;demoRealm.properties&lt;/span&gt;) use scott/tiger.&lt;br /&gt;Then APEX will ask you for your application workspace/username and password.&lt;br /&gt;With Apex administrations pages you can execute a SQL script to check your Oracle credentials (&lt;span style="font-style: italic;"&gt;select user from dual;&lt;/span&gt;), instead of returning &lt;span style="font-style: italic;"&gt;apex_public_user&lt;/span&gt; as connected user it should return &lt;span style="font-style: italic;"&gt;scott&lt;/span&gt; (proxy user).&lt;br /&gt;Also you can see the report Home&gt;Manage Service&gt;Session State&gt;Recent Sessions.&lt;br /&gt;If you any problem, edit &lt;span style="font-weight: bold; font-style: italic;"&gt;$PRISM_HOME/conf/log4j.properties&lt;/span&gt; un-commenting last two lines and look for /tmp/dpls.log information, then reports problems using &lt;a href="http://sourceforge.net/forum/forum.php?forum_id=187896"&gt;SourceForge.net Forums&lt;/a&gt;.&lt;br /&gt;Remember that using proxy user support you can add to Apex applications  Virtual Private Database support (VPD) or any other security layer provided by Oracle which relies on regular databases users, now your credential are a middle tier authenticated user (SCOTT in the example) not APEX_PUBLIC_USER!!!.&lt;br /&gt;Also middle tier authentication includes any JAAS supported scheme such as SSO, LDAP, etc. check your application server documentation to see which JAAS modules are included.&lt;br /&gt;Enjoy APEX/DBPrism combination....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-1640399384064997126?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/1640399384064997126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/1640399384064997126'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2008/10/apex-proxy-user-support-with-dbprism.html' title='APEX proxy user support with DBPrism, aka middle tier authentication'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-5746920816854776695</id><published>2008-09-01T10:14:00.000-07:00</published><updated>2008-09-01T11:07:06.517-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OJVM'/><category scheme='http://www.blogger.com/atom/ns#' term='openworld08'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene'/><title type='text'>Lucene Domain Index at OOW08</title><content type='html'>Want to see Lucene Domain Index in action at Oracle Open World 08?&lt;br /&gt;My friend Kuassi and I will present Lucene-Oracle integration during OOW08 (Oracle Develop: Database) session:&lt;br /&gt;&lt;a target="_blank" href="http://www28.cplan.com/cc208/session_details.jsp?isid=298820&amp;amp;ilocation_id=208-1&amp;amp;ilanguage=english"&gt;&lt;/a&gt;&lt;blockquote&gt;&lt;a target="_blank" href="http://www28.cplan.com/cc208/session_details.jsp?isid=298820&amp;amp;ilocation_id=208-1&amp;amp;ilanguage=english"&gt;Data- and Compute-Intensive Processing: Middle Tier or Database? Trade-offs and Case Study&lt;br /&gt;&lt;/a&gt;Monday 09/22/200811:30 - 12:30 Marriott Salon 01.&lt;/blockquote&gt;&lt;br /&gt;Also we can discuss about internal implementation, performance and future extensions.&lt;br /&gt;See you there.&lt;br /&gt;Marcelo.&lt;br /&gt;&lt;br /&gt;PD: Remember that a full documentation about Oracle-Lucene integration by using a new Domain Index is available as &lt;a href="http://docs.google.com/Doc?id=ddgw7sjp_54fgj9kg"&gt;Google document&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-5746920816854776695?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/5746920816854776695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/5746920816854776695'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2008/09/lucene-domain-index-at-oow08.html' title='Lucene Domain Index at OOW08'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-8717869778511394999</id><published>2008-07-15T05:11:00.000-07:00</published><updated>2008-07-16T11:38:43.707-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OJVM'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Services'/><category scheme='http://www.blogger.com/atom/ns#' term='Restlet'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene'/><title type='text'>A Lucene-OJVM native REST WS</title><content type='html'>I have done an example of using &lt;a href="http://marceloochoa.blogspot.com/2008/02/is-oracle-11g-rest-ready.html"&gt;native REST Web Services&lt;/a&gt; implementing this &lt;a href="http://dev.lucene-ws.net/wiki/API"&gt;Lucene WS API&lt;/a&gt;.&lt;br /&gt;Also the example shows how to use &lt;a href="http://maven.apache.org/"&gt;Apache Maven&lt;/a&gt; to build and deploy Oracle-OJVM artifacts.&lt;br /&gt;Information about how to install, compile and test the example is at &lt;a href="http://wiki.restlet.org/docs_1.1/g1/13-restlet/49-restlet/84-restlet.html"&gt;Restlet Wiki&lt;/a&gt;, follow links under &lt;span style="font-style: italic;"&gt;Using XDB Restlet Adapter within Maven projects&lt;/span&gt; section.&lt;br /&gt;Have fun with REST inside Oracle OJVM.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-8717869778511394999?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/8717869778511394999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/8717869778511394999'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2008/07/lucene-ojvm-native-rest-ws.html' title='A Lucene-OJVM native REST WS'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-7635090716627666995</id><published>2008-07-04T04:48:00.000-07:00</published><updated>2008-12-08T19:45:58.170-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XMLDB'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Data Cartridge API'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Domain Index'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene'/><title type='text'>XMLDB and Lucene Domain Index</title><content type='html'>I am integrating &lt;a href="http://www.dbprism.com.ar/j2-CMS/"&gt;DBPrism CMS&lt;/a&gt; with &lt;a href="http://docs.google.com/Doc?id=ddgw7sjp_54fgj9kg"&gt;Lucene Domain Index&lt;/a&gt; project by replacing free text searching functionality implemented with &lt;a href="http://www.oracle.com/technology/products/text/index.html"&gt;Oracle Text&lt;/a&gt;.&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;DBPrism CMS&lt;/span&gt; uses &lt;span style="font-weight: bold; font-style: italic;"&gt;XMLDB&lt;/span&gt; as storage system for content author documents.&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;CMS&lt;/span&gt; documents are in &lt;a href="http://forrest.apache.org/dtdx/dtd-docs.html"&gt;Apache document-v20 format&lt;/a&gt;, and are stored using this &lt;a href="http://www.dbprism.com.ar/xsd/document-v20-ann.xsd"&gt;annotated XSD schema&lt;/a&gt;.&lt;br /&gt;Mainly we choose &lt;span style="font-weight: bold; font-style: italic;"&gt;XMLDB&lt;/span&gt; to get these benefits:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Documents are stored in an object relational table to get fast access in a relational way for some meta-data values.&lt;/li&gt;&lt;li&gt;Content authors information is stored as &lt;span style="font-weight: bold; font-style: italic;"&gt;CLOB&lt;/span&gt; because only is searched using free text way.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;XMLDB&lt;/span&gt; protocols handlers, content authors can use &lt;span style="font-weight: bold; font-style: italic;"&gt;WebDAV&lt;/span&gt; or &lt;span style="font-weight: bold; font-style: italic;"&gt;FTP&lt;/span&gt; to access to your documents instead of the &lt;span style="font-weight: bold; font-style: italic;"&gt;CMS Front End&lt;/span&gt; for complex file system like operations such as copy, move, rename, backup operations.&lt;/li&gt;&lt;li&gt;We can use &lt;span style="font-weight: bold; font-style: italic;"&gt;SQL&lt;/span&gt; duality to traverse the &lt;span style="font-weight: bold; font-style: italic;"&gt;XMLDB&lt;/span&gt; folder structure using resource_view.&lt;/li&gt;&lt;li&gt;Get all the benefits of relational storage for storing non structured content, backup, concurrency access, etc.&lt;/li&gt;&lt;/ul&gt;As mentioned above a content authors information is stored in a &lt;span style="font-weight: bold; font-style: italic;"&gt;CLOB&lt;/span&gt; columns and indexes with some free text searching functionality.&lt;br /&gt;Now is indexed with Oracle Text with this script:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;begin&lt;br /&gt;ctx_ddl.create_preference('english_lexer','basic_lexer');&lt;br /&gt;ctx_ddl.set_attribute('english_lexer','index_text','yes');&lt;br /&gt;ctx_ddl.create_preference('spanish_lexer','basic_lexer');&lt;br /&gt;ctx_ddl.set_attribute('spanish_lexer','index_text','yes');&lt;br /&gt;ctx_ddl.create_preference('cms_docs_lexer','multi_lexer');&lt;br /&gt;ctx_ddl.add_sub_lexer('cms_docs_lexer','default','english_lexer');&lt;br /&gt;ctx_ddl.add_sub_lexer('cms_docs_lexer','spanish','spanish_lexer','es');&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;create index cms_docs_xml_idx&lt;br /&gt;on cms_docs c (value(c)) indextype is ctxsys.context&lt;br /&gt;parameters('section group ctxsys.auto_section_group  filter ctxsys.null_filter  lexer cms_docs_lexer language column "XMLDATA"."lang"');&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;We index with Oracle Text using a top level attribute &lt;span style="font-weight: bold;"&gt;lang &lt;/span&gt;as language classifier to provide then the availability to choose between searching in Spanish or English document separately.&lt;br /&gt;Now we will index this free text content using Lucene Domain Index with this definition:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;create index cms_docs_xml_lidx&lt;br /&gt;on cms_docs c (value(c)) indextype is lucene.LuceneIndex&lt;br /&gt;parameters('LogLevel:ALL;IncludeMasterColumn:false;\&lt;br /&gt;ExtraTabs:resource_view r;\&lt;br /&gt;ExtraCols:extract(object_value,''//text()'') "text",\&lt;br /&gt;substr(r.any_path,2,1) "path",\&lt;br /&gt;extract(object_value,''/document/@lang'') "lang",\&lt;br /&gt;extract(object_value,''//@href'') "links",\&lt;br /&gt;extractValue(r.res,''/Resource/Owner'') "Owner",\&lt;br /&gt;extractValue(r.res,''/Resource/ModificationDate'') "modTime";\&lt;br /&gt;WhereCondition:extractValue(r.res,''/Resource/XMLRef'')=make_ref(cms_docs,object_id);\&lt;br /&gt;FormatCols:path(UN_TOKENIZED),lang(UN_TOKENIZED)');&lt;/span&gt;&lt;/blockquote&gt;I will explain in detail each preferences when describing search use cases.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Use case 1 - search for some free text under public or private folders for an specific language&lt;/span&gt;&lt;br /&gt;This use case basically use &lt;span style="font-weight: bold; font-style: italic;"&gt;text&lt;/span&gt; field of Lucene Domain Index. Lucene Domain Index have a functionality called &lt;span style="font-weight: bold; font-style: italic;"&gt;User Data Store&lt;/span&gt; which provides the availability of indexing virtually anything that you can extract in a simple or a joined query. At above example we will index information of the base table and information of &lt;span style="font-weight: bold;"&gt;resource_view&lt;/span&gt; (meta-data) joined by his document id (&lt;span style="font-weight: bold; font-style: italic;"&gt;ExtraTabs&lt;/span&gt; and &lt;span style="font-weight: bold; font-style: italic;"&gt;WhereCondition&lt;/span&gt; parameters). Note that we do not index a master column of the object relational table (his complete row) because we will choose using &lt;span style="font-weight: bold; font-style: italic;"&gt;XMLDB&lt;/span&gt; extract function which information to index.&lt;br /&gt;For this use case we need &lt;span style="font-weight: bold; font-style: italic;"&gt;text&lt;/span&gt;, &lt;span style="font-weight: bold; font-style: italic;"&gt;path&lt;/span&gt; and &lt;span style="font-weight: bold; font-style: italic;"&gt;Owner&lt;/span&gt; Fields. Note that for path information we need to know only if a document is at /home or /public path, so only store one char (h or p). Following Oracle Text and Lucene query syntax example:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;pre&gt;select /*+ domain_index_sort */ score(1),extractValue(c.object_value,'/document/header/title')&lt;br /&gt;from cms_docs c,resource_view r  where under_path(r.res,'/public',2)=1 and&lt;br /&gt;extractValue(r.res,'/Resource/XMLRef')=ref(c) and&lt;br /&gt;extractValue(r.res,'/Resource/Owner')='DBPRISM_ADMIN' and&lt;br /&gt;contains(c.object_value,&lt;br /&gt;'Here a CTXCAT XML syntax for querying CMS in english',1)&gt;0&lt;br /&gt;order by score(1) DESC;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;Lucene Domain Index syntax:&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;pre&gt;select /*+ domain_index_sort */&lt;br /&gt;lscore(1),r.any_path,extractValue(c.object_value,'/document/header/title')&lt;br /&gt;from cms_docs c,resource_view r&lt;br /&gt;where extractValue(r.res,'/Resource/XMLRef')=make_ref(cms_docs,object_id) and&lt;br /&gt;lcontains(c.object_value,&lt;br /&gt;'text:CMS AND -lang:es AND path:p AND Owner:DBPRISM_ADMIN',1)&gt;0&lt;br /&gt;order by lscore(1) DESC;&lt;/pre&gt;&lt;/span&gt;&lt;/blockquote&gt;Executions plans for both queries&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ynfsOwQFaM0/SHIrpIyajhI/AAAAAAAAAGY/Gj0ur2as6dE/s1600-h/text_explain.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_ynfsOwQFaM0/SHIrpIyajhI/AAAAAAAAAGY/Gj0ur2as6dE/s320/text_explain.jpg" alt="" id="BLOGGER_PHOTO_ID_5220282903809396242" border="0" /&gt;&lt;/a&gt;Note that a highlighted text includes a double filter by execution as:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;"P"."SYS_NC00019$"=SYS_XMLCONV('DBPRISM_ADMIN',7,2,2,1,4,23) AND "XDB"."UNDER_PATH"(SYS_MAKEXML('8758D485E6004793E034080020B242C6',734,"P"."XMLEXTRA","P"."XMLDATA"),'/public',2)=1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ynfsOwQFaM0/SHItuCK8a0I/AAAAAAAAAGg/Kk0NjucssWE/s1600-h/lucene_explain.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_ynfsOwQFaM0/SHItuCK8a0I/AAAAAAAAAGg/Kk0NjucssWE/s320/lucene_explain.jpg" alt="" id="BLOGGER_PHOTO_ID_5220285186955832130" border="0" /&gt;&lt;/a&gt;Highlighted filter on Lucene Domain Index syntax only includes a joined syntax with resource_view&lt;br /&gt;&lt;span style="font-size:85%;"&gt;"XDB"."UNDER_PATH"(SYS_MAKEXML('8758D485E6004793E034080020B242C6',734,"P"."XMLEXTRA","P"."XMLDATA"),'/',9999)=1&lt;/span&gt;&lt;br /&gt;Also note that we use &lt;span style="font-weight: bold;"&gt;DOMAIN_INDEX_SORT&lt;/span&gt; optimizer hint to prevent sorting of the result due Oracle Text and Lucene returns rows order by score descending as natural order.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Note&lt;/span&gt;: In Lucene query syntax we use a negation of Spanish match field (&lt;span style="font-style: italic;"&gt;-lang:es&lt;/span&gt;) to look for English documents, this negation includes document with lang="en" or without it which assume English.&lt;/span&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Use case 2 - paginate over a result set efficiently&lt;/span&gt;&lt;br /&gt;Obviously above queries need to be paginated in a real world application, to paginate above result using Oracle Text syntax we need to use Top-N syntax as follow:&lt;br /&gt;&lt;blockquote&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;&lt;pre&gt;&lt;span style="font-weight: bold;"&gt;select * from (select rownum as ntop_pos, q.* from (&lt;/span&gt;&lt;br /&gt;select /*+ domain_index_sort */ score(1),extract(c.object_value,'/document/header/*')&lt;br /&gt;from cms_docs c,resource_view r  where under_path(r.res,'/public',2)=1 and&lt;br /&gt;extractValue(r.res,'/Resource/XMLRef')=ref(c) and&lt;br /&gt;extractValue(r.res,'/Resource/Owner')='DBPRISM_ADMIN' and&lt;br /&gt;contains(c.object_value,&lt;br /&gt;'Here a CTXCAT XML syntax for querying CMS in english',1)&gt;0&lt;br /&gt;order by score(1) DESC&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;) q) where ntop_pos&gt;=1 and ntop_pos&lt;=10;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;But using Lucene Domain Index its not necessary, look:&lt;br /&gt;&lt;blockquote&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;&lt;pre&gt;select /*+ domain_index_sort */&lt;br /&gt;lscore(1),r.any_path,extractValue(c.object_value,'/document/header/title')&lt;br /&gt;from cms_docs c,resource_view r&lt;br /&gt;where extractValue(r.res,'/Resource/XMLRef')=make_ref(cms_docs,object_id) and&lt;br /&gt;lcontains(c.object_value,&lt;br /&gt;'&lt;span style="font-weight: bold;"&gt;rownum:[1 TO 10] AND&lt;/span&gt; text:CMS AND -lang:es AND path:p AND Owner:DBPRISM_ADMIN',1)&gt;0&lt;br /&gt;order by lscore(1) DESC;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;Using Top-N syntax the cost of the query is &lt;span style="font-weight: bold;"&gt;35&lt;/span&gt; but with Lucene Domain syntax still in &lt;span style="font-weight: bold;"&gt;30&lt;/span&gt;. See executions plans for both queries:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ynfsOwQFaM0/SHKFPEFQWMI/AAAAAAAAAGo/yIBF2-0TcpU/s1600-h/text_explain_paginated.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_ynfsOwQFaM0/SHKFPEFQWMI/AAAAAAAAAGo/yIBF2-0TcpU/s320/text_explain_paginated.jpg" alt="" id="BLOGGER_PHOTO_ID_5220381411916142786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ynfsOwQFaM0/SHKFqFAaFyI/AAAAAAAAAGw/2_Y6lD7qO7Y/s1600-h/lucene_explain_paginated.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_ynfsOwQFaM0/SHKFqFAaFyI/AAAAAAAAAGw/2_Y6lD7qO7Y/s320/lucene_explain_paginated.jpg" alt="" id="BLOGGER_PHOTO_ID_5220381876020713250" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Use case 3 - filter a result set based a modification time of documents&lt;/span&gt;&lt;br /&gt;Usually users want to filter and order documents based on his modification time, that is the reason to include resource_view information inside Lucene Domain Index, any information pushed inside Lucene Index will be faster if then is used to filter and sort the result without the intervention of Oracle where clause, on Oracle 11g Text you can do a similar task, but is designed for relational columns, not for and XML content joined with resource view, see &lt;a href="http://download.oracle.com/docs/cd/B28359_01/text.111/b28303/aoptim.htm#CCAPP9245"&gt;Composite Domain Index (CDI) in Oracle Text&lt;/a&gt;.&lt;br /&gt;Well here a filter and order by constraints for above queries:&lt;br /&gt;&lt;blockquote&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;&lt;pre&gt;&lt;span&gt;select * from (select rownum as ntop_pos, q.* from (&lt;br /&gt;select /*+ domain_index_sort */&lt;br /&gt;score(1),r.any_path,extractValue(c.object_value,'/document/header/title'),extractValue(r.res,'/Resource/ModificationDate')&lt;br /&gt;from cms_docs c,resource_view r&lt;br /&gt;where under_path(r.res,'/home',2)=1 and&lt;br /&gt;extractValue(r.res,'/Resource/XMLRef')=ref(c) and&lt;br /&gt;extractValue(r.res,'/Resource/Owner')='CMS_PUBLIC' and&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;extractValue(r.res,'/Resource/ModificationDate') between&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;TO_TIMESTAMP('01.01.2006:00:00:00','DD.MM.YYYY:HH24:MI:SS') and&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;TO_TIMESTAMP('01.01.2007:00:00:00','DD.MM.YYYY:HH24:MI:SS') and&lt;/span&gt;&lt;br /&gt;contains(c.object_value,&lt;br /&gt;'Here a CTXCAT XML syntax for querying CMS',1)&gt;0&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;order by extractValue(r.res,'/Resource/ModificationDate') ASC&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;query&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;) q) where ntop_pos&gt;=1 and ntop_pos&lt;=10;&lt;/query&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;Using Lucene Domain Index &lt;span style="font-weight: bold;"&gt;lcontains&lt;/span&gt; syntax:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;select /*+ DOMAIN_INDEX_SORT */&lt;br /&gt;extractValue(r.res,'/Resource/ModificationDate'),&lt;br /&gt;extractValue(value(c),'/document/header/title')&lt;br /&gt;from cms_docs c,resource_view r&lt;br /&gt;where extractValue(r.res,'/Resource/XMLRef')=make_ref(cms_docs,object_id) and&lt;br /&gt;lcontains(value(c),'rownum:[1 TO 10] AND text:CMS AND \&lt;br /&gt;-lang:es AND path:h AND Owner:DBPRISM_ADMIN AND \&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;modTime:[20060101 TO 20070101]','modTime:ASC'&lt;/span&gt;,1)&gt;0;&lt;/span&gt;&lt;/blockquote&gt;Note that like pagination use case, here filter by and order by information is injected at &lt;span style="font-weight: bold;"&gt;lcontains() &lt;/span&gt;operator reducing a number of rows returned by the Domain Index and avoiding the filter view. Oracle Text syntax have a cost 35 and Lucene syntax down to 29 because no &lt;span style="font-weight: bold;"&gt;lscore()&lt;/span&gt; is computed. Following screenshots which depicts the execution plans:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ynfsOwQFaM0/SHKN7TcvbaI/AAAAAAAAAG4/Rz98F864Wy0/s1600-h/text_explain_filtered.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_ynfsOwQFaM0/SHKN7TcvbaI/AAAAAAAAAG4/Rz98F864Wy0/s320/text_explain_filtered.jpg" alt="" id="BLOGGER_PHOTO_ID_5220390968048446882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ynfsOwQFaM0/SHKOLlK0UOI/AAAAAAAAAHA/VzmxLOiBnQk/s1600-h/lucene_explain_filtered.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_ynfsOwQFaM0/SHKOLlK0UOI/AAAAAAAAAHA/VzmxLOiBnQk/s320/lucene_explain_filtered.jpg" alt="" id="BLOGGER_PHOTO_ID_5220391247683014882" border="0" /&gt;&lt;/a&gt;This was the reason to store &lt;span style="font-weight: bold;"&gt;extractValue(r.res,''/Resource/ModificationDate'') "modTime&lt;/span&gt; during Lucene Domain Index build/update process.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Use case 4 - search for documents which have possible broken links to a moved/deleted page&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;DBPrism CMS&lt;/span&gt; have a functionality which advices in seconds which pages could have broken links when content authors moves, rename or delete &lt;span style="font-weight: bold;"&gt;CMS&lt;/span&gt; pages, not crawlers or spiders are required, only search his domain index. For example using Oracle Text syntax, if you rename a page named &lt;span style="font-weight: bold;"&gt;j1-Pages.html&lt;/span&gt;:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;select path(2) path&lt;br /&gt;from cms_docs c,resource_view r&lt;br /&gt;where contains(c.object_value,&lt;span style="font-weight: bold;"&gt;'j1 Pages within a@href'&lt;/span&gt;,1)&gt;1 and&lt;br /&gt;extractValue(r.res,'/Resource/XMLRef')=ref(c) and&lt;br /&gt;under_path(r.res,'/home/DBPRISM_ADMIN/cms/en',2)=1;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;and using Lucene Domain Index syntax:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;select /*+ DOMAIN_INDEX_SORT */ r.any_path path&lt;br /&gt;from cms_docs c,resource_view r&lt;br /&gt;where extractValue(r.res,'/Resource/XMLRef')=ref(c) and&lt;br /&gt;lcontains(value(c),'path:h AND -lang:es AND \&lt;br /&gt;Owner:DBPRISM_ADMIN AND \&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;links:(+j1 +Pages)&lt;/span&gt;',1)&gt;0;&lt;/span&gt;&lt;/blockquote&gt;Both queries return a page &lt;span style="font-style: italic;"&gt;/home/DBPRISM_ADMIN/cms/en/j2-CMS/Users/frontend/index.xml &lt;/span&gt;which have a link to j1-Pages.html, the magic here is to use &lt;span style="font-weight: bold;"&gt;within&lt;/span&gt; operator with Oracle Text or look for the field &lt;span style="font-weight: bold;"&gt;links&lt;/span&gt; which was added during index build/update time with all the links extracted from the document under a@href tag. For above queries Oracle Text cost down to &lt;span style="font-weight: bold;"&gt;34&lt;/span&gt; because no score and order by is required and Lucene Domain Index still in &lt;span style="font-weight: bold;"&gt;29&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Have fun with Lucene and XMLDB.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-7635090716627666995?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/7635090716627666995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/7635090716627666995'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2008/07/xmldb-and-lucene-domain-index.html' title='XMLDB and Lucene Domain Index'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ynfsOwQFaM0/SHIrpIyajhI/AAAAAAAAAGY/Gj0ur2as6dE/s72-c/text_explain.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-7577508859997364645</id><published>2008-06-25T11:39:00.000-07:00</published><updated>2008-06-25T12:06:36.613-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mod_plsql'/><category scheme='http://www.blogger.com/atom/ns#' term='dbprism'/><category scheme='http://www.blogger.com/atom/ns#' term='JAAS'/><category scheme='http://www.blogger.com/atom/ns#' term='apex'/><category scheme='http://www.blogger.com/atom/ns#' term='SSO'/><category scheme='http://www.blogger.com/atom/ns#' term='proxy user'/><title type='text'>New DBPrism release - Apex users read this!!</title><content type='html'>Two weeks ago I released a new &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=56183&amp;amp;package_id=51348"&gt;DBPrism release, 2.1.2&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.dbprism.com.ar/"&gt;DBPrism&lt;/a&gt; is a project which provides a J2EE &lt;span style="font-weight: bold; font-style: italic;"&gt;mod_plsql &lt;/span&gt;replacement and is a core of &lt;a href="http://www.dbprism.com.ar/j2-CMS/"&gt;DBPrism CMS&lt;/a&gt; which uses &lt;span style="font-weight: bold; font-style: italic;"&gt;Java Stored Procedure support&lt;/span&gt;.&lt;br /&gt;As &lt;span style="font-weight: bold; font-style: italic;"&gt;mod_plsql&lt;/span&gt; replacement users can integrate &lt;a href="http://www.oracle.com/technology/products/database/application_express/index.html"&gt;Apex&lt;/a&gt; applications in any &lt;span style="font-weight: bold; font-style: italic;"&gt;J2EE&lt;/span&gt; container without using Apache mod_plsql. This integration means that for example you can use JSP's &lt;a href="http://www.dbprism.com.ar/j1-Documentation/Users/j2-Demos.html"&gt;include or forward&lt;/a&gt; tags to get content generated with Apex.&lt;br /&gt;Also you can integrate your Apex application with your favorite &lt;span style="font-weight: bold; font-style: italic;"&gt;SSO/JAAS&lt;/span&gt; strategy because in this release we include &lt;a href="http://download-west.oracle.com/docs/cd/B14117_01/network.101/b10773/admnauth.htm#1006366"&gt;Oracle JDBC proxy user support&lt;/a&gt;. Proxy user support means that DBPrism will use a valid getUserPrincipal() or getRemoteUser() Servlet values to pass it as effective user to a JDBC connection which was initiated with a generic user also called &lt;span style="font-weight: bold; font-style: italic;"&gt;big application user&lt;/span&gt;.&lt;br /&gt;To know more about DBPrims proxy user support see &lt;a href="http://www.dbprism.com.ar/j1-Documentation/Users/j2-Demos.html"&gt;DBPrism demo page information&lt;/a&gt; also you can find more information about how to work with Oracle proxy user support in this &lt;a href="http://www.it-eye.nl/weblog/2005/09/12/oracle-proxy-users-by-example/"&gt;Blog page&lt;/a&gt;.&lt;br /&gt;A full change log of this release is at &lt;a href="http://www.dbprism.com.ar/j3-Download/j1-dbprism.html"&gt;Download page of DBPrism's web site&lt;/a&gt;.&lt;br /&gt;Have fun, Marcelo&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-7577508859997364645?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/7577508859997364645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=7577508859997364645' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/7577508859997364645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/7577508859997364645'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2008/06/new-dbprism-release-apex-users-read.html' title='New DBPrism release - Apex users read this!!'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-4419066453666179598</id><published>2008-06-01T05:11:00.000-07:00</published><updated>2008-06-01T06:27:51.447-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OJVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Data Cartridge API'/><category scheme='http://www.blogger.com/atom/ns#' term='WikiPedia'/><category scheme='http://www.blogger.com/atom/ns#' term='Lucene'/><title type='text'>New binary release of Lucene Oracle Data Cartridge</title><content type='html'>I am just released a new binary version of &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=56183&amp;amp;package_id=255524&amp;amp;release_id=603580"&gt;Lucene-Oracle integration&lt;/a&gt;.&lt;br /&gt;Lucene Data Cartridge is a new Domain Index for Oracle 10g/11g databases running &lt;a href="http://marceloochoa.blogspot.com/2007/09/running-lucene-inside-your-oracle-jvm.html"&gt;inside OJVM&lt;/a&gt;.&lt;br /&gt;This release is integrated with &lt;a href="http://lucene.apache.org/java/2_3_2/"&gt;Lucene 2.3.2&lt;/a&gt; production version.&lt;br /&gt;First consequence of using latest binary distribution is the indexing performance improvement, around 4x compared with previous release.&lt;br /&gt;I have tested it using &lt;a href="http://marceloochoa.blogspot.com/2007/12/uploading-wikipedia-dumps-to-oracle.html"&gt;WikiPedia Spanish Dump&lt;/a&gt;, using a modest hardware (Pentium IV 2.26GHz 2G RAM/512K cache, SATA 110Gb disk) on 11G database with 800Mb SGA with this result:&lt;br /&gt;&lt;blockquote&gt;&lt;ul&gt;&lt;li&gt;Uploading speed 5500 pages/min.&lt;/li&gt;&lt;li&gt;Indexing speed 3520 pages/min.&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;Over 1.056.163 documents.&lt;br /&gt;Note that upload speed is around 57% faster than indexing speed, but upload process do not includes parsing of text, only split the XML document and insert in a relational table. This is very important because is a measure of how fast is my hardware, also note that nobody will storage Wikipedia dump in my computer :)&lt;br /&gt;Here another test using a VAIO notebook  (Core 2 Duo 1.66GHz 2G RAM/1Mb cache, SATA 200Gb disk) on 11G database with 800Mb SGA:&lt;br /&gt;&lt;blockquote&gt;&lt;ul&gt;&lt;li&gt;Uploading speed 8478 pages/min.&lt;/li&gt;&lt;li&gt;Indexing speed 5374 pages/min.&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;Over a subset of 33.912 documents.&lt;br /&gt;Search time is almost constant with a document set of 34K and 1M documents, for example:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;SQL&gt; select /*+ DOMAIN_INDEX_SORT */ extractValue(object_value,'/page/title')&lt;br /&gt;  2  from pages where lcontains(object_value,'rownum:[20 TO 30] AND text:musica*')&gt;0;&lt;br /&gt;&lt;br /&gt;EXTRACTVALUE(OBJECT_VALUE,'/PAGE/TITLE')&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Ribadeo&lt;br /&gt;Pennisetum&lt;br /&gt;Robert Nesta Marley&lt;br /&gt;Argelia&lt;br /&gt;Puccinellia&lt;br /&gt;Nivel de energia&lt;br /&gt;1144&lt;br /&gt;Mañana&lt;br /&gt;Marcha&lt;br /&gt;Valsalabroso&lt;br /&gt;Via Lactea&lt;br /&gt;&lt;br /&gt;11 rows selected.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:00.45&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;Second execution (most of the structures are in cache Lucene+ROWIDs):&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;SQL&gt; select /*+ DOMAIN_INDEX_SORT */ extractValue(object_value,'/page/title')&lt;br /&gt;  2  from pages where lcontains(object_value,'rownum:[20 TO 30] AND text:musica*')&gt;0;&lt;br /&gt;&lt;br /&gt;EXTRACTVALUE(OBJECT_VALUE,'/PAGE/TITLE')&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Ribadeo&lt;br /&gt;Pennisetum&lt;br /&gt;Robert Nesta Marley&lt;br /&gt;Argelia&lt;br /&gt;Puccinellia&lt;br /&gt;Nivel de energia&lt;br /&gt;1144&lt;br /&gt;Mañana&lt;br /&gt;Marcha&lt;br /&gt;Valsalabroso&lt;br /&gt;Via Lactea&lt;br /&gt;&lt;br /&gt;11 rows selected.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:00.02&lt;/span&gt;&lt;/blockquote&gt;If first query is performed over 1 million documents it took 00:00:01.36, it means than for corpus about 26 times bigger the query is only 2 times slow, once the query is re-done over other window of the pagination which means all Lucene query structures are cached it took 00:00:00.08 without ROWID in cache and 00:00:00.02 after the ROWID are in cache.&lt;br /&gt;&lt;blockquote&gt;Note: With 11g database there is an small glitch with JIT compiler which affects Lucene's DocumentWriters class, luckily the problem its not reproducible on 11.2 or 11.1.0.7 version, thanks to Lucene and Oracle Dev. teams to identified the problem. If you want to rebuild Lucene-OJVM code from sources just drop me an email to identified the problem.&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-4419066453666179598?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/4419066453666179598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=4419066453666179598' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/4419066453666179598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/4419066453666179598'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2008/06/new-binary-release-of-lucene-oracle.html' title='New binary release of Lucene Oracle Data Cartridge'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-7129663465602919665</id><published>2008-05-06T14:34:00.000-07:00</published><updated>2008-05-08T16:29:43.557-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle EL VM Linux Mandriva Xen virtualization'/><title type='text'>Using Oracle VM templates on Linux with Xen</title><content type='html'>Oracle provides a good tools with &lt;a href="http://www.oracle.com/technology/tech/virtualization/index.html"&gt;Oracle VM&lt;/a&gt; and his console tool. But for people like me who uses &lt;span style="font-weight: bold; font-style: italic;"&gt;Mandriva Linux&lt;/span&gt; for historical reasons its possible to use Oracle EL and Oracle 11g templates.&lt;br /&gt;For &lt;span style="font-weight: bold; font-style: italic;"&gt;Mandriva&lt;/span&gt; users its simple as download the two templates, in my case:&lt;br /&gt;                  &lt;ul&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/technology/software/products/virtualization/vm_templates_el.html" name="link14" class="bodylink" id="link1" onclick="youMustAgreePrompt();"&gt;PV                          Small x86&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/technology/software/products/virtualization/vm_templates_el.html" name="link14" class="bodylink" id="link1" onclick="youMustAgreePrompt();"&gt;&lt;/a&gt;&lt;a href="http://www.oracle.com/technology/software/products/virtualization/vm_templates_oracle.html"&gt;oracle11g_x86.tar.bz2.1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/technology/software/products/virtualization/vm_templates_oracle.html"&gt;oracle11g_x86.tar.bz2.2&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Then install Xen support for Mandriva:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;xen-3.1.0-8mdv2008.0&lt;/li&gt;&lt;li&gt;xen-doc-3.1.0-8mdv2008.0&lt;/li&gt;&lt;li&gt;kernel-xen-3.1.0-8mdv2008.0&lt;/li&gt;&lt;/ul&gt;And his related packages.&lt;br /&gt;Restart your computer making sure that Xen Kernel is used (for example 2.6.18-xen), usually Xen kernel is placed at the boton of the list and its not the default kernel to boot.&lt;br /&gt;Then start and enable Xen services as root:&lt;br /&gt;&lt;blockquote&gt;# /etc/init.d/xend start&lt;br /&gt;# chkconfig xend on&lt;br /&gt;&lt;/blockquote&gt;Uncompress above images into any directory, for example:&lt;br /&gt;&lt;blockquote&gt;# cd /home&lt;br /&gt;# tar xvfz OVM_EL5U1_X86_PVM_4GB.tgz&lt;br /&gt;# cd OVM_EL5U1_X86_PVM_4GB&lt;br /&gt;# cat ../oracle11g_x86.tar.bz2.*|tar xvfj -&lt;br /&gt;&lt;/blockquote&gt;Above directory will look like:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:times new roman;"&gt;[root@escorpion OVM_EL5U1_X86_PVM_4GB]# ls&lt;br /&gt;oracle11g_x86.img  README  README.oracle  system.img  vm.cfg&lt;br /&gt;[root@escorpion OVM_EL5U1_X86_PVM_4GB]#&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;span style="font-style: italic;"&gt;system.img&lt;/span&gt; file is an &lt;span style="font-weight: bold;"&gt;LVM&lt;/span&gt; volume with Oracle EL 5 operating system, oracle11g_x86.img file is a complete /u01 directory with an Oracle 11g database ready to use.&lt;br /&gt;Finally using your favourite text editor creates a file named /etc/xen/oracle with:&lt;br /&gt;&lt;blockquote&gt;memory = 1024&lt;br /&gt;name = "oracle"&lt;br /&gt;disk = [ 'file:/home/OVM_EL5U1_X86_PVM_4GB/system.img,hda,w',&lt;br /&gt;                            'file:/home/OVM_EL5U1_X86_PVM_4GB/oracle11g_x86.img,hdb,w' ]&lt;br /&gt;bootloader="/usr/bin/pygrub"&lt;br /&gt;root = "/dev/hda1 ro"&lt;br /&gt;extra = "3"&lt;br /&gt;hostname = "oracle"&lt;br /&gt;vif=['mac=00:16:3E:23:85:8B']&lt;br /&gt;&lt;/blockquote&gt;To start your Oracle VM using Xen command line execute:&lt;br /&gt;&lt;blockquote&gt;xm create oracle&lt;/blockquote&gt;To connect to the virtual machine console execute:&lt;br /&gt;&lt;blockquote&gt;xm console oracle&lt;/blockquote&gt;If everything is fine, you can log into the virtual machine using root/ovsroot as username and password.&lt;br /&gt;The &lt;span style="font-style: italic;"&gt;Oracle VM&lt;/span&gt; will gets his IP address using DHCP so may be you need to check &lt;span style="font-style: italic; font-weight: bold;"&gt;vif&lt;/span&gt; parameter at above file if &lt;span style="font-weight: bold; font-style: italic;"&gt;Xen&lt;/span&gt; virtual machine can't get a valid IP number due to conflicts with another machine.&lt;br /&gt;If not, once you enter to the &lt;span style="font-weight: bold; font-style: italic;"&gt;VM&lt;/span&gt; using the console you can change the file &lt;blockquote&gt;/etc/sysconfig/network-scripts/ifcfg-eth0&lt;/blockquote&gt; with something like this:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;DEVICE=eth0&lt;br /&gt;BOOTPROTO=static&lt;br /&gt;IPADDR=10.1.1.34&lt;br /&gt;NETMASK=255.255.255.0&lt;br /&gt;ONBOOT=yes&lt;br /&gt;METRIC=10&lt;br /&gt;MII_NOT_SUPPORTED=yes&lt;br /&gt;GATEWAY=10.1.1.1&lt;br /&gt;USERCTL=no&lt;br /&gt;DNS1=10.1.1.5&lt;br /&gt;DNS2=10.254.0.5&lt;br /&gt;RESOLV_MODS=yes&lt;br /&gt;IPV6INIT=no&lt;br /&gt;IPV6TO4INIT=no&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;Knows caveats:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Xen kernels &lt;span style="font-weight: bold; font-style: italic;"&gt;Dom0&lt;/span&gt; do not have all drivers compiled, in my case a driver for a wifi cards was not included.&lt;/li&gt;&lt;li&gt;If you want to reduce Xen VM memory usage, first log into Oracle instance and reduce the parameter &lt;span style="font-weight: bold; font-style: italic;"&gt;memory_target&lt;/span&gt; to a value which fits into a new &lt;span style="font-style: italic; font-weight: bold;"&gt;VM&lt;/span&gt; memory.&lt;/li&gt;&lt;/ul&gt;Finally these tips are valid for any Linux distributions which include &lt;span style="font-style: italic; font-weight: bold;"&gt;Xen&lt;/span&gt; support, using Oracle template running with &lt;span style="font-weight: bold; font-style: italic;"&gt;Xen&lt;/span&gt; we have several benefits:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You can gets an Oracle 11g database running in Linux distros not certified by Oracle.&lt;/li&gt;&lt;li&gt;You don't care about touching your OS parameters, database users and groups, simple you can get an Oracle instance for development purpose ready to use unpacking a few files.&lt;/li&gt;&lt;li&gt;Oracle 11g running with &lt;span style="font-weight: bold; font-style: italic;"&gt;Xen&lt;/span&gt; and &lt;span style="font-weight: bold; font-style: italic;"&gt;Oracle EL&lt;/span&gt; paravirtualized version is faster than &lt;span style="font-weight: bold; font-style: italic;"&gt;Oracle 11g&lt;/span&gt; running on &lt;span style="font-weight: bold; font-style: italic;"&gt;VMWare&lt;/span&gt; or &lt;span style="font-weight: bold; font-style: italic;"&gt;VirtualBox&lt;/span&gt;, &lt;span style="font-weight: bold; font-style: italic;"&gt;Xen&lt;/span&gt; only impose a 0.4% of overhead into guest operating system.&lt;/li&gt;&lt;li&gt;If you have any problem with your database, simply restore your .img files and start again your Xen virtual machine, this is also valid if you want to perform a backup.&lt;/li&gt;&lt;li&gt;The memory footprint of the &lt;span style="font-weight: bold; font-style: italic;"&gt;Xen&lt;/span&gt; virtual machine is similar as a native instance of the database, for example if you configure your Oracle instance to use 800Mb of &lt;span style="font-weight: bold; font-style: italic;"&gt;RAM&lt;/span&gt;, your &lt;span style="font-weight: bold; font-style: italic;"&gt;VM&lt;/span&gt; will use a little of megabytes extras.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Well this is my list of benefits may be other user will have your own list.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-7129663465602919665?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/7129663465602919665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=7129663465602919665' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/7129663465602919665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/7129663465602919665'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2008/05/using-oracle-vm-templates-on-linux-with.html' title='Using Oracle VM templates on Linux with Xen'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-1300641544207112034</id><published>2008-04-14T04:51:00.000-07:00</published><updated>2008-04-14T06:01:28.780-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OJVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle 11g'/><category scheme='http://www.blogger.com/atom/ns#' term='XMPP'/><title type='text'>Can Oracle talk with you?</title><content type='html'>Sure, it can.&lt;br /&gt;Using Google Talk or any client which supports &lt;a href="http://www.adarshr.com/papers/xmpp"&gt;XMPP&lt;/a&gt; stack.&lt;br /&gt;The jump start for this code example is the article published at &lt;a href="http://www.oracle.com/technology/pub/articles/jellema-googletalk.html"&gt;OTN&lt;/a&gt; web site by &lt;a href="http://technology.amis.nl/blog/"&gt;&lt;em&gt;Lucas Jellema&lt;/em&gt;&lt;/a&gt;.&lt;br /&gt;But, Why do we need an XMPP stack supported inside the database?, here some ideas:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Instant DBA notifications with alerts, security, diskspace and memory usage, to a DBA &lt;a href="http://www.gotalkmobile.com/"&gt;GTalk mobile application&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Sent instant stock alerts in a retailer application.&lt;/li&gt;&lt;li&gt;Monitor workers presence (connected users into a private &lt;a href="http://www.jabber.org/"&gt;Jabber&lt;/a&gt; server) by a HR application.&lt;/li&gt;&lt;li&gt;Any application which sends email notifications and wants instant messaging replacement. &lt;/li&gt;&lt;/ul&gt;OK, &lt;a href="http://marcelo.ochoa.googlepages.com/ojvmTalk.sql"&gt;here the script&lt;/a&gt;, the script performs these steps:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create a new account to hold &lt;a href="http://www.igniterealtime.org/downloads/index.jsp"&gt;Smack Java XMPP stack implementation&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Load smack.jar using loadjava tool before create a &lt;span style="font-weight: bold; font-style: italic;"&gt;MessageSender&lt;/span&gt; class, look at the comments inside the script.&lt;/li&gt;&lt;li&gt;Create a class &lt;span style="font-weight: bold; font-style: italic;"&gt;MessageSender&lt;/span&gt; which is basically the same class showed at OTN web site but with a wrapper to create, compile and resolve inside the OJVM.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Crate a PLSQL callspec.&lt;/li&gt;&lt;li&gt;And finally a test case which creates a trigger attached to a sample table and which sends message to an specific Google account.&lt;/li&gt;&lt;/ul&gt;Hope this code example and tell me if there other sample applications of using XMPP stack inside the OJVM ;)&lt;br /&gt;Finally, I would like to remark again the power of Java inside the Oracle database, this is another example of it. Remember that for sending email messages in older Oracle releases you need UTL_MAIL package which in many cases do not solve all the application need.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-1300641544207112034?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/1300641544207112034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=1300641544207112034' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/1300641544207112034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/1300641544207112034'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2008/04/can-oracle-talk-with-you.html' title='Can Oracle talk with you?'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-5298736099142825892</id><published>2008-02-19T11:38:00.000-08:00</published><updated>2008-02-22T03:15:20.178-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOAP'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Services'/><category scheme='http://www.blogger.com/atom/ns#' term='Restlet'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle JVM'/><title type='text'>Is Oracle 11g REST ready?</title><content type='html'>&lt;span style="font-size:85%;"&gt;YES, if you have Oracle JVM installed!!&lt;br /&gt;You only need to download an &lt;a href="http://marcelo.ochoa.googlepages.com/ojvm-restlet.tar.gz"&gt;XMLDB REST adapter&lt;/a&gt; for &lt;a href="http://www.restlet.org/"&gt;Restlet framework&lt;/a&gt; and thats all.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;But why users want to use REST stack inside Oracle databases if it comes with Native Web Services support using SOAP?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;This is an open discussion over Internet, here one example at InfoQ web site - "&lt;a href="http://www.infoq.com/news/2007/05/is-rest-winning"&gt;Is REST winning?&lt;/a&gt;".&lt;br /&gt;My personal list of benefits of REST over SOAP is:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Simplicity, from developer's perspective REST WS are quite straightforward.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Leverage of all HTTP features for caching, you can use &lt;a href="http://httpd.apache.org/docs/2.2/mod/mod_cache.html"&gt;Apache mod_cache &lt;/a&gt;or better than this &lt;a href="http://www.oracle.com/technology/products/ias/web_cache/index.html"&gt;Oracle Web Cache&lt;/a&gt; and &lt;a href="http://www.akamai.com/html/support/esi.html"&gt;ESI invalidation protocol&lt;/a&gt; to speed up your WS. Also the &lt;a href="http://www.infoq.com/news/2007/11/restful-ajax-http304"&gt;HTTP's 304 return code&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Less network traffic, a simple SOAP service requires 675 bytes at POST request and 306 bytes at response, similar REST WS only requires 79 bytes at GET request and 28 bytes at response. If you have a site with million of hits these differences are a lot wasted resources.  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;But anyway, you can implement now SOAP and REST WS inside your Oracle 11g database.&lt;br /&gt;Performance result shows that you can get similar throughput (# request by second) either using SOAP native stack or REST Java stack, see this &lt;a href="http://spreadsheets.google.com/pub?key=pAl-EJ5Wtb_10aTyfnO1dUw&amp;amp;output=html"&gt;Google sheet &lt;/a&gt;with a preliminary result done using my notebook and Apache Benchmark.&lt;br /&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;Note that SOAP is 40% faster than REST, but SOAP example do not implement routing and many other things ready and used in &lt;span style="font-style: italic;"&gt;Part12.java&lt;/span&gt; REST tutorial example, but look at a the performance improvement by simply using REST/Apache mod_cache combination.&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-style: italic;"&gt;- Requeriments&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;  JDK 1.5 (included at your ORACLE_HOME/jdk directory)&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;  &lt;a href="http://maven.apache.org/download.html"&gt;Maven 2.0.x&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;  an 11g target database&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;  Internet connection to download public libraries into your local repository&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;- Install&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;XMLDB REST adapter for Oracle 11g database is build and deploy using &lt;a href="http://maven.apache.org/index.html"&gt;Apache Maven&lt;/a&gt; tool, to install and test the code, open &lt;span style="font-weight: bold; font-style: italic;"&gt;pom.xml&lt;/span&gt; file and edit section &lt;span style="font-weight: bold; font-style: italic;"&gt;properties&lt;/span&gt; with your database parameter values.&lt;br /&gt;Then in a command line execute:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;mvn clean&lt;br /&gt;mvn install&lt;/blockquote&gt;&lt;span style="font-weight: bold;"&gt;Maven&lt;/span&gt; will download all REST adapter libraries from public repositories (you need Internet connection at this point) except for Oracle libraries which are not in public sources. &lt;span style="font-weight: bold; font-style: italic;"&gt;Maven&lt;/span&gt; will show that some dependency are not resolved satisfactorily.  Using your ORACLE_HOME environment setting install it using for example:&lt;br /&gt;&lt;blockquote&gt;mvn install:install-file -DgroupId=oracle -DartifactId=ojdbc5 \&lt;br /&gt;    -Dversion=11.1.0 -Dpackaging=jar -Dfile=$ORACLE_HOME/jdbc/lib/ojdbc5.jar&lt;br /&gt;&lt;/blockquote&gt;Repeat above process for each Oracle library required, all of them are at ORACLE_HOME directory, finally execute again &lt;span style="font-style: italic;"&gt;install&lt;/span&gt; target.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;- Test&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Test your REST examples with your favorite browser using these URLs (they where configured as &lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb23jv1.htm#g1050187"&gt;XMLDB Servlets&lt;/a&gt; by &lt;span style="font-style: italic;"&gt;src/main/sql/registerServlet.sql&lt;/span&gt; script):&lt;br /&gt;&lt;blockquote&gt;http://localhost:8080/search?kwd=marcelo+ochoa&lt;br /&gt;http://localhost:8080/users/scott/orders/300&lt;br /&gt;http://localhost:8080/restlet/xx&lt;br /&gt;http://localhost:8080/hello&lt;/blockquote&gt;&lt;br /&gt;a POST example can be tested executing:&lt;br /&gt;&lt;blockquote&gt;org.restlet.example.misc.SimpleClient&lt;br /&gt;&lt;/blockquote&gt;&lt;span style="font-style: italic;"&gt;Tests using telnet&lt;/span&gt;&lt;br /&gt;Some test can be tested using telnet to see which headers are sent and get as reponse from REST WS.  At directory &lt;span style="font-style: italic;"&gt;src/main/scripts&lt;/span&gt; there are two simple examples:&lt;br /&gt;test_get.txt  (similar to http://localhost:8080/users/scott/orders/300)&lt;br /&gt;test_search.txt (similar to http://localhost:8080/search?kwd=marcelo+ochoa)&lt;br /&gt;Use file information as follow:&lt;br /&gt;&lt;blockquote&gt;[mochoa@mochoa ojvm-restlet]$ cat src/main/scripts/test_get.txt&lt;br /&gt;GET /users/scott/orders/300 HTTP/1.0&lt;br /&gt;Authorization: Basic c2NvdHQ6dGlnZXI=&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;[mochoa@mochoa ojvm-restlet]$ telnet localhost 8080&lt;br /&gt;Trying 127.0.0.1...&lt;br /&gt;Connected to live.dbprism.mochoa.dyndns.org (127.0.0.1).&lt;br /&gt;Escape character is '^]'.&lt;br /&gt;GET /users/scott/orders/300 HTTP/1.0&lt;br /&gt;Authorization: Basic c2NvdHQ6dGlnZXI=&lt;br /&gt;&lt;br /&gt;HTTP/1.1 200 OK&lt;br /&gt;MS-Author-Via: DAV&lt;br /&gt;DAV: 1,2,&lt;http: com="" xdb="" webdav="" props=""&gt;&lt;br /&gt;Date: Thu, 07 Feb 2008 18:25:13 GMT&lt;br /&gt;Server: Noelios-Restlet-Engine/1.1.1&lt;br /&gt;Content-Type: text/plain; charset=ISO-8859-1&lt;br /&gt;Content-Length: 28&lt;br /&gt;&lt;br /&gt;Order "300" for user "scott"&lt;br /&gt;&lt;br /&gt;&lt;/http:&gt;&lt;/blockquote&gt;Well this is a jump start for XMLDB REST Adapter, many things can be implemented from now, for example a XDBDirectory class which inherit from org.restlet.Directory to browse XMLDB repository, REST WS implemented with XQuery pages stored inside XMLDB, a Variant for XMLType objects and others, also We have a plan to integrate this extension to &lt;span style="font-style: italic;"&gt;Restlet&lt;/span&gt; project main trunk, I'll announce this in another post, stay connected ....&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-5298736099142825892?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/5298736099142825892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=5298736099142825892' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/5298736099142825892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/5298736099142825892'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2008/02/is-oracle-11g-rest-ready.html' title='Is Oracle 11g REST ready?'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-6364278891662897712</id><published>2007-12-18T10:24:00.000-08:00</published><updated>2007-12-18T12:47:17.942-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XMLDB WikiPedia Dumps SAXLoader Lucene Domain Index'/><title type='text'>Uploading WikiPedia Dumps to Oracle databases</title><content type='html'>&lt;div style="margin-left: 40px;"&gt;WikiPedia Dumps are a good set of documents if you want to test, for example, searching capabilities.&lt;br /&gt;&lt;a target="_blank" title="WikiMedia Download Web Site" href="http://download.wikimedia.org/" id="r:9x"&gt;WikiMedia Download Web Site&lt;/a&gt; have XML dumps for all WikiPedia Web sites especially they have a very big compressed dumps of &lt;a target="_blank" title="all the pages en English" href="http://download.wikimedia.org/enwiki/latest/enwiki-latest-pages-articles.xml.bz2" id="yile"&gt;all the pages in English&lt;/a&gt; which his size is around 3Gbytes.&lt;br /&gt;So with this very big XML file, We would like to load to a regular Oracle tables.&lt;br /&gt;There is a plenty of &lt;a title="utility for uploading WikiPedia Dump" href="http://meta.wikimedia.org/wiki/Data_dumps" id="ylbb"&gt;utilities for uploading WikiPedia Dump&lt;/a&gt; to relational databases, but none of them are tailored for Oracle.&lt;br /&gt;So, We can solve this missing part &lt;a target="_blank" title="Creating XMLType Tables and Columns Based on XMLSchema" href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb05sto.htm#g1070409" id="jfew"&gt;Creating XMLType Tables and Columns Based on XMLSchema&lt;/a&gt; and a &lt;a title="SAX upload utility" href="http://www.oracle.com/technology/sample_code/tech/xml/xmldb/saxloader/Readme.html" id="d_f-"&gt;SAX upload utility&lt;/a&gt; to upload the XML content.&lt;br /&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div style="margin-left: 40px;"&gt;&lt;span style="font-size:85%;"&gt;&lt;i&gt;Note: When you register an XML schema with Oracle XML DB, you can specify the storage model to use for the XML instance documents that reference the XML schema. If that specified storage model is binary XML, then you can only use that XML schema to create XMLType tables and columns that are stored as binary XML.&lt;/i&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;i&gt;Conversely, if the storage model specified for the registered XML schema is not binary XML, then you can only use that XML schema to create XMLType tables and columns that are not stored as binary XML, that is, stored object-relationally or as CLOB instances.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div style="margin-left: 40px;"&gt;&lt;p&gt;First, We need to annotate &lt;a target="_blank" title="WikiPedia XSD export file" href="http://www.mediawiki.org/xml/export-0.3.xsd" id="qpv8"&gt;WikiPedia XSD&lt;/a&gt;  export file to tell Oracle how to transform a page tag into an Object Type stored in a Object-Relational table, you can see a complete annotated &lt;a title="Annotated WikiDump export XSD file for Oracle" target="_blank" href="http://marcelo.ochoa.googlepages.com/export-0.3.xsd" id="brai"&gt;XSD file here&lt;/a&gt;. It basically creates a new top element named &lt;i&gt;"page"&lt;/i&gt; to give SAXLoader application a table to store all meta-data pages entries. It also creates two &lt;b&gt;XMLDB&lt;/b&gt; self managed master detail relationship from pages to revisions and pages to uploads one to many relations.&lt;/p&gt;&lt;p&gt;You can register and creates all tables with:&lt;/p&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;span style="font-size:78%;"&gt;BEGIN&lt;br /&gt; DBMS_XMLSCHEMA.registerURI(&lt;br /&gt;              'http://www.mediawiki.org/xml/export-0.3/',&lt;br /&gt;              '/public/export-0.3.xsd',&lt;br /&gt;              LOCAL=&amp;gt;TRUE,GENTYPES=&amp;gt;TRUE, GENBEAN=&amp;gt;FALSE, GENTABLES=&amp;gt;TRUE);&lt;br /&gt;END;&lt;br /&gt;/&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div style="margin-left: 40px; text-align: left;"&gt;Before execute this PLSQL block upload &lt;a title="export-0.3.xsd" target="_blank" href="http://marcelo.ochoa.googlepages.com/export-0.3.xsd" id="ozkl"&gt;export-0.3.xsd&lt;/a&gt; to &lt;i&gt;XMLDB&lt;/i&gt; repository either by using ftp or &lt;i&gt;WebDAV&lt;/i&gt; protocols to /public directory.&lt;br /&gt;After executing &lt;b&gt;registerURI&lt;/b&gt; procedure 3 new tables will be at your Oracle schema:&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;blockquote&gt;&lt;span style="font-size:78%;"&gt;SQL&amp;gt; desc pages&lt;br /&gt;Name                                      Null?    Type&lt;br /&gt;----------------------------------------- -------- ----------------------------&lt;br /&gt;TABLE of SYS.XMLTYPE(XMLSchema "http://www.mediawiki.org/xml/export-0.3/" Element "page") STORAGE Object-relational TYPE "PageType"&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; desc pages_revisions&lt;br /&gt;Name                                      Null?    Type&lt;br /&gt;----------------------------------------- -------- ----------------------------&lt;br /&gt;TABLE of SYS.XMLTYPE(XMLSchema "http://www.mediawiki.org/xml/export-0.3/" Element "revision") STORAGE Object-relational TYPE "RevisionType"&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; desc pages_uploads&lt;br /&gt;Name                                      Null?    Type&lt;br /&gt;----------------------------------------- -------- ----------------------------&lt;br /&gt;TABLE of SYS.XMLTYPE(XMLSchema "http://www.mediawiki.org/xml/export-0.3/" Element "upload") STORAGE Object-relational TYPE "UploadType"&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;        With his underlying types:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:78%;"&gt;SQL&amp;gt; desc "PageType"&lt;br /&gt;"PageType" is NOT FINAL&lt;br /&gt;&lt;div&gt;&lt;table id="e95j" border="1" bordercolor="#000000" cellpadding="3" cellspacing="0" height="170" width="410"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="33%"&gt;Name&lt;br /&gt;&lt;/td&gt;&lt;td style="text-align: right;" width="33%"&gt;Null?&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;Type&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;SYS_XDBPD$&lt;/span&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;XDB.XDB$RAW_LIST_T&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;title&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;VARCHAR2(4000 CHAR)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;id&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;NUMBER(38)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;restrictions&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;VARCHAR2(4000 CHAR)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;revision&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;XDB.XDB$XMLTYPE_REF_LIST_T&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;upload&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;XDB.XDB$XMLTYPE_REF_LIST_T&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;SQL&amp;gt; desc "RevisionType"&lt;br /&gt;"RevisionType" is NOT FINAL&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;div&gt;&lt;table id="e95j" border="1" bordercolor="#000000" cellpadding="3" cellspacing="0" height="170" width="410"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="33%"&gt;Name&lt;br /&gt;&lt;/td&gt;&lt;td style="text-align: right;" width="33%"&gt;Null?&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;Type&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;SYS_XDBPD$&lt;/span&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;XDB.XDB$RAW_LIST_T&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;id&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;NUMBER(38)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;timestamp&lt;/span&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;VARCHAR2(4000 CHAR)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;contributor&lt;/span&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;ContributorType&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;comment&lt;/span&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-size:78%;"&gt;VARCHAR2(4000 CHAR)&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;&lt;b&gt;text&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;b&gt;CLOB&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;SQL&amp;gt; desc "UploadType"&lt;br /&gt;"UploadType" is NOT FINAL&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;div&gt;&lt;table id="e95j" border="1" bordercolor="#000000" cellpadding="3" cellspacing="0" height="170" width="410"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="33%"&gt;Name&lt;br /&gt;&lt;/td&gt;&lt;td style="text-align: right;" width="33%"&gt;Null?&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;Type&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;SYS_XDBPD$&lt;/span&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;XDB.XDB$RAW_LIST_T&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;timestamp&lt;/span&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;VARCHAR2(4000 CHAR)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;contributor&lt;/span&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;ContributorType&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;comment&lt;/span&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;VARCHAR2(4000 CHAR)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;filename&lt;/span&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-size:78%;"&gt;VARCHAR2(4000 CHAR)&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;src&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;VARCHAR2(4000 CHAR)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="33%"&gt;size&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td width="33%"&gt;&lt;span style="font-size:78%;"&gt;NUMBER(38)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div style="margin-left: 40px; text-align: left;"&gt;By using 3 tables We can choose to index some columns with any supported index provided by Oracle.&lt;br /&gt;Also annotated schema tells to Oracle that use a &lt;i&gt;CLOB&lt;/i&gt; column for storing user edited text (column &lt;b&gt;text&lt;/b&gt; of table &lt;b&gt;pages_revisions&lt;/b&gt;).&lt;br /&gt;Shearing &lt;b&gt;WikiDumps&lt;/b&gt; XML files with an &lt;b&gt;XMLDB&lt;/b&gt; annotated schema provides an object-relational storage for an unstructured data.&lt;br /&gt;Finally for uploading any WikiPedia Dump XML file using &lt;a title="OTN example SAXLoader" target="_blank" href="http://www.oracle.com/technology/sample_code/tech/xml/xmldb/saxloader/Readme.html" id="e6e."&gt;OTN example SAXLoader&lt;/a&gt; We use a modified configuration file like:&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;blockquote&gt;&lt;span style="font-size:78%;"&gt;&amp;lt;?xml version='1.0' encoding='windows-1252'?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&amp;lt;Connection&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;Driver&amp;gt;OCI&amp;lt;/Driver&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;Hostname&amp;gt;localhost&amp;lt;/Hostname&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;Port&amp;gt;1521&amp;lt;/Port&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;ServiceName&amp;gt;orcl&amp;lt;/ServiceName&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;SID&amp;gt;orcl&amp;lt;/SID&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;ServerMode&amp;gt;DEDICATED&amp;lt;/ServerMode&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;Schema&amp;gt;eswiki&amp;lt;/Schema&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;Password&amp;gt;eswiki&amp;lt;/Password&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;SourceXML&amp;gt;/home/backup/eswiki-20071202-pages-articles.xml&amp;lt;/SourceXML&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;Element&amp;gt;page&amp;lt;/Element&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;SchemaURL&amp;gt;http://www.mediawiki.org/xml/export-0.3/&amp;lt;/SchemaURL&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;Table&amp;gt;PAGES&amp;lt;/Table&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;ThreadCount&amp;gt;2&amp;lt;/ThreadCount&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;CommitCharge&amp;gt;25&amp;lt;/CommitCharge&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;  &amp;lt;Logger&amp;gt;FILE&amp;lt;/Logger&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&amp;lt;/Connection&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;p style="margin-left: 40px;"&gt;Using a modest hardware and uploading Spanish WikiPedia Dump We can see upload output as:&lt;/p&gt;&lt;blockquote&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size:78%;"&gt;[mochoa@p1 build]$ more TraceOutputFile-20074317184301.log&lt;br /&gt;Connection Settings =&lt;br /&gt;&amp;lt;?xml version = '1.0' encoding = 'windows-1252'?&amp;gt;&lt;br /&gt;&amp;lt;Connection&amp;gt;&lt;br /&gt;&amp;lt;Driver&amp;gt;OCI&amp;lt;/Driver&amp;gt;&lt;br /&gt;&amp;lt;Hostname&amp;gt;localhost&amp;lt;/Hostname&amp;gt;&lt;br /&gt;&amp;lt;Port&amp;gt;1521&amp;lt;/Port&amp;gt;&lt;br /&gt;&amp;lt;ServiceName&amp;gt;orcl&amp;lt;/ServiceName&amp;gt;&lt;br /&gt;&amp;lt;SID&amp;gt;orcl&amp;lt;/SID&amp;gt;&lt;br /&gt;&amp;lt;ServerMode&amp;gt;DEDICATED&amp;lt;/ServerMode&amp;gt;&lt;br /&gt;&amp;lt;Schema&amp;gt;eswiki&amp;lt;/Schema&amp;gt;&lt;br /&gt;&amp;lt;Password&amp;gt;eswiki&amp;lt;/Password&amp;gt;&lt;br /&gt;&amp;lt;SourceXML&amp;gt;/home/backup/eswiki-20071202-pages-articles.xml&amp;lt;/SourceXML&amp;gt;&lt;br /&gt;&amp;lt;Element&amp;gt;page&amp;lt;/Element&amp;gt;&lt;br /&gt;&amp;lt;SchemaURL&amp;gt;http://www.mediawiki.org/xml/export-0.3/&amp;lt;/SchemaURL&amp;gt;&lt;br /&gt;&amp;lt;Table&amp;gt;PAGES&amp;lt;/Table&amp;gt;&lt;br /&gt;&amp;lt;ThreadCount&amp;gt;2&amp;lt;/ThreadCount&amp;gt;&lt;br /&gt;&amp;lt;CommitCharge&amp;gt;25&amp;lt;/CommitCharge&amp;gt;&lt;br /&gt;&amp;lt;Logger&amp;gt;FILE&amp;lt;/Logger&amp;gt;&lt;br /&gt;&amp;lt;StartCount&amp;gt;0&amp;lt;/StartCount&amp;gt;&lt;br /&gt;&amp;lt;EndCount&amp;gt;10&amp;lt;/EndCount&amp;gt;&lt;br /&gt;&amp;lt;/Connection&amp;gt;&lt;br /&gt;&lt;br /&gt;Driver = OCI&lt;br /&gt;Hostname = localhost&lt;br /&gt;Port = 1521&lt;br /&gt;ServiceName = orcl&lt;br /&gt;Server = DEDICATED&lt;br /&gt;Schema = eswiki&lt;br /&gt;Password = eswiki&lt;br /&gt;Logger = FILE&lt;br /&gt;Database URL = jdbc:oracle:oci8:@(description=(address=(host=localhost)(protocol=tcp)(port=1521))(connect_data=(service_name=orcl)(server=DEDI&lt;br /&gt;CATED)))&lt;br /&gt;BaseApplication.getConnection(): Connecting as eswiki/eswiki@jdbc:oracle:oci8:@(description=(address=(host=localhost)(protocol=tcp)(port=1521)&lt;br /&gt;)(connect_data=(service_name=orcl)(server=DEDICATED)))&lt;br /&gt;BaseApplication.getConnection(): Database Connection Established&lt;br /&gt;BaseApplication.getConnection(): Connecting as eswiki/eswiki@jdbc:oracle:oci8:@(description=(address=(host=localhost)(protocol=tcp)(port=1521)&lt;br /&gt;)(connect_data=(service_name=orcl)(server=DEDICATED)))&lt;br /&gt;Thread Writer_000001 started at Dec 17, 2007 6:43:01 PM ART&lt;br /&gt;Thread Writer_000001 using SQL : insert into PAGES values (xmltype(?).createSchemaBasedXML('http://www.mediawiki.org/xml/export-0.3/'))&lt;br /&gt;BaseApplication.getConnection(): Database Connection Established&lt;br /&gt;Thread Writer_000002 started at Dec 17, 2007 6:43:02 PM ART&lt;br /&gt;Thread Writer_000002 using SQL : insert into PAGES values (xmltype(?).createSchemaBasedXML('http://www.mediawiki.org/xml/export-0.3/'))&lt;br /&gt;Thread Writer_000002 committed after 25 records.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;..............&lt;br /&gt;Thread Writer_000002 committed after 25 records.&lt;br /&gt;Thread Writer_000001 completed at Dec 17, 2007 6:43:01 PM ART&lt;br /&gt;Thread Writer_000002 completed at Dec 17, 2007 6:43:02 PM ART&lt;br /&gt;Documents Queued = 583141. Docuuments De-Queued = 583141. Documents Written = 583141.&lt;br /&gt;Writer_000001,Dec 17, 2007 6:43:01 PM ART,Dec 17, 2007 8:12:12 PM ART,293139,805,110,181&lt;br /&gt;Writer_000002,Dec 17, 2007 6:43:02 PM ART,Dec 17, 2007 8:12:12 PM ART,290002,806,416,309&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;p style="margin-left: 40px;"&gt;It took around of one hour and a half for uploading 583141 pages and 1.61Gbytes.&lt;/p&gt;&lt;blockquote&gt;&lt;p style="margin-left: 40px;"&gt;&lt;span style="font-size:85%;"&gt;&lt;i&gt;Note: this importing example works only on 11g databases because many WikiPedia pages have more than 64K of XML size and this is a limitation on 10g databases.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="margin-left: 40px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 style="text-align: left;"&gt;Adding more SQL like functionality to WikiDump XML information.&lt;/h2&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;Adding a primary key constraint using &lt;i&gt;XPath&lt;/i&gt; &lt;b&gt;/page/id&lt;/b&gt; information:&lt;/p&gt;&lt;div style="text-align: left;"&gt;&lt;blockquote&gt;&lt;span style="font-size:78%;"&gt;alter table pages add CONSTRAINT pages_pkey PRIMARY KEY (XMLDATA."id");&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;This constraint will be helpful for queries like:&lt;/p&gt;&lt;div style="text-align: left;"&gt;&lt;blockquote&gt;&lt;span style="font-size:78%;"&gt;SELECT extract(object_value,'/page/revision/text/text()') "text"&lt;br /&gt;FROM ESWIKI.PAGES where extractValue(object_value,'/page/id')=10&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;which produces an execution plan like:&lt;/p&gt;&lt;div&gt;&lt;table style="text-align: left; margin-left: 0px; margin-right: auto; color: rgb(0, 0, 0);" border="1" cellpadding="0" cellspacing="0" width="100%"&gt;  &lt;tbody&gt;&lt;tr&gt;&lt;th&gt;&lt;span style="font-size:78%;"&gt;Optimizer&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Cost&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Cardinality&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Bytes&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Partition Start&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Partition Stop&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Partition Id&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;ACCESS PREDICATES&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;FILTER PREDICATES&lt;/span&gt;&lt;/th&gt;   &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;SELECT STATEMENT&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;ALL_ROWS&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;43&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;SORT(AGGREGATE)&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;2069&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;NESTED LOOPS&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;NESTED LOOPS&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;3&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;2069&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;TABLE ACCESS(BY INDEX ROWID) ESWIKI.SYS_NTQY2zg8+I6PngQAB/AQAq6g==&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;2&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;37&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;INDEX(RANGE SCAN) ESWIKI.SYS_C007197&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;2&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;"NESTED_TABLE_ID"=:B1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;INDEX(UNIQUE SCAN) ESWIKI.SYS_C007203&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;0&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;"SYS_ALIAS_0"."COLUMN_VALUE"="PAGES_REVISIONS"."SYS_NC_OID$"&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;TABLE ACCESS(BY INDEX ROWID) ESWIKI.PAGES_REVISIONS&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;2032&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;SYS_CHECKACL("ACLOID","OWNERID",xmltype(''))=1&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;TABLE ACCESS(BY INDEX ROWID) ESWIKI.PAGES&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;43&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;SYS_CHECKACL("ACLOID","OWNERID",xmltype(''))=1&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;INDEX(UNIQUE SCAN) ESWIKI.PAGES_PKEY&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;ANALYZED&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;0&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;"PAGES"."SYS_NC00010$"=10&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;&lt;/p&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;and a unique constraint to prevent duplicate revision pages and faster access to an specific revision:&lt;/p&gt;&lt;div style="text-align: left;"&gt;&lt;blockquote&gt;&lt;span style="font-size:78%;"&gt;alter table pages_revisions add CONSTRAINT pages_revisions_ukey UNIQUE (XMLDATA."id");&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;&lt;b&gt;pages_revisions&lt;/b&gt; table already have a primary key generated by the master detail relation discovered by the &lt;i&gt;XSD to object-relational&lt;/i&gt; transformation, but with this unique constraint you can query directly &lt;b&gt;pages_revisions&lt;/b&gt; table if you want to look-up an specific revision content:&lt;/p&gt;&lt;div style="text-align: left;"&gt;&lt;blockquote&gt;&lt;span style="font-size:78%;"&gt;SELECT extract(object_value,'/revision/text/text()') "text"&lt;br /&gt;FROM ESWIKI.PAGES_REVISIONS where extractValue(object_value,'/revision/id')=13207462&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;which produces this execution plan:&lt;/p&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;table style="text-align: left; margin-left: 0px; margin-right: auto; color: rgb(0, 0, 0);" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr&gt;&lt;th&gt;&lt;span style="font-size:78%;"&gt;Optimizer&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Cost&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Cardinality&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Bytes&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Partition Start&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Partition Stop&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Partition Id&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;ACCESS PREDICATES&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;FILTER PREDICATES&lt;/span&gt;&lt;/th&gt;   &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;SELECT STATEMENT&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;ALL_ROWS&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;2035&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;TABLE ACCESS(BY INDEX ROWID) ESWIKI.PAGES_REVISIONS&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;2035&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;SYS_CHECKACL("ACLOID","OWNERID",xmltype(''))=1&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;INDEX(UNIQUE SCAN) ESWIKI.PAGES_REVISIONS_UKEY&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;ANALYZED&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;0&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;"PAGES_REVISIONS"."SYS_NC00009$"=13207462&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;Finally We can index with &lt;a title="Running Lucene inside your Oracle JVM" target="_blank" href="http://marceloochoa.blogspot.com/2007/09/running-lucene-inside-your-oracle-jvm.html" id="lgsb"&gt;Lucene Domain Index&lt;/a&gt; using:&lt;/p&gt;&lt;blockquote&gt;&lt;span style="font-size:78%;"&gt;create index pages_lidx on pages p (value(p))&lt;br /&gt;indextype is Lucene.LuceneIndex&lt;br /&gt;parameters('LogLevel:INFO;Stemmer:Spanish;ExtraCols:extractValue(object_value,''/page/title'') "title",extract(object_value,''/page/revision/text/text()'') "text";IncludeMasterColumn:false;SyncMode:OnLine;BatchCount:1000;LobStorageParameters:PCTVERSION 0 ENABLE STORAGE IN ROW CHUNK 32768 CACHE READS FILESYSTEM_LIKE_LOGGING');&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;Here a detailed parameter usage at Lucene Domain Index:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;LogLevel:INFO&lt;/i&gt;, causes that Lucene Domain Index sent logging information to Oracle .trc files&lt;/li&gt;&lt;li&gt;&lt;i&gt;Stemmer:Spanish&lt;/i&gt;, as you can see at SAXLoader configuration file We had uploaded Spanish WikiPedia Dump.&lt;/li&gt;&lt;li&gt;&lt;i&gt;ExtraCols:extractValue(object_value,''/page/title'') "title",extract(object_value,''/page/revision/text/text()'') "text"&lt;/i&gt;, We would like to index only &lt;b&gt;title&lt;/b&gt; and &lt;b&gt;text&lt;/b&gt; of XML page node.&lt;/li&gt;&lt;li&gt;&lt;i&gt;IncludeMasterColumn:false&lt;/i&gt;, We don't want to index all XML content of PAGES's object type row, but We would like to be notified by ODCI API when this row is changed.&lt;/li&gt;&lt;li&gt;&lt;i&gt;SyncMode:OnLine&lt;/i&gt;, Lucene Domain index will performs a full scan on PAGES table en-queueing for insert all his rowids and returns a control to the application, then DBMS_AQ CallBack will index PAGES table in background.&lt;/li&gt;&lt;li&gt;&lt;i&gt;BatchCount:1000&lt;/i&gt;, to reduce Oracle databases resources consumed by DBMS_AQ Callback during initial indexing process batch process takes 1000 rows index them and exits.&lt;/li&gt;&lt;li&gt;&lt;i&gt;LobStorageParameters:PCTVERSION 0 ENABLE STORAGE IN ROW CHUNK 32768 CACHE READS FILESYSTEM_LIKE_LOGGING&lt;/i&gt;, Oracle 11g specific parameter for using Secure LOB.&lt;/li&gt;&lt;/ul&gt;&lt;div style="margin-left: 40px;"&gt;Immediately after create index command returns, you can start querying Lucene Domain Index because read-only access is permitted during background build process. For example:&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;span style="font-size:78%;"&gt;SQL&amp;gt; select LuceneDomainIndex.countHits('ESWIKI.PAGES_LIDX','title:Argentina') from dual;&lt;br /&gt;&lt;br /&gt;LUCENEDOMAININDEX.COUNTHITS('ESWIKI.PAGES_LIDX','TITLE:ARGENTINA')&lt;br /&gt;------------------------------------------------------------------&lt;br /&gt;                                                             117&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;After each batch of 1000 rows is done this value will be increased. Here other example:&lt;/p&gt;&lt;blockquote&gt;&lt;p style="text-align: left;"&gt;&lt;span style="font-size:78%;"&gt;select lscore(1),extractValue(object_value,'/page/title') from pages&lt;br /&gt;where lcontains(object_value,'rownum:[1 TO 5] AND title:Argentina AND text:indigenas',1)&amp;gt;0&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;span style="font-size:78%;"&gt;1                                         Argentina&lt;br /&gt;0.641046464443206787109375    Noroeste argentino&lt;br /&gt;0.625011622905731201171875    Paraná (Argentina)&lt;br /&gt;0.623125135898590087890625    Córdoba (Argentina)&lt;br /&gt;0.601441204547882080078125    Categoría:Indígenas de Argentina&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;With his execution plan:&lt;/p&gt;&lt;div&gt;&lt;table style="color: rgb(0, 0, 0);" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr&gt;&lt;th&gt;&lt;span style="font-size:78%;"&gt;Optimizer&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Cost&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Cardinality&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Bytes&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Partition Start&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Partition Stop&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;Partition Id&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;ACCESS PREDICATES&lt;/span&gt;&lt;/th&gt;  &lt;th&gt;&lt;span style="font-size:78%;"&gt;FILTER PREDICATES&lt;/span&gt;&lt;/th&gt;   &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;SELECT STATEMENT&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;ALL_ROWS&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;3658&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;28633&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;281891885&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;TABLE ACCESS(BY INDEX ROWID) ESWIKI.PAGES&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;3658&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;28633&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;281891885&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;SYS_CHECKACL("ACLOID","OWNERID",xmltype(''))=1&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;DOMAIN INDEX ESWIKI.PAGES_LIDX&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;"LUCENE"."LCONTAINS"(SYS_MAKEXML('418347400648C734E040A8C0030115A3',4889,"XMLEXTRA","XMLDATA"),'rownum:[1 TO 5] AND title:Argentina AND text:indigenas',1)&amp;gt;0&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="text-align: left;"&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p style="text-align: left; margin-left: 40px;"&gt;&lt;span style="font-size:85%;"&gt;&lt;i&gt;Note: We are querying for pages which contains "indigenas" at &lt;/i&gt;&lt;b&gt;&lt;i&gt;text&lt;/i&gt;&lt;/b&gt;&lt;i&gt; node, but this node is stored at PAGES_REVISIONS table but the query can be resolved without accessing to details table, all the information is stored at Lucene inverted structure and lcontains operator returns the correct set of &lt;/i&gt;&lt;b&gt;&lt;i&gt;rowids&lt;/i&gt;&lt;/b&gt;&lt;i&gt; to Oracle engine to performs a fetch operation &lt;/i&gt;&lt;b&gt;&lt;i&gt;by index rowid&lt;/i&gt;&lt;/b&gt;&lt;i&gt; which is a faster execution look-up plan. Also, We are using pagination information injected at lcontains operators which eliminates usage of Top-N Oracle syntax.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="margin-left: 40px; text-align: left;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-6364278891662897712?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/6364278891662897712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=6364278891662897712' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/6364278891662897712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/6364278891662897712'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2007/12/uploading-wikipedia-dumps-to-oracle.html' title='Uploading WikiPedia Dumps to Oracle databases'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-2776015619403651969</id><published>2007-11-21T02:55:00.000-08:00</published><updated>2007-11-21T03:27:57.954-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PLSQL sleep procedure Oracle JVM DBMS_LOCK'/><title type='text'>PLSQL sleep functionality</title><content type='html'>Usually there is code which wants to sleep for certain amount of time and following his execution.&lt;br /&gt;Java developers use Thread.sleep method for doing that, but PLSQL developer don't have a similar functionality.&lt;br /&gt;There is a package named DBMS_LOCK with an sleep procedure, but his functionality expose other sensitive functionality and reading &lt;a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lock.htm#sthref3898"&gt;Oracle documentation&lt;/a&gt; you can see this warning:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote style="font-style: italic;"&gt;"Consider granting the EXECUTE privilege only to specific users or roles."&lt;/blockquote&gt;With this point in mind and with a little help from &lt;span style="font-weight: bold;"&gt;Oracle JVM&lt;/span&gt; you can get an sleep procedure for your PLSQL applications or test suites, compile using SQLPlus:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;set define ?&lt;br /&gt;&lt;br /&gt;create or replace and compile java source named "my.Sleep" as&lt;br /&gt;package my;&lt;br /&gt;import java.lang.Thread;&lt;br /&gt;public class Sleep {&lt;br /&gt;     public static void main(String []args) throws java.lang.InterruptedException {&lt;br /&gt;           if (args != null &amp;amp;&amp;amp; args.length&gt;0) {&lt;br /&gt;                 int s = Integer.parseInt(args[0]);&lt;br /&gt;              Thread.sleep(s*1000);&lt;br /&gt;           } else&lt;br /&gt;              Thread.sleep(1000);&lt;br /&gt;         }&lt;br /&gt;}&lt;br /&gt;/&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;Above code creates a simple Java class which calls to Thread.sleep method passing an integer value expressing how many second you can sleep.&lt;br /&gt;Now, to be ready to use from PLSQL you need to wrap it as procedure, here the code:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;create or replace procedure waitSeconds(seconds IN VARCHAR2) as LANGUAGE JAVA NAME&lt;br /&gt;   'my.Sleep.main(java.lang.String [])';&lt;br /&gt;/&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Now you can simple test the procedure with SQLPlus:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;SQL&gt; exec waitSeconds('5');&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:05.01&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;You can compile this code as SYS and grant execute to public, it will not expose security holes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-2776015619403651969?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/2776015619403651969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=2776015619403651969' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/2776015619403651969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/2776015619403651969'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2007/11/plsql-sleep-functionality.html' title='PLSQL sleep functionality'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-4934471949485819216</id><published>2007-11-21T02:21:00.000-08:00</published><updated>2011-12-28T04:37:58.266-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Logging Oracle JVM'/><title type='text'>Getting logging entering, exiting and throwing work at Oracle JVM</title><content type='html'>Java Logging package comes with JDK 1.4 and up so is included inside Oracle JVM.&lt;br /&gt;Log4j package is a powerful and standard &lt;span style="font-style: italic;"&gt;defacto&lt;/span&gt; package for logging, I am used it a lot for several year in my code inside Oracle JVM.&lt;br /&gt;But, if you don't want to add another external dependency in your code and do not need powerful logging capabilities, you can use &lt;span style="font-style: italic;"&gt;java.util.logging&lt;/span&gt; package which is already installed on 10g and 11g databases.&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B1fwyTi0k18ZMWYzMjQ3MTYtOWUxNy00NWZiLThiZTQtNzkzNTE3NzZlNzIy" target="_blank"&gt;TestLog.sql&lt;/a&gt; is a simple test suite which uses logging console handler, the output log using SQLPlus is:&lt;br /&gt;&lt;blockquote&gt;SQL&amp;gt; Hello world&lt;br /&gt;Nov 21, 2007 9:11:23 AM my.LogTest main&lt;br /&gt;SEVERE: main forced exception/ by zero&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:00.80&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;As you can see entering, exiting and throwing methods does not print messages and logger &lt;span style="font-style: italic;"&gt;setLevel&lt;/span&gt; is defined to ALL. This is because logging level used by these methods are controlled by ConsoleHandler level.&lt;br /&gt;To get these methods work copy logging.properties file from your &lt;span style="font-style: italic;"&gt;JAVA_HOME/jre/lib&lt;/span&gt; to &lt;span style="font-style: italic;"&gt;ORACLE_HOME/javavm/lib&lt;/span&gt; directory and edit the line which includes level property:&lt;br /&gt;&lt;blockquote&gt;# Limit the message that are printed on the console to INFO and above.&lt;br /&gt;java.util.logging.ConsoleHandler.level = &lt;span style="font-weight: bold;"&gt;ALL&lt;/span&gt;&lt;br /&gt;java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;Then shutdown and startup your Oracle database an re-test the code again, SQLPlus output will be:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;SQL&amp;gt; exec Say('Hello world');&lt;br /&gt;Dec 28, 2011 9:12:24 AM my.LogTest main&lt;br /&gt;FINER: ENTRY Hello world&lt;br /&gt;args[0]= Hello world&lt;br /&gt;Dec 28, 2011 9:12:24 AM my.LogTest main&lt;br /&gt;FINER: THROW&lt;br /&gt;java.lang.ArithmeticException: / by zero&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at my.LogTest.main(LogTest:26)&lt;br /&gt;Dec 28, 2011 9:12:24 AM my.LogTest main&lt;br /&gt;FINER: RETURN 1&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;This solve the problem and you can go back to another level by changing your code at the static initializer block.&lt;br /&gt;Remember that users who want to use Java Logging package requires &lt;span style="font-style: italic;"&gt;dbms_java.grant_permission('SCOTT','SYS:java.util.logging.LoggingPermission', 'control', '' );&lt;/span&gt; for example.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-4934471949485819216?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/4934471949485819216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=4934471949485819216' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/4934471949485819216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/4934471949485819216'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2007/11/getting-logging-entering-exiting-and.html' title='Getting logging entering, exiting and throwing work at Oracle JVM'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-6769183899911903873</id><published>2007-10-05T10:04:00.000-07:00</published><updated>2007-10-05T12:18:03.054-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Source Connection Pooling and Caching'/><category scheme='http://www.blogger.com/atom/ns#' term='JDBC'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>Using native Oracle Data Source and connection caching/pooling from Spring</title><content type='html'>&lt;span style="font-size:85%;"&gt;A friend of mine told me that have several problem using and configuring connection pooling from Spring against Oracle.&lt;br /&gt;So, I remember a nice hack to use Oracle native connection pooling and caching using Oracle DataSource object.&lt;br /&gt;Since JDBC 10g (I think) Oracle provide a J2EE compliant DataSource with native connection pooling and caching, here &lt;a href="http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/concache.htm"&gt;latest documentation&lt;/a&gt;.&lt;br /&gt;So why not use this Data Source direct within Spring applicationContext.xml file (&lt;a href="http://marcelo.ochoa.googlepages.com/applicationContext.xml"&gt;see this example&lt;/a&gt;)&lt;br /&gt;&lt;/span&gt;This bean (dataSource) then can be reference from any other Spring bean which requires a data source for connecting to the database.&lt;br /&gt;&lt;div style="direction: ltr;"&gt;&lt;span style="font-size:85%;"&gt; URL property can be any thin or oci8 string, specially you can choose DEDICATED server mode, faster for middle tier-database traffic, or Transparent Failover configuration, here some examples extracted from Oracle &lt;a href="http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/urls.htm#BEIDBFDF"&gt;docs&lt;/a&gt;, click here to see &lt;a href="http://marcelo.ochoa.googlepages.com/jdbc.properties"&gt;jdbc.properties&lt;/a&gt; example.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;  Hope this help.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-6769183899911903873?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/6769183899911903873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=6769183899911903873' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/6769183899911903873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/6769183899911903873'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2007/10/using-native-oracle-data-source-and.html' title='Using native Oracle Data Source and connection caching/pooling from Spring'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-8407247566868563680</id><published>2007-09-25T07:02:00.000-07:00</published><updated>2007-09-25T08:09:28.577-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Oracle Integration Java Data Cartridge API JIT SECURE LOB'/><title type='text'>Turbocharge your  Oracle JVM applications with 11g</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;As a part of performance testing of Oracle - Lucene integration, &lt;a href="http://marceloochoa.blogspot.com/2007/09/running-lucene-inside-your-oracle-jvm.html"&gt;see previous post&lt;/a&gt;.&lt;br /&gt;I had compared index creation time between Oracle 10gR2 and 11g.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Sure these are not official and well designed tests, but it shows many good reason to migrate Oracle JVM application to 11g.&lt;br /&gt;I had created a simple test table on 10g database as:&lt;br /&gt;&lt;blockquote&gt;create table test_source_big as (select * from all_sources);&lt;/blockquote&gt;Then, I had exported this table to 11g version to be sure that I am using similar data.&lt;br /&gt;Finally creating a Lucene Domain Index at &lt;span style="font-weight: bold; font-style: italic;"&gt;text&lt;/span&gt; column with:&lt;br /&gt;11g version:&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;SQL&gt; create index source_big_lidx on test_source_big(text)&lt;br /&gt; 2  indextype is lucene.LuceneIndex&lt;br /&gt; 3  parameters('MaxBufferedDocs:500;MergeFactor:500;LobStorageParameters:PCTVERSION 0 ENABLE STORAGE IN ROW CHUNK 32768 CACHE READS FILESYSTEM_LIKE_LOGGING');&lt;br /&gt;&lt;br /&gt;Index created.&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Elapsed:&lt;/span&gt; 00:04:54.86&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;10g version:&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;blockquote&gt;SQL&gt; create index source_big_lidx on test_source_big(text)&lt;br /&gt;    2  indextype is lucene.LuceneIndex&lt;br /&gt; 3 parameters('MaxBufferedDocs:500;MergeFactor:500;LobStorageParameters:PCTVERSION 0 ENABLE STORAGE IN ROW CHUNK 32768 CACHE READS NOLOGGING');&lt;br /&gt;&lt;br /&gt;Index created.&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Elapsed:&lt;/span&gt; 00:14:47.27&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Note Elapsed time!!!, but this is not all.&lt;br /&gt;- 11g database is running on a VMWare Virtual Machine with Red Hat AS 4.0 hosted on Windows XP and configured with 1024Mb of RAM/Pentium Mobile 1.46Ghz&lt;br /&gt;- 10g database is running native in a Mandriva 2007.1 with 2048Mb of RAM Pentium IV 2.26Gz.&lt;br /&gt;There is not only difference between processor/memory, also there is difference running in native versus virtualized mode which usually is a 10 to 25% percent of overhead. All conditions are better for 10g but 11g still faster.&lt;br /&gt;So why this number?&lt;br /&gt;First 11g used a &lt;a href="http://download.oracle.com/docs/cd/B28359_01/java.111/b31225/chnine.htm#BABCDHHF"&gt;JIT&lt;/a&gt; technology compiling on the fly methods at classes executed intensively, second we are using latest &lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28393/adlob_smart.htm#sthref91"&gt;SECURE LOB&lt;/a&gt; implementation.&lt;br /&gt;On 10g I had already NCOMPed all Lucene classes but its not enough to get it faster than 11g.&lt;br /&gt;Lucene Domain Index create operation is an intensive Java/BLOB operation and in this example there are:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt; 4864 Temporary BLOB creation/deletion.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt; 4864 insert into .... with rows including a previous BLOB information.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt; 4420 update ... set deleted='Y' where name = ?, in means 4420 rows discarded when merge into new segments.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt; 3537 select .... from ... where name = ?, these are segment reads before merge into a new one.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt; Finally the index size around 37Mb divided into 442 segments.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-8407247566868563680?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/8407247566868563680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=8407247566868563680' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/8407247566868563680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/8407247566868563680'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2007/09/turbocharge-your-oracle-jvm.html' title='Turbocharge your  Oracle JVM applications with 11g'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-4205304054012349194</id><published>2007-09-24T04:35:00.000-07:00</published><updated>2007-09-24T10:00:48.552-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Lucene Oracle Integration Java Data Cartridge API'/><title type='text'>Running Lucene inside your Oracle JVM</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Since October of 2006 a new way to use &lt;a href="http://issues.apache.org/jira/browse/LUCENE-724"&gt;Lucene is ready to use&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;You can run Lucene inside your Oracle JVM because is pure Java Framework and get all benefits of them for your Oracle Application.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;font-size:85%;" &gt;Why do I use Lucene inside Oracle?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Oracle include a full feature Enterprise Engine named &lt;a href="http://www.oracle.com/technology/products/text/index.html"&gt;Oracle Text&lt;/a&gt; made in C and fully integrated to the Oracle Engine, but:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;you can not control which functionality will be included into next release&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;and you can not easily customize it for your needs&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;So why not load Lucene inside the Oracle JVM and integrate it to the Engine.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Luckily Oracle provides a &lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28425/toc.htm"&gt;Data Cartridge API&lt;/a&gt;, a powerful connector to implement custom index called Domain Index, Oracle Text is implemented using this API.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;So uploading Lucene into the Oracle JVM and implementing a Domain Index is good option for many applications. &lt;a href="http://dbprism.cvs.sourceforge.net/dbprism/ojvm/"&gt;OJVMDirectory&lt;/a&gt; is this option, the name is related to the component used to replace Lucene File System Storage by BLOB storage, here a simple list of points take into account to choose this storage:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;" class="alternate" type="square"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Using traditional File System for storing the inverted index is not a good option for some users.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Using BLOB for storing the inverted index running Lucene outside the Oracle database has a bad performance because there are a lot of network round trips and data marshallings.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Indexing relational data stores such as tables with VARCHAR2, CLOB or XMLType with Lucene running outside the database has the same problem as the previous point.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;The JVM included inside the Oracle database can scale up to 10.000+ concurrent threads without memory leaks or deadlock and all the operations on tables are in the same memory space!!&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Also there are some important points integrating Lucene by using Oracle Data Cartridge API:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;" class="alternate" type="square"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Changes on rows are automatically notified to Lucene, now these changes are enqueued using Oracle AQ. User can control if these changes are applied On Line or Deferred using Sync operation in batch mode.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Oracle optimizer can choose a proper execution plan if there is Domain Index created&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;You can mix &lt;span style="font-weight: bold; font-style: italic;"&gt;lcontains()&lt;/span&gt; and &lt;span style="font-weight: bold; font-style: italic;"&gt;lscore()&lt;/span&gt; operators in your queries.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Latest addition sponsored by &lt;a href="http://www.lendingclub.com/"&gt;Lending Club&lt;/a&gt; provides many other functionalities such as:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Synchronized with latest Lucene 2.2.0 production&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Replaced in memory storage using Vector based implementation by direct BLOB IO, reducing memory usage for large index.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Support for User Data Stores, it means you can not only index one column at time (limited by Data Cartridge API on 10g), now you can index multiples columns at base table and columns on related tabled joined together.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;User Data Stores can be customized by users, it means writing a simple Java Class users can control which column are indexed, padding functionality, storage and so on.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;There is a &lt;span style="font-weight: bold; font-style: italic;"&gt;DefaultUserDataStore&lt;/span&gt; which gets all columns of the query and built a Lucene Document with Fields representing each database columns, these fields are automatically padded if they have NUMBER or rounded if they have DATE data, for example.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;lcontains() &lt;/span&gt;SQL operator support full Lucene's QueryParser syntax to provide access to all columns indexed.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Support for DOMAIN_INDEX_SORT and FIRST_ROWS hint, it means that if you want to get rows order by lscore() operator (ascending,descending) the optimizer hint will assume that Lucene Domain Index will returns rowids in proper order avoided an inline-view to sort it.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Automatic index synchronization by using AQ's Call Back.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Lucene Domain Index creates extra tables named &lt;span style="font-weight: bold; font-style: italic;"&gt;IndexName$T&lt;/span&gt; and an Oracle AQ named &lt;span style="font-weight: bold; font-style: italic;"&gt;IndexName$Q&lt;/span&gt; with his storage table &lt;span style="font-style: italic; font-weight: bold;"&gt;IndexName$QT&lt;/span&gt; at user's schema, so you can alter storage's preference if you want.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Now we are working in another additions:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Implementing Array DML API, it means faster response time with operation such as &lt;span style="font-weight: bold; font-style: italic;"&gt;insert into .. select .. from&lt;/span&gt; DML and faster dequeuing operations.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Independent column format for each indexed columns including left padding with 0 for NUMBER, left padding with any char for VARCHAR2 (specially for columns which represent codes), XPath expressions for XMLType and rounding for DATE/TIMESTAMP.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;In Line pagination information at &lt;span style="font-weight: bold; font-style: italic;"&gt;lcontains()&lt;/span&gt; operator using Lucene Query Parser's  syntax,  for example &lt;span style="font-style: italic; font-weight: bold;"&gt;select  ..  from  ... where lcontains('rownum:[1 TO 10] AND f2:xx AND f3:yy')&lt;/span&gt; instead of using  Top-N query syntax.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Well anybody can join to this Open Source efforts :)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-4205304054012349194?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/4205304054012349194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=4205304054012349194' title='39 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/4205304054012349194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/4205304054012349194'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2007/09/running-lucene-inside-your-oracle-jvm.html' title='Running Lucene inside your Oracle JVM'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>39</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-1528960176673952416</id><published>2007-09-14T04:51:00.000-07:00</published><updated>2007-11-01T03:57:02.888-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Java Ant SQLPlus jpub loadjava ncomp'/><title type='text'>Automatize your Oracle Java VM tasks with Ant</title><content type='html'>&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }   H2 { margin-bottom: 0.08in }   H2.western { font-family: "Arial", sans-serif; font-size: 14pt; font-style: italic }   H2.cjk { font-family: "Mincho"; font-size: 14pt; font-style: italic }   H2.ctl { font-family: "Tahoma"; font-size: 14pt; font-style: italic }   PRE { border: 1px solid #000000; padding: 0.02in }   PRE.western { font-family: "Courier 10 Pitch" }   PRE.cjk { font-family: "Courier New", monospace }   PRE.ctl { font-family: "Courier New", monospace }  --&gt;  &lt;/style&gt;  &lt;h2 class="western" lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;Why use Ant?&lt;/span&gt;&lt;/h2&gt; &lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://ant.apache.org/"&gt;Ant&lt;/a&gt; is a &lt;i&gt;defacto&lt;/i&gt; built tool for compiling, building, packaging, testing and many other Java project related task.&lt;/span&gt;&lt;/p&gt; &lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;So why not use Ant to perform basic &lt;a href="http://www.oracle.com/technology/tech/java/jsp/index.html"&gt;Server Side Java&lt;/a&gt; operation with Oracle.&lt;/span&gt;&lt;/p&gt; &lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;Here a simple list of motivations:&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;after rebuild some packages automatically upload new jars  to the test/production environment&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;independence of the build environment (Windows,  Unix)&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;parametrized build scripts using properties&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;integrated build environment with other J2EE  related projects&lt;/span&gt;&lt;/p&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;So which server side related tasks can be automatized?&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;&lt;i&gt;loadjava&lt;/i&gt; and &lt;i&gt;dropjava&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;&lt;i&gt;JPublisher&lt;/i&gt; object types&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;&lt;i&gt;SQLJ&lt;/i&gt; pre-compiler&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;&lt;i&gt;SQLPlus&lt;/i&gt; executions&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;&lt;i&gt;NComp&lt;/i&gt; classes for Oracle 10g&lt;/span&gt;&lt;/p&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p align="justify" lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;To re-use this functionality across all the projects we built Ant's macros.&lt;/span&gt;&lt;/p&gt; &lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;&lt;span lang="en-US"&gt;Here the files &lt;a href="http://marcelo.ochoa.googlepages.com/loadjava.xml"&gt;loadjava.xml&lt;/a&gt;, &lt;a href="http://marcelo.ochoa.googlepages.com/jpub.xml"&gt;jpub.xml&lt;/a&gt;, &lt;a href="http://marcelo.ochoa.googlepages.com/sqlj.xml"&gt;sqlj.xml&lt;/a&gt;, &lt;a href="http://marcelo.ochoa.googlepages.com/ncomp.xml"&gt;ncomp.xml&lt;/a&gt; and &lt;a href="http://marcelo.ochoa.googlepages.com/sqlplus.xml"&gt;sqlplus.xml&lt;/a&gt;&lt;/span&gt;.&lt;/span&gt;&lt;/p&gt; &lt;h2 class="western" lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;Using Ant's macros on your build.xml files&lt;/span&gt;&lt;/h2&gt; &lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;You can simply import the above files in your &lt;i&gt;build.xml&lt;/i&gt; and start using it, all macros assume that ORACLE_HOME environment variable is properly set, either to an Oracle 10g/11g home directory or to a base directory of &lt;a href="http://www.oracle.com/technology/software/products/jdev/index.html"&gt;&lt;i&gt;JDeveloper&lt;/i&gt;&lt;/a&gt; 10g/11g.&lt;/span&gt;&lt;/p&gt; &lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;If you use &lt;span style="font-style: italic;"&gt;JDeveloper&lt;/span&gt; layout directory SQLPlus and NComp macros will not work unless you copy &lt;i&gt;sqlplus&lt;/i&gt; and &lt;i&gt;ncomp&lt;/i&gt; binary files at &lt;i&gt;jdev_home/bin&lt;/i&gt; directory and creates a directory &lt;i&gt;network/admin&lt;/i&gt; with the &lt;i&gt;tnsnames.ora&lt;/i&gt; file inside.&lt;/span&gt;&lt;/p&gt; &lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;A little trick to use &lt;span style="font-style: italic;"&gt;JDeveloper&lt;/span&gt; as Oracle Home layout directory is to install &lt;a href="http://www.oracle.com/technology/software/tech/oci/instantclient/index.html"&gt;Oracle Instant Client&lt;/a&gt; package and perform the above steps.&lt;/span&gt;&lt;/p&gt; &lt;p lang="en-US"&gt;&lt;span style="font-size:85%;"&gt;Here a simple &lt;a href="http://marcelo.ochoa.googlepages.com/build.xml"&gt;build.xml&lt;/a&gt; file which uses &lt;span style="font-style: italic;"&gt;ncomp&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;loadjava&lt;/span&gt; macros, each XML file also has examples of usage inside.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Note about SQLPlus: Ant provides a JDBC task to perform basic SQL operations but have several limitations, one for example it can not log as sysdba.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-1528960176673952416?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/1528960176673952416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=1528960176673952416' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/1528960176673952416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/1528960176673952416'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2007/09/automatize-your-oracle-java-vm-tasks.html' title='Automatize your Oracle Java VM tasks with Ant'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-7363500228756997684</id><published>2007-09-12T04:21:00.000-07:00</published><updated>2012-01-22T04:28:16.147-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle JVM Unit Testing JUnit Test Driven Development'/><title type='text'>Testing Java inside the Oracle VM</title><content type='html'>&lt;h2 class="western" lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Why test your code?&lt;/span&gt;&lt;/h2&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;I will not explain the benefits of Test Driven Development (TDD), may be the book “&lt;a href="http://www.amazon.com/gp/product/1558608680/ref=sib_rdr_dp/102-6737644-6250567?_encoding=UTF8&amp;amp;me=ATVPDKIKX0DER&amp;amp;no=283155&amp;amp;st=books&amp;amp;n=283155"&gt;Unit Testing in Java, How tests driver the code&lt;/a&gt;” by Johannes Link is the best source to do this. However, I agree with the author list of sentences and conclusions, for example:&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;I have no time for testing&lt;/i&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;Software testing is boring and mindless&lt;/i&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;My code is virtually faultless, good enough  in any event&lt;/i&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;The test department does the testing; they do  this much better anyway&lt;/i&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div align="justify" lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Sure these points can be easily refused; for example if you don't test the code, the time involved solving bugs and debugging the code will be more than the time involved writing a good test case.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;On the other hand if you write &lt;i&gt;&lt;b&gt;System.out&lt;/b&gt;&lt;/i&gt; sentences in your code sure you will need a test case for this and avoid the &lt;i&gt;&lt;b&gt;System.out&lt;/b&gt;&lt;/i&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div align="justify" lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;The new agile methods, such as eXtreme Programming or Scrum among others, are test driven. This means that the development is centered in testing and this process is applied each time that is possible.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;So the next paragraph shown how to test the Java code which run inside the Oracle JVM to get all the benefits of good code, faulty components, and code that can be easily tested with new libraries and database releases.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }   H2 { margin-bottom: 0.08in }   H2.western { font-family: "Arial", sans-serif; font-size: 14pt; font-style: italic }   H2.cjk { font-family: "Mincho"; font-size: 14pt; font-style: italic }   H2.ctl { font-family: "Tahoma"; font-size: 14pt; font-style: italic }  --&gt;  &lt;/style&gt;  &lt;/div&gt;&lt;h2 class="western" lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Testing Java Stored Procedures&lt;/span&gt;&lt;/h2&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Testing Java Stored Procedures do not differ from testing other Java code, but the naturalism of the execution environment is very different, this is a brief list of differences:&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;The JDBC drivers used is “Server-Side JDBC  Internal Driver”, not &lt;i&gt;&lt;b&gt;conn.setAutoCommit(true)&lt;/b&gt;&lt;/i&gt;  operation is supported for example.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;The Oracle JVM uses different garbage collection  techniques depending on the type of memory used. These techniques  provide high efficiency and low overhead but impose some concepts  different from traditional Java environments such as End of Call  Migration objects.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;The Class loader does not use the concept of  CLASSPATH, instead of this a Library Manager is used with a complex  mechanism for loading and resolving classes.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Threads on the &lt;i&gt;&lt;b&gt;OracleJVM&lt;/b&gt;&lt;/i&gt; are not  used.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;This list shown many differences, so testing the code inside the &lt;i&gt;&lt;b&gt;OracleJVM&lt;/b&gt;&lt;/i&gt; is very important to assure that the environment test is similar to the production environment.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }   H3 { margin-bottom: 0.08in }   H3.western { font-family: "Arial", sans-serif }   H3.cjk { font-family: "Mincho" }   H3.ctl { font-family: "Tahoma" }   PRE { border: 1px solid #000000; padding: 0.02in }   PRE.western { font-family: "Courier 10 Pitch" }   PRE.cjk { font-family: "Courier New", monospace }   PRE.ctl { font-family: "Courier New", monospace }  --&gt;  &lt;/style&gt;  &lt;/div&gt;&lt;h3 class="western" lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Testing Call Specs&lt;/span&gt;&lt;/h3&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;A simple way to test your Java code and the Call Specs is using SQLPlus, for example:&lt;/span&gt;&lt;/div&gt;&lt;pre class="western" style="font-family: courier new;"&gt;&lt;span style="font-size: 78%;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;SQL&amp;gt; CALL pkg.delete_rows('emp', 'sal &amp;gt; 1500');&lt;/span&gt;&lt;span style="font-size: 78%;"&gt;Call completed.&lt;/span&gt;&lt;span style="font-size: 78%;"&gt;SQL&amp;gt; SELECT ename, sal FROM emp;&lt;/span&gt;&lt;span style="font-size: 78%;"&gt;ENAME          SAL&lt;/span&gt;&lt;span style="font-size: 78%;"&gt;--------- --------&lt;/span&gt;&lt;span style="font-size: 78%;"&gt;SMITH          800&lt;/span&gt;&lt;span style="font-size: 78%;"&gt;WARD          1250&lt;/span&gt;&lt;span style="font-size: 78%;"&gt;MARTIN        1250&lt;/span&gt;&lt;span style="font-size: 78%;"&gt;TURNER        1500&lt;/span&gt;&lt;span style="font-size: 78%;"&gt;ADAMS         1100&lt;/span&gt;&lt;span style="font-size: 78%;"&gt;JAMES          950&lt;/span&gt;&lt;span style="font-size: 78%;"&gt;MILLER        1300&lt;/span&gt;&lt;span style="font-size: 78%;"&gt;7 rows selected.&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt; But this test cannot be used in components that are not published using PLSQL Call Specs.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }   H3 { margin-bottom: 0.08in }   H3.western { font-family: "Arial", sans-serif }   H3.cjk { font-family: "Mincho" }   H3.ctl { font-family: "Tahoma" }   PRE { border: 1px solid #000000; padding: 0.02in }   PRE.western { font-family: "Courier 10 Pitch" }   PRE.cjk { font-family: "Courier New", monospace }   PRE.ctl { font-family: "Courier New", monospace }  --&gt;  &lt;/style&gt;  &lt;/div&gt;&lt;h3 class="western" lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Testing the Code outside the &lt;i&gt;&lt;b&gt;OracleJVM&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Alternative to the testing through the Call Specs you can test the Java code using JDeveloper or any other Java IDE, the point here is how to provide the JDBC connection, a traditional solutions is to use an static method like, see &lt;a href="http://marcelo.ochoa.googlepages.com/listing1.txt"&gt;listing1.txt&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt; Then you can use the method on the application code as show, see &lt;a href="http://marcelo.ochoa.googlepages.com/listing2.txt"&gt;listing2.txt&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt; But as you can see the connection attributes for the target database are hard coded or loaded using system properties, and many libraries such as Oracle XMLType implementation differs if you are creating the instance using JDBC Thin or Server Side drivers.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   PRE { border: 1px solid #000000; padding: 0.02in }   PRE.western { font-family: "Courier 10 Pitch" }   PRE.cjk { font-family: "Courier New", monospace }   PRE.ctl { font-family: "Courier New", monospace }   P { margin-bottom: 0.08in }   H3 { margin-bottom: 0.08in }   H3.western { font-family: "Arial", sans-serif }   H3.cjk { font-family: "Mincho" }   H3.ctl { font-family: "Tahoma" }  --&gt;  &lt;/style&gt;  &lt;/div&gt;&lt;h3 class="western" lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Testing the Code inside the &lt;i&gt;&lt;b&gt;OracleJVM&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;For testing your code inside the &lt;i&gt;&lt;b&gt;OracleJVM&lt;/b&gt;&lt;/i&gt; you can use simple System.out calls to print the result to the standard output.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;If you need to redirect the System.out statement of the Java code these calls on the SQLPlus are required:&lt;/span&gt;&lt;/div&gt;&lt;pre class="western" style="font-family: courier new;"&gt;&lt;span style="font-size: 78%;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;SQL&amp;gt; SET SERVEROUTPUT ON SIZE 5000&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;&lt;span lang="en-US"&gt;SQL&amp;gt; CALL dbms_java.set_output(5000);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;SQL&amp;gt; CALL pkg.delete_rows('emp', 'sal &amp;gt; 1500');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;Deleting rows on table 'emp' where 'sal &amp;gt; 1500'....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;&lt;span lang="en-US"&gt;Call completed.&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;&lt;span lang="en-US"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }   H2 { margin-bottom: 0.08in }   H2.western { font-family: "Arial", sans-serif; font-size: 14pt; font-style: italic }   H2.cjk { font-family: "Mincho"; font-size: 14pt; font-style: italic }   H2.ctl { font-family: "Tahoma"; font-size: 14pt; font-style: italic }   PRE { border: 1px solid #000000; padding: 0.02in }   PRE.western { font-family: "Courier 10 Pitch" }   PRE.cjk { font-family: "Courier New", monospace }   PRE.ctl { font-family: "Courier New", monospace }  --&gt;  &lt;/style&gt;  &lt;br /&gt;&lt;h2 class="western" lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;The JUnit framework&lt;/span&gt;&lt;/h2&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;&lt;b&gt;JUnit&lt;/b&gt;&lt;/i&gt; is a quasi-standard open source framework authored by Ken Beck and Erich Gamma and was a derivation off an &lt;i&gt;&lt;b&gt;SmallTalk&lt;/b&gt;&lt;/i&gt; project named SUnit also developed by Ken Beck. The official web site of the project is &lt;a href="http://www.junit.org/"&gt;http://www.junit.org/&lt;/a&gt;; you can download the code, examples and tutorials from this site.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;It provides the environment for automatic testing of Java code, the framework is very simple and do not depend on any other libraries.  &lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;The Framework design provides multiples way of launching and seeing the result of the test suites, by default it provides three different TestRunner classes:&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;&lt;b&gt;junit.textui.TestRunner&lt;/b&gt;&lt;/i&gt; which uses  the standard &lt;i&gt;&lt;b&gt;stdout&lt;/b&gt;&lt;/i&gt; for the results.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;&lt;b&gt;junit.awtui.TestRunner&lt;/b&gt;&lt;/i&gt; based on  the Java AWT graphic toolkit.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;&lt;b&gt;junit.swingui.TestRunner&lt;/b&gt;&lt;/i&gt; based on  the Java Swing toolkit.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;A simplest way to start working with JUnit is to write a class which inherits from the abstract class &lt;i&gt;&lt;b&gt;junit.framework.TestCase.&lt;/b&gt;&lt;/i&gt;&lt;span style="font-style: normal;"&gt; This abstract class provides a correct skeleton for writing your test case, your code will be a simple Java method starting with the “test” word, for example:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class="western"&gt;&lt;span style="font-size: 78%;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;public class FooTest extend TestCase {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;  public void testFoo() {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;doSomething();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;  };&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div lang="en-US" style="font-style: normal;"&gt;&lt;span style="font-size: 85%;"&gt; If you need to do something before and after every testing method, you can override the &lt;i&gt;&lt;b&gt;setUp()&lt;/b&gt;&lt;/i&gt; and &lt;i&gt;&lt;b&gt;tearDown()&lt;/b&gt;&lt;/i&gt; methods, here an example, see &lt;a href="http://marcelo.ochoa.googlepages.com/listing3.txt"&gt;listing3.txt&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt; Also with Oracle &lt;i&gt;&lt;b&gt;JDeveloper&lt;/b&gt;&lt;/i&gt; you can automatically generate test cases for any class using a wizard.&lt;/span&gt;&lt;/div&gt;&lt;h2 class="western" lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Installing JUnit in the &lt;i&gt;&lt;b&gt;OracleJVM&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;In the previous paragraph I mentioned that &lt;i&gt;&lt;b&gt;JUnit&lt;/b&gt;&lt;/i&gt; is a pure Java framework which does not depend on external libraries, so why not use &lt;i&gt;&lt;b&gt;JUnit&lt;/b&gt;&lt;/i&gt; inside the Oracle JVM?&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Before using &lt;i&gt;&lt;b&gt;JUnit&lt;/b&gt;&lt;/i&gt; for testing your code you need to upload &lt;i&gt;&lt;b&gt;JUnit&lt;/b&gt;&lt;/i&gt; library into the Oracle JVM, to simplify the access to any database user who want to run unit test, a best place to upload &lt;i&gt;&lt;b&gt;junit.jar&lt;/b&gt;&lt;/i&gt; is on the SYS schema.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;You can download JUnit 3.x branch from SourceForge web site, here the link of latest production version &lt;a href="http://prdownloads.sourceforge.net/junit/junit3.8.2.zip?download"&gt;http://prdownloads.sourceforge.net/junit/junit3.8.2.zip?download&lt;/a&gt; , 4.0 release is not valid for Oracle OJVM because it uses the latest JDK1.5 assertion syntax.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Inside the ZIP file you can get the &lt;i&gt;&lt;b&gt;junit.jar&lt;/b&gt;&lt;/i&gt; file and upload it using &lt;i&gt;&lt;b&gt;loadjava&lt;/b&gt;&lt;/i&gt; command, see &lt;a href="http://marcelo.ochoa.googlepages.com/output1.txt"&gt;output1.txt&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;&lt;b&gt;-s&lt;/b&gt;&lt;/i&gt; flag creates public synonym to be available to other schemas&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;&lt;b&gt;-g PUBLIC&lt;/b&gt;&lt;/i&gt; grant execute permission to everyone.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Now you are ready to run some JUnit test, inside the jar there is a Text UI Runner, so creating a Call Spec for this runner is the simplest way to start testing Java code inside the Oracle JVM.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;A Call Spec for the Text UI Runner look like, see &lt;a href="http://marcelo.ochoa.googlepages.com/listing4.txt"&gt;listing4.txt&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }  --&gt;  &lt;/style&gt;  &lt;br /&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;If you don't want to grant &lt;/span&gt;&lt;span lang="en-US"&gt;&lt;b&gt;getClassLoader&lt;/b&gt;&lt;/span&gt;&lt;span lang="en-US"&gt; and other Oracle JVM permissions to PUBLIC, you can replace it for each database user who want to run JUnit test suites.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }   H2 { margin-bottom: 0.08in }   H2.western { font-family: "Arial", sans-serif; font-size: 14pt; font-style: italic }   H2.cjk { font-family: "Mincho", "msmincho"; font-size: 14pt; font-style: italic }   H2.ctl { font-family: "Tahoma"; font-size: 14pt; font-style: italic }  --&gt;  &lt;/style&gt;  &lt;br /&gt;&lt;h2 class="western" lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;&lt;b&gt;Writing your first test case&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;A simple Java test class extracted from the samples of JUnit distribution file can be uploaded using SQLPlus logged as SCOTT for example, see &lt;a href="http://marcelo.ochoa.googlepages.com/listing5.txt"&gt;listing5.txt&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }  --&gt;  &lt;/style&gt;  &lt;br /&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;And also using SQLPlus you can run the test and get this &lt;a href="http://marcelo.ochoa.googlepages.com/output2.txt"&gt;output2.txt&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }  --&gt;  &lt;/style&gt;  &lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Obviously this usage of Text UI Runner can be optimized or specialized for running inside the Oracle JVM making an Oracle JVM Runner and an XML Printer class.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;You can download these sources from &lt;a href="http://marcelo.ochoa.googlepages.com/ojvmtesting.sql"&gt;ojvmtesting.sql&lt;/a&gt;, load these sources logged as SYS.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;And create two Call Spec executing this script logged as SYS, see &lt;a href="http://marcelo.ochoa.googlepages.com/listing6.txt"&gt;listing6.txt&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }  --&gt;  &lt;/style&gt;  &lt;br /&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Now you can test the above Simple Test Suite using a new JUnit Runner logged as SCOTT, getting this &lt;a href="http://marcelo.ochoa.googlepages.com/output3.txt"&gt;output3.txt&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }   H2 { margin-bottom: 0.08in }   H2.western { font-family: "Arial", sans-serif; font-size: 14pt; font-style: italic }   H2.cjk { font-family: "Mincho", "msmincho"; font-size: 14pt; font-style: italic }   H2.ctl { font-family: "Tahoma"; font-size: 14pt; font-style: italic }  --&gt;  &lt;/style&gt;  &lt;br /&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;You can insert the &lt;/span&gt;&lt;span lang="en-US"&gt;&lt;i&gt;&lt;b&gt;XMLType&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;span lang="en-US"&gt; instances with the result of the all the regression test of your project in a object relational table. Then you can make reports with this data suitable for a QA team.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;h2 class="western" lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;&lt;b&gt;Unit testing which uses tables&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;If your Unit test uses tables for selecting or inserting rows two caveats will appear:&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;You cannot insert the result of  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;XMLType(OJVMRunnerAsString('c','junit.samples.SimpleTest'))  into another table, an exception will be raised. To solve this  problem, create an anonymous PLSQL block which stores the temporary  result in a PLSQL variable, then insert this value in the object  relational table.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  &lt;/li&gt;&lt;li&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;If you load junit.jar into the SYS  schema and use it through the above Call Specs using public synonym  the code which is running with the rights of the definer will not  see tables into another schema. To solve this problem, creates your  own copies of OJVMRunner, OJVMTestSuiteLoader and XMLPrinter classes  on the same schema of your table and create your own Call Specs. For  example, using SCOTT account run this SQL script &lt;a href="http://marcelo.ochoa.googlepages.com/listing7.txt"&gt;listing7.txt&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;style type="text/css"&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }   H2 { margin-bottom: 0.08in }   H2.western { font-family: "Arial", sans-serif; font-size: 14pt; font-style: italic }   H2.cjk { font-family: "Mincho", "msmincho"; font-size: 14pt; font-style: italic }   H2.ctl { font-family: "Tahoma"; font-size: 14pt; font-style: italic }  --&gt;  &lt;/style&gt;  &lt;br /&gt;&lt;h2 class="western" lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;&lt;i&gt;&lt;b&gt;Conclusions and Future Works&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/h2&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;The availability of the &lt;/span&gt;&lt;span lang="en-US"&gt;&lt;i&gt;&lt;b&gt;JUnit&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;span lang="en-US"&gt; framework inside the Oracle JVM is a good starting point for writing better and more secure code, users who writes test suite for every components will get all the benefits of the new agile programming techniques.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;The obviously extension is to provide a PLSQL environment for regression test which automatically run all the test suite and make usable reports as Apache Maven project.&lt;/span&gt;&lt;/div&gt;&lt;div lang="en-US"&gt;&lt;span style="font-size: 85%;"&gt;Read the original WP &lt;a href="https://docs.google.com/open?id=0B1fwyTi0k18ZNjIyZGQ4ZDctY2U1MS00NjY1LWI5NmUtYTJjZGZmODA0MGFh" target="_blank"&gt;here (included code)&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;h2 class="western"&gt;&lt;span style="font-size: 85%;"&gt;Suggested reading&lt;/span&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;The book “&lt;/span&gt;&lt;/span&gt;&lt;span style="color: navy; font-size: 85%;"&gt;&lt;u&gt;&lt;a href="http://www.amazon.com/gp/product/1558608680/ref=sib_rdr_dp/102-6737644-6250567?_encoding=UTF8&amp;amp;me=ATVPDKIKX0DER&amp;amp;no=283155&amp;amp;st=books&amp;amp;n=283155"&gt;&lt;span lang="en-US"&gt;Unit  Testing in Java, How tests driver the code&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;”  by Johannes Link.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;A &lt;/span&gt;&lt;/span&gt;&lt;span style="color: navy; font-size: 85%;"&gt;&lt;u&gt;&lt;a href="http://www.oracle.com/technology/oramag/oracle/03-may/o33junit.html"&gt;&lt;span lang="en-US"&gt;JUnit  Step-by-Step&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt; by Michel  Casabianca, learn unit-testing basics using one of the most popular  open source testing frameworks at OTN. &lt;/span&gt;&lt;/span&gt;  &lt;br /&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;A &lt;/span&gt;&lt;/span&gt;&lt;span style="color: navy; font-size: 85%;"&gt;&lt;u&gt;&lt;a href="http://www.oracle.com/technology/oramag/oracle/03-may/o33junit_2.html"&gt;&lt;span lang="en-US"&gt;JUnit  Step-by-Step: Part 2&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;, by  Michel Casabianca, Automating Tests Using Ant.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="color: navy; font-size: 85%;"&gt;&lt;u&gt;&lt;a href="http://www.oracle.com/technology/products/jdev/viewlets/1013/agile_development_viewlet_swf.html"&gt;&lt;span lang="en-US"&gt;CVS,  Ant and JUnit with JDeveloper&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;  viewlet at OTN.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;JUnit web site:  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: navy; font-size: 85%;"&gt;&lt;u&gt;&lt;a href="http://www.junit.org/index.htm"&gt;&lt;span lang="en-US"&gt;http://www.junit.org/index.htm&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="color: navy; font-size: 85%;"&gt;&lt;u&gt;&lt;a href="http://xprogramming.com/"&gt;&lt;span lang="en-US"&gt;XPProgramming.com&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-size: 85%;"&gt;&lt;span lang="en-US"&gt;  an Agile Software Development Resource.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt; &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-7363500228756997684?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/7363500228756997684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=7363500228756997684' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/7363500228756997684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/7363500228756997684'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2007/09/testing-java-inside-oracle-vm.html' title='Testing Java inside the Oracle VM'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932005449976239416.post-6325339773636161221</id><published>2007-04-10T15:07:00.000-07:00</published><updated>2007-05-31T07:24:17.729-07:00</updated><title type='text'>Welcome</title><content type='html'>Welcome to everyone!!!&lt;br /&gt;I'll use this place as notepad for sharing experience, code and other related stuff to Oracle, Java and XML technologies.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932005449976239416-6325339773636161221?l=marceloochoa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marceloochoa.blogspot.com/feeds/6325339773636161221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932005449976239416&amp;postID=6325339773636161221' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/6325339773636161221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932005449976239416/posts/default/6325339773636161221'/><link rel='alternate' type='text/html' href='http://marceloochoa.blogspot.com/2007/04/welcome.html' title='Welcome'/><author><name>Marcelo Ochoa</name><uri>http://www.blogger.com/profile/03410152050718914588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='19' height='32' src='http://4.bp.blogspot.com/_ynfsOwQFaM0/S7C9EtT_2nI/AAAAAAAAAUo/upnahaVNOts/s1600-R/default-small.jpg'/></author><thr:total>0</thr:total></entry></feed>
