Database Troubleshooting for DB2
On this page:
DB2 Does Not Support Unicode Character By Default
To support the Unicode character set, create your database like this:
For 8.2.2 or later:
db2 create database <name> using codeset utf-8 territory us pagesize 8 k
Before 8.2.2
db2 create database <name> using codeset utf-8 territory us
db2 drop tablespace userspace1
db2 create bufferpool bufpool8k <number of pages> pagesize 8 k
db2 create tablespace userspace1 pagesize 8 k managed by database using \(file \'<location>\'
<number of pages>\) bufferpool bufpool8k
The territory may not be important when using UTF-8, but it must be included.
DB2 Does Not Support Transaction Logging Of BLOBs Larger Than 1GB
"With their potentially large size, LOBs can slow down the performance of your database system significantly when moved into or out of a database. Even though DB2 does not allow logging of a LOB value greater than 1 GB, LOB values with sizes approaching 1 GB can quickly push the database log to near capacity. An error, SQLCODE -355 (SQLSTATE 42993), results from attempting to log a LOB greater than 1 GB in size. The lob-options-clause in the CREATE TABLE and ALTER TABLE statements allows users to turn off logging for a particular LOB column. Although setting the option to NOT LOGGED will improve performance, changes to the LOB values after the most recent backup are lost during roll-forward recovery."
Although one could set the length for the CustomClobType in BodyContent.hbm.xml field length to larger sizes, say 2^31 to allow storing of BLOBs up to the size of 2 Gb, DB2 maximum length can only be set to 2^30, 1GB.
<property name="body" type="com.atlassian.confluence.core.persistence.hibernate.CustomClobType" update="true" insert="true"
column="BODY" length="1073741824" />
データベース文字エンコード設定
Refer to Configuring Database Character Encoding.
DB2 Dialect class change (if upgrading from Confluence version 2.2 or older)
If you are using DB2, and are upgrading Confluence from version 2.2 or older, the 'hibernate.dialect' property in the confluence.cfg.xml
file needs to be changed to 'com.atlassian.hibernate.dialect.DB2Dialect' like so:
<property name="hibernate.dialect">com.atlassian.hibernate.dialect.DB2Dialect</property>
Encoding Test Problems
At the time of writing this, there is an open bug with the encoding test when using DB2. Details are here: CONF-8588.
Transaction Isolation Level of Read Uncommitted
Due to CONF-9323, DB2 requires a transaction isolation level of "read uncommitted" to avoid occasional deadlocks. The more concurrent usage a Confluence instance experiences, the higher the frequency of deadlocks with a transaction isolation level higher than "read uncommitted".
Set the following property in the confluence.cfg.xml
file.
<property name="hibernate.connection.isolation">1</property>
Incompatible Data Types on z/OS 8
There are problems when running DB2 on z/OS 8 and 9. This platform is not officially supported but there is an unsupported workaround here.
SQLCODE: -443, SQLSTATE: 38553, SQLERRMC: SYSIBM.SQLTABLES;TABLES;SYSIBM:CLI:-805
Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -443, SQLSTATE: 38553, SQLERRMC: SYSIBM.SQLTABLES;TABLES;SYSIBM:CLI:-805
at com.ibm.db2.jcc.b.hh.b(hh.java:1369)
at com.ibm.db2.jcc.b.hh.c(hh.java:1356)
at com.ibm.db2.jcc.c.db.k(db.java:352)
at com.ibm.db2.jcc.c.db.e(db.java:96)
at com.ibm.db2.jcc.c.t.e(t.java:83)
at com.ibm.db2.jcc.c.sb.h(sb.java:167)
at com.ibm.db2.jcc.b.hh.q(hh.java:1329)
at com.ibm.db2.jcc.b.ih.d(ih.java:2529)
at com.ibm.db2.jcc.b.jh.V(jh.java:146)
at com.ibm.db2.jcc.b.fb.a(fb.java:7374)
at com.ibm.db2.jcc.b.fb.a(fb.java:5997)
at com.ibm.db2.jcc.b.fb.getTables(fb.java:5908)
at com.mchange.v2.c3p0.impl.NewProxyDatabaseMetaData.getTables(NewProxyDatabaseMetaData.java:2828)
at net.sf.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:54)
... 23 more
You might encounter this problem after an upgrade to UDB Version 8.1 FixPak 10 (also known as Version 8.2 FixPak 3) when invoking a DB2 Call Level Interface (CLI) catalog function. The solution to this is to perform a rebind of the db2schema.bnd
file locally against each database. Refer to the IBM Technote FAQ for more instruction.