Oracle Installation

Version 5.2 by Vincent Massol on 2011/12/09

Installation steps

Steps:

  • Download and install a version of Oracle Database. For example Oracle Express.
  • Download the corresponding Oracle JDBC Drivers and copy the JAR (e.g. ojdbc6.jar in WEB-INF/lib/)
  • Start Oracle and connect to it with a DBA or system user. For example, using the Oracle SQL*Plus command-line tool:
    "connect system;" (type the password)
  • Create the wiki user and schema:
    "create user xwiki identified by xwiki;"
  • Give all privileges to the xwiki user:
    "grant all privileges to xwiki;"
  • Tell XWiki to use Oracle. To do this, edit the WEB-INF/hibernate.cfg.xml file where you have expanded the XWiki WAR file and uncomment the Oracle part. Make sure to review the connection.url property. For example a typical Oracle Express would be:
    <property name="connection.url">jdbc:oracle:thin:@localhost:1521:XE</property>

    Note 1: 'XE' is the default name of the ORACLE SID created by default by the installation for Oracle Express. If it is another you should change it. You can find the correct SID in app/oracle/product/10.2.0/server/NETWORK/ADMIN/tnsnames.ora in the Oracle installation directory (for Windows).

Troubleshooting

SetString can only process strings of less than 32766 chararacters

If you see an error that says something like:

Error number 3201 in 3: Exception while saving document XWiki.XWikiPreferences
Wrapped Exception: could not update: [com.xpn.xwiki.doc.XWikiDocumentArchive#104408758]
com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document XWiki.XWikiPreferences
Wrapped Exception: could not update: [com.xpn.xwiki.doc.XWikiDocumentArchive#104408758]
...
Wrapped Exception:

java.sql.SQLException: setString can only process strings of less than 32766 chararacters
...

Then that's because Oracle has a limitation of 32K for CLOBs. To overcome it you need to add the following 2 properties in the hibernate.cfg.xml file, as specified in the installation steps section above:

<property name="hibernate.connection.SetBigStringTryClob">true</property>
<property name="hibernate.jdbc.batch_size">0</property>

Get Connected