Design and Manage DB2 Databases Visually with DbSchema

DbSchema lets you design, manage, and document DB2 databases. Create ER diagrams, define tables and columns, and generate SQL scripts - with or without a live database connection.

Use Git to share the design, compare it with the DB2 database, and deploy changes. DbSchema also includes a data editor, query builder, and HTML5 documentation - everything you need in one tool.

DbSchema Database Designer

Download DbSchema

How to Connect to IBM Db2 Database

  1. Open DbSchema

    After launching DbSchema, you’ll see the welcome screen. Click on “Connect to the Database” and choose IBM Db2 to start.

    DbSchema Welcome Screen for Apache Derby

  2. Access the Connection Dialog

    DbSchema includes the required JDBC driver: db2jcc.jar and db2jcc_license_cu.jar.

    For AS400 / iSeries, you can use the open-source jtopen driver: http://jt400.sourceforge.net/

    Db2 Connection Dialog

  3. If you want to quickly test DbSchema without installing or configuring anything complex, the fastest option is to run Db2 using Docker.

    Option 1: Run Db2 in Docker

    IBM offers an official Docker image for Db2. You can start a fresh Db2 instance with one command:

    You can run Db2 using the official Docker image from IBM:

    https://hub.docker.com/r/ibmcom/db2

    Create the container with:

    docker run -itd --name db2 --privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INST1_PASSWORD=DbSchema12 -e DBNAME=test ibmcom/db2

    Then connect using:

    • User: db2inst1
    • Password: DbSchema12
    • Database: test

    If you can’t connect, a firewall or antivirus might be blocking the request. See the guide on Firewall Connections.

Firewall Tip Firewalls or antivirus software may block database connections. Make sure DbSchema is allowed through.

Option 2. Install Db2 Community Edition

You can download Db2 Express from: IBM Db2 Community Edition

After installation, you can connect using the user db2admin and the password you set during install.

To check available databases, open the Db2 Command Line window and run:

db2 list db directory

You can connect to the sample database with:

db2 connect to sample

List Db2 Instances

Create a New Database

To create a new database from the CLI, run:

create database test;

Create database - Step 1

Create database - Step 2

Connect from DbSchema using:

  • User: db2admin
  • Password: your install password
  • Database: test

DbSchema Connection Dialog

Installing Db2 on Windows (Quick Guide)

Download Db2 Community Edition from https://www.ibm.com/products/db2

During the install, you’ll be asked to set the password for the main user db2admin.

Installation Step - Password

When asked to choose a DB2 instance, just confirm the default. This step defines how many instances of Db2 run on your system — not relevant for DbSchema.

Choose Instance

Installing Db2 on Ubuntu Linux

This is a simplified version of our experience installing Db2 on Ubuntu 10.6.

  • Install Java:
    • Enable third-party software in the package manager
    • sudo apt-get update
    • sudo apt-get install sun-java6-jdk
  • Install required packages:
    • sudo apt-get install libstdc++5
    • sudo apt-get install libaio1
  • Download and unpack Db2, then run:
    ./db2_install
    Install to: /opt/db2
  • Create users:
    
    useradd -m -U -s /bin/bash db2inst1
    useradd -m -U -s /bin/bash db2fenc1
    useradd -m -U -s /bin/bash dasusr1
    passwd db2inst1
    passwd db2fenc1
    passwd dasusr1
        
  • Create an instance and admin server:
    
    cd /opt/db2/instance
    ./db2icrt -p 50000 -u db2fenc1 db2inst1
    ./db2dascrt -u dasusr1
        
  • Add to /etc/services:
    DB2_TMINST 50000/tcp
  • Configure and start:
    
    su - db2inst1
    db2 update dbm cfg using svcename 50000
    db2set DB2COMM=tcpip
    db2start
        

Optional: Install Extra Utilities (TeamViewer & noip)

  • TeamViewer:
    
    ln -s /opt/teamviewer/teamviewer/6/bin/teamviewer /etc/init.d/TeamViewer
    update-rc.d TeamViewer defaults
        
  • noip:
    
    binaries/noip2-i686 -C
    ln -s /opt/noip-2.1.9-1/debian.noip2.sh /opt/init.d/noip
    update-rc.d noip defaults