In Figure 5-1,we depict the ITSODB database.

 

 

ITSO_BP

 

 

 

 

bufferpool

 

 

 

 

ITSO_TS1

 

ITSO_TS2

 

 

 

tablespace

 

 

tablespace

 

 

PK

 

PK

Function

 

DEPT

FK

EMPLOYEE

Stored

 

 

procedure

 

table

 

table

 

 

 

 

 

Check

 

 

 

 

constraint

STAFF

 

 

 

 

 

 

 

 

table

 

Alias

 

 

 

View

 

ADEFUSR

 

 

 

 

summarytable

 

trigger

 

 

 

 

 

Index

 

 

 

Figure 5-1 The sample database ITSODB

You can download the DDLs used to create the ITSODB from the IBM Redbooks Web site. Refer to Appendix B, “Additional material” on page 267 for the download instructions.

5.2 Deploying a database using scripts

This task is about creating the database and the database objects such as tables, indexes, views, stored procedures, and so on. We assume that this is a new installation, that is, we do not describe update of an existing database.

First of all, you have to prepare the set of statements for creating the entire database. Once the statements are ready, you can execute them either through a shell script or using an application.

The statements and their options shown in this chapter are limited to our sample database. For more details, refer to the DB2 manuals and Information Center:

￿Command Reference, SC23-5846

￿SQL Reference, Volume 1, SC23-5861

￿SQL Reference, Volume 2, SC23-5862

216DB2 Deployment Guide

Page 230
Image 230
IBM manual Deploying a database using scripts, 216 DB2 Deployment Guide