Menu

Install Instructions

Marcelo F. Ochoa

Requirements

  • JDeveloper 11g only if you want to edit Java code.
  • Ant 1.7.0
  • Sun JDK 1.5.0_05/1.4.2 ($ORACLE_HOME/jdk directory works fine as Java Home for compiling on 10g and 11g)
  • Linux/Windows Database Oracle 10g 10.2/11g production

Install binary distributions

Binary distributions are available at SourceForge.net and provides a very straightforward
installation.
11g/12c Binary Distributions


Edit your ~/build.properties file with your Database values (Windows users can find
build.properties file at C:\Documents and Settings\username folder):

db.str=test
db.usr=LUCENE
db.pwd=LUCENE
dba.usr=sys
dba.pwd=change_on_install
javac.debug=true
javac.source=1.4
javac.target=1.4

db.str is your SQLNet connect string for your target database, check first with tnsping

This is an example environment setting before installing on 11g database

MAVEN_HOME=/usr/local/maven
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.1.0.6.0/db_1
ORACLE_SID=test
JAVA_HOME=$ORACLE_HOME/jdk
PATH=$MAVEN_HOME/bin:$HOME/bin:$ORACLE_HOME/bin:$JAVA_HOME/bin:/usr/local/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/local/lib
CVS_RSH=ssh
umask 022
export PATH LD_LIBRARY_PATH ORACLE_HOME ORACLE_BASE ORACLE_SID JAVA_HOME CVS_RSH NLS_LANG

Upload, install and test your code into the database

ant install-ojvm
ant test-domain-index

For Oracle 11g/12c you can perform a post-installation step:

ant jit-lucene-classes

This target force to translate all Lucene, Snowball and LDI classes to assembler.
Instead of waiting that the database compile it by detecting most used classes or method.

10g Binary Distribution

First edit your ~/build.properties with something like this:

db.str=orcl
db.usr=LUCENE
db.pwd=LUCENE
dba.usr=sys
dba.pwd=change_on_install
javac.debug=true
javac.source=1.4
javac.target=1.4

db.str property is a SQLNet connect string for the target database.
ORACLE_HOME environment setting is required and properly configured to an Oracle 10g database layout, finally execute ant without arguments.
Here an example of environment setting on 10g database:

MAVEN_HOME=/usr/local/maven
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=orcl
JAVA_HOME=$ORACLE_HOME/jdk
PATH=$MAVEN_HOME/bin:$HOME/bin:$ORACLE_HOME/bin:$JAVA_HOME/bin:/usr/local/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/local/lib
CVS_RSH=ssh
umask 022
export PATH LD_LIBRARY_PATH ORACLE_HOME ORACLE_BASE ORACLE_SID JAVA_HOME CVS_RSH NLS_LANG

If you are re-installing Oracle Lucene OJVM integration first drop any Lucene Domain Index not installed at Lucene's schema.
Default target will drop first Lucene schema if exists, additionaly (Recommended for production system) you can run "ant ncomp-ojvm" which translates all Lucene classes to C using JAccelerator, for example:

ant ncomp-ojvm
ant test-domain-index

Instructions to compile from sources

  • Unpack or checkout Lucene sources.
  • Checkout LDI sources, by now only Anonymous CVS access is provided you can download from Source Forge servers with:

    cd /tmp
    svn checkout svn://svn.code.sf.net/p/ldi/code/odi/trunk odi

  • Copy to $LUCENE_ROOT/contrib

    cd $LUCENE_ROOT/contrib
    cp -rp /tmp/odi .

  • Edit $LUCENE_ROOT/common-build.xml adding a target for creating a jar file with test sources.

    <target name="jar-test" depends="compile-test">
    <sequential>
    <mkdir dir="${build.dir}" />
    <jarify basedir="${tests.src.dir}" destfile="${build.dir}/${final.name}-test.jar">
    <fileset dir="${tests.src.dir}/../resources" erroronmissingdir="no"/>
    </jarify>
    </sequential>
    </target>

  • (OPTIONAL) Update Lucene's BufferedIndexInput.BUFFER_SIZE according to your db_block_size init.ora parameter.
    Before compile and upload Lucene core library you can change org.apache.lucene.store.BufferedIndexInput.BUFFER_SIZE constant to the value of your db_block_size init parameter, this change will improve reading performance by using same block size as the physical block size that your database use.
  • Compile LDI Directory sources and tests, these targets automatically copies all Lucene Domain Index required libraries from your $ORACLE_HOME and Internet. Starting with LDI 2.4.0.1.x build.xml file automatically compiles all Lucene contrib modules
    dependency.

    cd $LUCENE_ROOT/contrib/ojvm
    ant jar-core
    ant jar-test

  • Edit your ~/build.properties file with your Database values:

    db.str=orcl
    db.usr=LUCENE
    db.pwd=LUCENE
    dba.usr=sys
    dba.pwd=change_on_install
    javac.debug=true
    javac.source=1.4
    javac.target=1.4
    db.str is your SQLNet connect string for your target database, check first with tnsping
    utility, also note that for 11g/12c database user and password are case sensitive, so leave LUCENE in uppercase.

  • Upload your code to the database

    ant install-odi

Optimizations

Using NCOMP on 10g

Is strongly recommended before going in production that install Oracle Lucene Domain Index NCOMPed in 10g databases. NCOMP automatically translate Lucene and OJVMDirectory Java code to assembler and finally install it as dynamic link library (.so/.dll) in your Oracle home. To do this simply execute this Ant task instead of install-odi-10g target:

ant ncomp-runtime-retrotranslator-sys-code
ant ncomp-lucene-all

Using JIT on 11g/12c

First verify that your database parameter java_jit_enabled is TRUE. Oracle 11g/12c includes a JIT technology which automatically translates most used Java methods to assembler. If you want to pre-compile all Lucene Java code to assembler and not wait for Oracle database detects common used code you can execute this target:

ant jit-lucene-classes
ant jit-oracle-classes