close

Filter

loading table of contents...

Content Server Manual / Version 2107

Table Of Contents

3.2.3 DB2

CoreMedia Content Servers can use IBM DB2 databases for their repositories. This section describes DB2 specific settings. For general advice see Section 3.2, “Configuring the Database”.

General Notes

The CoreMedia Content Server database configuration requires one DB2 user per content server. Each user will own one schema in the given database.

JDBC Configuration

Each DB2 installation comes with its own JDBC drivers, which you will find below sqllib/java. Ensure that db2jcc.jar is added to your classpath (for example, place it into the lib/ folder of the CoreMedia Content Server).

Configure the SQL properties as follows:

sql.store.driver=com.ibm.db2.jcc.DB2Driver
sql.store.url=jdbc:db2://<DB-HOST>:<DB-PORT>/<DB-NAME>
sql.store.user=<DB-USER>
sql.store.password=<DB-USER-PASSWORD>
    

Example 3.4. SQL properties for IBM DB2


Database Configuration

The recommended configuration for the DB2 database is as follows:

  • the default buffer pool and table space page size should be set to 32K,

  • choose code set UTF-8,

  • for large content types, increase the page size for the default tablespace and

  • in case of problems with long queries adjust the parameters applheapsz, stmtheap and appl_memory.

Suggested values can be found in the example script below.

Sample Script for Database Setup

The following script is an example of how to configure the database "CM" for use with the CoreMedia Content Server. The script relies on the following preconditions:

  • you are logged in as database system administrator and

  • you have created a system user called cmowner (configurable through DBOWNER_USER).

#!/bin/bash
DBNAME=CM
DBCODESET=UTF-8
DBOWNER_USER=cmowner

db2 create db ${DBNAME} \
  using codeset ${DBCODESET} \
  territory us collate using system \
  pagesize 32768

db2 update db cfg for ${DBNAME} using applheapsz 16384
db2 update db cfg for ${DBNAME} using stmtheap 60000
db2 update db cfg for ${DBNAME} using logfilsiz 131072
db2 update db cfg for ${DBNAME} using maxlocks 100
db2 update db cfg for ${DBNAME} using locklist 65536

db2set DB2_RR_TO_RS=yes

db2 connect to ${DBNAME}
db2 create bufferpool bp_${DBNAME} \
  all dbpartitionnums size 50000 numblockpages 0 pagesize 32768
db2 create tablespace ts_${DBNAME} pagesize 32768 \
  managed by automatic storage \
  extentsize 32 prefetchsize 64 bufferpool bp_${DBNAME}
db2 create system temporary tablespace tts_${DBNAME} \
  pagesize 32768 managed by automatic storage \
  extentsize 32 prefetchsize 64 bufferpool bp_${DBNAME}
db2 grant use of tablespace ts_${DBNAME} to PUBLIC
# ensures that ts_${DBNAME} becomes the default tablespace
db2 drop tablespace userspace1

db2 grant CONNECT,DBADM,BINDADD,CREATE_NOT_FENCED_ROUTINE,\
  IMPLICIT_SCHEMA,LOAD,CREATE_EXTERNAL_ROUTINE,\
  QUIESCE_CONNECT,CREATETAB on database to user ${DBOWNER_USER}

db2 disconnect current
db2 detach
    

Example 3.5. Example for Bash Script for IBM DB2 Database Setup


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.