Wiki source code of InstallationDB2

Version 1.14 by Vincent Massol on 2007/05/23

Show last authors
1 1 DB2 Installation
2
3 #info("This has been tested only on DB2 8.2")
4 #warning("Case-insensitive search does not work with this database; see below for more info. You may want to use the the [Lucene search page>Code.LuceneSearchPage]")
5
6 1.1 Create the xwiki user
7 * This is OS-dependent. Use your favorite tool to create an OS-level user named 'xwiki'.
8 * Set xwiki's password to 'xwiki'.
9
10 1.1 Create the xwiki database
11
12 * 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 talking to XWiki.
13 * Open a DB2 Command Line Processor, either via typing 'db2' or on Windows choosing Start > All Programs > IBM DB2 > Command Line Tools > Command Line Processor. This will give you a command prompt 'db2 =>'.
14 * Create a database with the following:
15 {code}
16 db2 => create database xwiki
17 {code}
18 * Connect to the database to continue configuration
19 {code}
20 db2 => connect to xwiki
21 {code}
22 * Create a 32K bufferpool and tablespace; this is required because of the length of the rows in a couple of the XWiki tables
23 {code}
24 db2 => create bufferpool BFP32K immediate size 1024 pagesize 32k
25 db2 => create regular tablespace TSXWIKI pagesize 32k managed by system using ('/some/directory/cntr_xwiki') bufferpool BFP32K
26 {code}
27 * Grant privileges to the xwiki user
28 {code}
29 db2 => grant connect, createtab, implicit_schema on database to user xwiki
30 db2 => grant use of tablespace TSXWIKI to user XWIKI
31 {code}
32 * Reset connections and quit
33 {code}
34 db2 => connect reset
35 db2 => quit
36 {code}
37
38 1.1 XWiki configuration
39
40 * Ensure $INSTHOME/sqllib/lib is in your library path. This is something like $LIBPATH, depending on your OS.
41 * Copy the following files from your DB2 installation directory to the xwiki lib directory:
42 ** $INSTHOME/sqllib/java/db2jcc.jar
43 ** $INSTHOME/sqllib/java/db2jcc_license_cu.jar
44 * Tell 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):
45 {code}
46 <property name="connection.url">jdbc:db2:xwiki</property>
47 <property name="connection.username">xwiki</property>
48 <property name="connection.password">xwiki</property>
49 <property name="connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
50 <property name="dialect">org.hibernate.dialect.DB2Dialect</property>
51 <property name="connection.pool_size">2</property>
52 <property name="statement_cache.size">2</property>
53
54 <mapping resource="xwiki.db2.hbm.xml"/>
55 <mapping resource="feeds.hbm.xml"/>
56 {code}
57 * The file ~~xwiki.db2.hbm.xml~~ is not currently shipped with XWiki, so it must be added to the installation. The easiest way to do this is to create the file as ~~WEB-INF/classes/xwiki.db2.hbm.xml~~ (creating the ~~classes~~ directory if needed) and restarting XWiki.
58
59 1.1 Make search case-insensitive
60
61 If you try to do a search, via [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 have found is to remove all the calls to upper() in [Main.WebSearch].
62
63 Alternatively, you may want to examine the [Lucene search page>Code.LuceneSearchPage].

Get Connected