Hide last authors
Manuel Smeria 4.2 1 {{info}}
Manuel Smeria 4.4 2 This has been tested only on DB2 v8.2 and DB2 v9.
Manuel Smeria 4.2 3 {{/info}}
ShawnLauzon 1.1 4
Manuel Smeria 4.2 5 {{warning}}
6 Case-insensitive search does not work with this database; see below for more info. You may want to use the the [[Lucene search application>>extensions:Extension.Search Application]].
7 {{/warning}}
ShawnLauzon 1.1 8
Manuel Smeria 4.2 9 = Create the xwiki user =
Vincent Massol 2.2 10
Manuel Smeria 4.2 11 * This is OS-dependent. Use your favorite tool to create an OS-level user named ##xwiki##
12 * Set xwiki's password to ##xwiki##
ShawnLauzon 1.1 13
Manuel Smeria 4.2 14 = Create the xwiki database =
ShawnLauzon 1.1 15
Manuel Smeria 4.2 16 * First make sure your database instance width matches the JVM. If you have a 32-bit JVM you need a 32-bit instance. 64-bit JVM requires a 64-bit instance. If they don't match, you will get an //UnsatisfiedLinkError// when first connecting to XWiki.
17 * Open a DB2 Command Line Processor, either via typing //db2// or on Windows by navigating to Start > All Programs > IBM DB2 > Command Line Tools > Command Line Processor. This will give you a command prompt //db2 =>//.
Manuel Smeria 4.5 18 * Create a database with the following code: {{code}}db2 => create database xwiki{{/code}}
19 * Connect to the database to continue the configuration: {{code}}db2 => connect to xwiki{{/code}}
Vincent Massol 5.1 20 * Create a 32K bufferpool and tablespace (this is required because of the length of the rows in a couple of the XWiki tables):(((
Manuel Smeria 4.1 21 {{code}}
ShawnLauzon 1.1 22 db2 => create bufferpool BFP32K immediate size 1024 pagesize 32k
23 db2 => create regular tablespace TSXWIKI pagesize 32k managed by system using ('/some/directory/cntr_xwiki') bufferpool BFP32K
Manuel Smeria 4.1 24 {{/code}}
Manuel Smeria 4.2 25 )))
Vincent Massol 5.1 26 * Grant privileges to the xwiki user:(((
Manuel Smeria 4.1 27 {{code}}
ShawnLauzon 1.1 28 db2 => grant connect, createtab, implicit_schema on database to user xwiki
ShawnLauzon 1.7 29 db2 => grant use of tablespace TSXWIKI to user XWIKI
Manuel Smeria 4.1 30 {{/code}}
Manuel Smeria 4.2 31 )))
Vincent Massol 5.1 32 * Reset connections and quit:(((
Manuel Smeria 4.1 33 {{code}}
ShawnLauzon 1.1 34 db2 => connect reset
35 db2 => quit
Manuel Smeria 4.1 36 {{/code}}
Manuel Smeria 4.2 37 )))
ShawnLauzon 1.1 38
Manuel Smeria 4.2 39 = XWiki configuration =
ShawnLauzon 1.2 40
Manuel Smeria 4.2 41 * Ensure ##$INSTHOME/sqllib/lib## is in your library path. This is something like ##$LIBPATH##, depending on your OS.
ShawnLauzon 1.2 42 * Copy the following files from your DB2 installation directory to the xwiki lib directory:
Manuel Smeria 4.2 43 ** ##$INSTHOME/sqllib/java/db2jcc.jar##
44 ** ##$INSTHOME/sqllib/java/db2jcc_license_cu.jar##
Vincent Massol 5.1 45 * Configure XWiki to use DB2. To do this, edit the ##WEB-INF/hibernate.cfg.xml## file where you have expanded the XWiki WAR file. Replace the matching properties with the following ones (or uncomment them if they are present):(((
Manuel Smeria 4.1 46 {{code}}
ShawnLauzon 1.2 47 <property name="connection.url">jdbc:db2:xwiki</property>
ShawnLauzon 1.1 48 <property name="connection.username">xwiki</property>
49 <property name="connection.password">xwiki</property>
ShawnLauzon 1.2 50 <property name="connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
51 <property name="dialect">org.hibernate.dialect.DB2Dialect</property>
ShawnLauzon 1.4 52 <property name="connection.pool_size">2</property>
53 <property name="statement_cache.size">2</property>
ShawnLauzon 1.1 54
ShawnLauzon 1.2 55 <mapping resource="xwiki.db2.hbm.xml"/>
ShawnLauzon 1.4 56 <mapping resource="feeds.hbm.xml"/>
Manuel Smeria 4.1 57 {{/code}}
Manuel Smeria 4.2 58 )))
ShawnLauzon 1.13 59
Manuel Smeria 4.2 60 = Make search case-insensitive =
ShawnLauzon 1.13 61
Vincent Massol 5.3 62 If you try to do a search via [[platform:Main.WebSearch]] you will get a big DB2 SQLException with //SQLCODE: -440//. This is caused because the UPPER() function only works for columns with 250 bytes of data or so in it. Since XWiki calls UPPER() for an entire CLOB column, this just doesn't work. The only solution I found is to remove all the calls to UPPER() in [[platform:Main.WebSearch]]. Alternatively, you may want to examine the [[Lucene search application>>extensions:Extension.Search Application]].

Get Connected