Configuring Db2 for z/OS as the build metadata database
To correctly use a DBB metadata store with Db2 for z/OS®, a Db2 storage group and a Db2 database must be created. After the tables are created in the Db2 database, users must be granted to access these tables.
1. Create the Db2 storage group and the Db2 database
To do so, you can use the create_DB2z.sql
script, which is available by default in /usr/lpp/IBM/dbb/ddl
.
This script contains sample commented CREATE STOGROUP
and CREATE DATABASE
statements
that you can uncomment from the script (if you plan to run this script for the tables creation) or extract from the script and run manually.
The following items give guidelines on how to customize the provided commands:
-
Create a storage group
CREATE STOGROUP <storage group name> VOLUMES ('*') VCAT <HLQ name>;
In this command, specify the following parameters:
- The storage group name.
- The name of the high-level qualifier of your Db2 files. This qualifier must exist on your system, and the DBB JDBC user must have full access to it.
-
Create the database statements
To create the database statements, enter the following command.
You must create the database with UNICODE as the CCSID. The following example shows Db2 SQL
create
statements:CREATE DATABASE <database name> STOGROUP <storage group name> BUFFERPOOL <buffer pool name> CCSID UNICODE; COMMIT;
In this command, specify the following parameters:
- The database name. This name is used during table creation so the script must be changed to match.
- The storage group name.
- The buffer pool name. On z/OS, a 16 K page size or larger is required. This buffer pool is used for creating tables. Table spaces are created in the default 16 K buffer pool, unless you selected a larger buffer pool.
2. Create the Db2 tables required by DBB
The minimum authority to create the tables and indexes in the next step requires DBADM
access to the database and USE
access to the storage group.
GRANT USE OF STOGROUP <storage group name> TO <dbbuser>;
GRANT DBADM ON DATABASE <database name> TO <dbbuser>;
You can use tools such as Data Studio or SPUFI to run the script to create the database tables used by DBB. Run the /usr/lpp/IBM/dbb/ddl/create_DB2z.sql
script to create the tables for Db2 for z/OS.
3. Store your database drivers in an accessible location.
- Remote Db2 for z/OS
If your Db2 for z/OS installation resides on a different z/OS machine or even a different LPAR than the DBB Toolkit installation, then you need to copy the db2jcc4.jar
and db2jcc_license_cisuz.jar
files from your z/OS
system installation directory of Db2 for z/OS to a location accessible to the DBB installation. These files are typically located in the <baseInstallDir>/jdbc/classes
directory.
- Local Db2 for z/OS
If your Db2 for z/OS is already accessible to the DBB installation, then there are no additional copying steps. Add the db2jcc4.jar
and db2jcc_license_cisuz.jar
files from your z/OS system installation directory of
Db2 for z/OS to your CLASSPATH. These files are typically located in the <baseInstallDir>/jdbc/classes
directory.
4. Configure additional environment variables to support direct Db2 connections
After you have stored your available Db2 JDBC drivers in a location that is accessible to the DBB toolkit, you must allow DBB to access them.
So, besides the existing required DBB environment variables DBB_HOME
and DBB_CONF
, the Db2 direct connections require modifications to at least the CLASSPATH
environment variable as well as to the STEPLIB
and LIBPATH
environment variables depending on the type of Db2 connection. See DBB environment variables for more information on how to configure your z/OS UNIX environment variables to use
the direct Db2 connections.
5. Set database artifact permissions
Users that run DBB builds must be granted the correct access permissions for build artifacts stored in the database. For more information, see Granting roles to users.