BuildForge Help

Database Objects for DB2

  1. In your operating system, create a user. The Management Console will use this name to log in to the database. Example: user name build, password build.
    Note: DB2 does not support creating a user from a SQL script.

    Perform the remaining steps in DB2:

  2. Create a user tablespace with 8K page sizes.
  3. Create an empty database named build with the necessary tablespaces
  4. Grant user access to BFUSE_TEMP tablespace.
Note: Build Forge accesses the database using the schema for the user.

Sample DB2 SQL Command Script

Use the following commands at a DB2 Command Line Processor to create the tablespace and database.
// Create database
db2 CREATE DATABASE BFT ALIAS BUILD USING CODESET UTF-8 TERRITORY US AUTOCONFIGURE USING MEM_PERCENT 40 APPLY DB ONLY 
db2 CONNECT TO BUILD

db2 CREATE BUFFERPOOL "BUFFP1" IMMEDIATE SIZE 1000 PAGESIZE 8192 NOT EXTENDED STORAGE;
db2 CONNECT RESET;
db2 CONNECT TO BUILD;


// Create tablespaces
db2 CREATE SYSTEM TEMPORARY TABLESPACE TEMPSPACE2 PAGESIZE 8192 MANAGED BY SYSTEM 
  USING ('<path to database>/SQL003.0')
  EXTENTSIZE 64
  PREFETCHSIZE 64
  BUFFERPOOL BUFFP1;

db2 CREATE USER TEMPORARY TABLESPACE BFUSE_TEMP PAGESIZE 8192 MANAGED BY SYSTEM 
  USING ('<path to database>/SQL004.0')
  EXTENTSIZE 64
  PREFETCHSIZE 64
  BUFFERPOOL BUFFP1;

db2 CREATE REGULAR TABLESPACE USERSPACE2 PAGESIZE 8192 MANAGED BY SYSTEM 
  USING ('<path to database>/SQL005.0')
  EXTENTSIZE 64
  PREFETCHSIZE 64
  BUFFERPOOL BUFFP1;

// User must be granted use of BFUSE_TEMP tablespace 
db2 GRANT USE OF TABLESPACE BFUSE_TEMP TO USER BUILD WITH GRANT OPTION

db2 commit work;
db2 CONNECT RESET;
db2 terminate;