Spatially enabling a DB2 database

Before spatial data can be stored in an IBM DB2 database, the Spatial Extender module (including the data server and client installations) must be installed, and the database must be registered with the Spatial Extender.

A DB2 Spatial Extender environment consists of a DB2 data server installation and a DB2 Spatial Extender installation. Databases enabled for spatial operations are located in the DB2 data server, which can be accessed from a DB2 Spatial Extender client.


For more information about the DB2 Spatial Extender and how to install it, see the IBM DB2 documentation.

DB2 instances created before you install Spatial Extender do not include DB2 Spatial Extender in their instance environments. To update existing DB2 instances, use the db2iupdt command. If you are using the DB2 Control Center and created an instance for the DB2 Administration server prior to installing DB2 Spatial Extender, you must update this instance.

  1. Set the following DB2 parameters to allow you to spatially enable the database:
    Application HEAP size: 2048 (APPLHEAPSZ)
    Application Control HEAP size: 2048(APPL_CTL_HEAP_SZ)
    Log primary (number): 10 (LOGPRIMARY)
    Log file size: 1000 (LOGFILSIZ)
    Updating these files via SQL:
    db2 connect to sde
    db2 update db cfg for sde using ALT_COLLATE IDENTITY_16BIT
    db2 update db cfg for sde using APPLHEAPSZ 2048
    db2 update db cfg for sde using APP_CTL_HEAP_SZ 2048
    db2 update db cfg for sde using LOGPRIMARY 10
    db2 update db cfg for sde using LOGFILSIZ 1000
  2. Grant DBADM to the sde user.
    db2 connect to sde user <db2admin account> using <db2admin password>
    db2 grant dbadm on database to user sde
  3. Add the sde user to an operating system group that has SYSMON authority.

    For example, if you define a group called sdegroup, which contains the sde user, you can set the value of the SYSMON_GROUP instance parameter to the value sdegroup using the following commands:

  4. At the command line, issue the following command to spatially enable the database:
    db2se enable_db dbname [-userid userid] [-pw password]