Chapter 5. Deploying pre-configured databases 217
5.2.1 Collecting information about the database
To deploy a pre-configured database to a new system, the tasks include these:
򐂰Create the database.
򐂰Create the database layout.
򐂰Create the database objects.

Database creation

The database can be created by executing the CREATE DATABASE command
through the Command Line Processor (CLP) or by using one of the DB2 APIs.
In Example 5-1 we show how to use the CREATE DATABASE command to create
our ITSODB database.
Example 5-1 Statement to create the ITSODB sample database
CREATE DATABASE ITSODB ON /db2 ALIAS ITSO

Database layout

Database layout is about buffer pools and table spaces. A table space is a logical
storage unit or an abstraction of the physical storage. The mapping from table
space to storage devices is handled by the containers. A table space consists of
one or more containers that map directly to raw devices or files on a storage
device.
We use table spaces to group tables and indexes logically. When deploying the
pre-configured database, these logical groups can be mapped differently on the
target system based on the storage availability and data column.
A buffer pool is an in-memory cache for data. A table space is associated with a
buffer pool in the table space definition. One buffer pool can be the cache for
data in several table spaces. Figure5-2 illustrates two different ways to map
buffer pool, table spaces, and storage for the sample database ITSODB.
Note: In this chapter we use Java as a programming language. DB2 does not
provide APIs for Java. DB2 provides APIs for C/C++ and COBOL.