Each set of users will access a warehouse. The operating system you choose for the warehouse depends on capacity planning, the operating system that the users work on, and on your network constraints. The DB2 family of databases can support a wide variety of capacity requirements, so select the database that is appropriate for your warehouse.
Warehouse users must have access to the warehouse database. They can use any application that can access DB2 data.
You can use any DB2 Universal Database database as a warehouse. For more information about connecting to DB2 Universal Database databases through a DB2 Universal Database server or through any DB2 client, see DB2 Universal Database Installation and Configuration Supplement.
Before setting up a warehouse, you need to create a database on the target system. Then set up a user ID with the following privileges for the database:
In addition, explicit SELECT privilege is required for the following system tables:
After you define the required privileges, perform the following tasks at the agent site:
You can use DB2 Connect or Client Access/400 (CA/400) to access a DB2 for AS/400 warehouse.
To set up access to a DB2 for AS/400 warehouse with DB2 Connect:
If you want to access data from a DB2 for AS/400 warehouse, you need a gateway site. Configure the site for DRDA by installing DB2 Connect.
For more information about DRDA, see the Distributed Relational Database Architecture Connectivity Guide.
For information about DB2 Connect, see the following books:
The system administrator of the target system must set up a user ID with CHANGE authority or higher on the NULLID collection.
In addition, explicit SELECT privilege is required for the following system tables:
The user ID also needs the ALLOBJ privilege to create AS/400 collections.
After you define the required privileges, perform the following tasks at the gateway site:
Perform the following tasks at the agent site:
To set up CA/400 for access to a DB2 for AS/400 database:
To see a full list of the latest informational APARs that will tell you which PTFs are needed for your AS/400, visit the following web page:
http://www.as400.ibm.com/clientaccess/
On the Client Access Service Packs web page, you can find information about the latest workstation service packs and host PTFs.
To check the current level of your operating system:
GO LICPGM
9.123.456.7 demo400 9.123.456.8 mypc
cwbping hostname ip
You will receive a response like this:
C:\>cwbping demo400 ip IBM AS/400 Client Access for Windows 95/NT Version 3 Release 1 Level 2 (C) Copyright IBM Corporation and Others 1984, 1995. All rights reserved. U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Licensed Materials - Property of IBM [9.180.160.17] pinging server Port Mapper successful pinging server as-central successful pinging server as-database successful pinging server as-dtaq successful pinging server as-file successful pinging server as-netprt successful pinging server as-rmtcmd successful pinging server as-signon successful
If the servers are not started, enter the following command on the AS/400 system to start the servers:
STRHOSTSVR SERVER (*ALL)
If the AS/400 does not have a DB2 database name, you will receive an SQL0114 error when you try to access the database.
http://www.as400.ibm.com/clientaccess/service.htm
If you do not apply service pack SP45545 and run the CWBCFG utility, you will receive the following error message:
"IBM.[Client Access ODBC Driver (32 bit)][DB2/400 SQL] Communications failure. COMM RC=0x3" CAUSE: according to the Rochester lab. the CA/400 connection was registered under the "current user" (HKEY_CURRENT_USERS) but should be under HKEY_USERS (.Default). SOLUTION: you need to register the connection in the correct register, using the stand-alone utility cwbcfg.exe, which can be used to configure a session for the HKEY_USERS.Default user. The correct syntax for cwbcfg is: cwbcfg /host HOSTNAME /s where HOSTNAME is the AS/400 name in your HOSTS file, (see step 3). NOTE: the "/s" option is important. After this command you can verify that the NT registry is set up by running regedt32 and browse HKEY_USERS (.Default)
If you receive CA/400 errors, click Help for a detailed explanation of the error.
By default, the Data Warehouse Center creates warehouse target tables in a format that is supported by the DB2 Universal Database products. You also can tailor steps to work with target tables in DB2 for OS/390(R).
Before setting up a warehouse, you need to create a database on the target system. Then set up a user ID with the following privileges for the database:
To establish connectivity to the DB2 for OS/390 database, perform the following tasks:
Create the Data Warehouse Center status table by using the following command:
CREATE TABLE IWH.BVBESTATUS (BVNAME VARCHAR(80) NOT NULL, RUN_ID INT NOT NULL, UPDATIME CHAR(26) NOT NULL) IN database-name.tablespace-name
When you define a target table for a DB2 for OS/390 warehouse, you must specify a tablespace in which to create the table. If you do not specify a tablespace, DB2 for OS/390 creates the table in the default DB2 database defined for the given subsystem.
To specify the tablespace:
The Table notebook opens.
The Table notebook closes.
When you promote the step to test mode, if you specified that the Data Warehouse Center is to create the target table, the Data Warehouse Center creates the target table in the DB2 for OS/390 database.
By default, the Data Warehouse Center creates warehouse target tables in a format that is supported by the DB2 Universal Database products. You also can tailor steps to work with target tables in DB2 UDB Enterprise - Extended Edition (DB2 EEE).
Before setting up a warehouse, you need to create a database on the target system. Then set up a user ID with the following privileges for the database:
Set up access to DB2 EEE by following the instructions in Establishing connectivity to DB2 Universal Database warehouses, starting with the explicit SELECT privilege.
After setting up access to the system, perform the following tasks in the Data Warehouse Center to use a DB2 EEE warehouse:
The Table notebook opens.
The Show SQL window opens.
A confirmation window opens. Click Yes to edit the SQL.
IN tablespace-name PARTITIONING KEY (column-name) USING HASHING
The Edit SQL window closes.
The Table notebook closes.
When you promote the step to test mode, the Data Warehouse Center creates the target table in the DB2 EEE database.
IBM DataJoiner provides several advantages for accessing data for steps. Instead of using ODBC support for non-IBM databases, you can use DataJoiner to access those databases directly using the native database protocols. You can also use DataJoiner to write to non-IBM databases. With DataJoiner, you can access and join data from different data sources with a single SQL statement and a single interface. The interface hides the differences between the different IBM and non-IBM databases. DataJoiner optimizes the SQL statement to enhance performance.
You can define Data Warehouse Center steps that take advantage of DataJoiner's function. First, you define warehouses that use DataJoiner databases. Then you define steps that write to those warehouses.
Before you read this section, read Chapter 2, Setting up your warehouse, Chapter 3, Setting up warehouse sources, Chapter 4, Setting up access to a warehouse, and Chapter 5, Defining and running processes to learn about the basic components of a warehouse. You should also be familiar with creating server mappings and nicknames in DataJoiner.
Create a separate logical warehouse definition in the Data Warehouse Center for each DataJoiner target database. For example, define one warehouse for each Oracle database, another warehouse for each Sybase database, and so on.
Specify the same DataJoiner database as the database for each logical warehouse. When the Data Warehouse Center generates the SQL to extract data from the source database and write data to the target database, the Data Warehouse Center generates a SELECT INSERT statement because the DataJoiner database is both the source and target database. DataJoiner then optimizes the query for the DataJoiner target databases (such as Oracle and Sybase). You can define steps with sources from more than one database by taking advantage of the DataJoiner heterogeneous join optimization.
To access the warehouse with a different Data Warehouse Center agent, change the name of the database, the user ID, and the password.
The BVBESTATUS table contains timestamps for the step editions in the warehouse database. You must create a BVBESTATUS table in the DataJoiner database or in each remote database.
If you create the BVBESTATUS table in the DataJoiner database, you must use two-phase commit to keep the table in sync with the remote warehouse databases.
If you create the BVBESTATUS table in the remote databases, updates to the table will be in the same commit scope as the remote databases. You must have a different DataJoiner database for each remote database, because the Data Warehouse Center requires that the name of the table be BVBESTATUS. One DataJoiner nickname cannot represent multiple tables in different databases.
To create the BVBESTATUS table, use the CREATE TABLE statement. For example, to create the table in an Oracle database, issue the following command:
CREATE TABLE BVBESTATUS (BVNAME, VARCHAR2(80) NOT NULL, RUN_ID NUMBER(10) NOT NULL, UPDATIME CHAR(26) NOT NULL)
After you create the table, create a nickname for the IWH.BVBESTATUS table in DataJoiner.
For more information about creating tables and nicknames in DataJoiner, see the DB2 DataJoiner: Administration Guide.
For more information about creating a server mapping in DataJoiner, see the DB2 DataJoiner: Planning, Installation, and Configuration Guide.
With DataJoiner Version 2.1.1 or later, the Data Warehouse Center can create tables directly into a remote database, such as Oracle.
To create the target table:
In the example in Defining warehouse sources for use with DataJoiner, the server mapping name is Oracle 1.
If your user ID for the target database has the privilege to create a table with a qualifier that is different from your user ID, you can proceed to step 4.
If you have a version of DataJoiner before to Version 2.1.1, you can either:
You can create and test a step in a DataJoiner database, and then move it to a remote database:
For information about how DB2 data types map to Oracle data types, see the DB2 DataJoiner: Planning, Installation, and Configuration Guide.
You can use the Data Warehouse Center to update an existing table in a remote database. Use this option when data already exists or when you are using another tool, such as a modeling tool, to create the warehouse schema.
In the Table notebook, the Columns page displays the imported table definition.
After you define the sources for your warehouse as warehouse sources, you define the warehouse target that will contain the data. The Data Warehouse Center supports the DB2 Universal Database and DB2 for AS/400 databases for your warehouse. You can also change the CREATE statement for the target table to work with DB2 EEE and DB2 for OS/390. For more information, see Setting up a DB2 EEE warehouse and Setting up a DB2 for OS/390 warehouse.
Any warehouse user can define a warehouse target, but only users who belong to a warehouse group with access to the warehouse target can change the warehouse target. For information about defining users and security groups, see the online help.
To define a warehouse target:
The Warehouse Target notebook opens.
To include all of the items in the Available agent sites list, click >>.
On OS/400 Version 4 Release 2 and Version 4 Release 3, you must select the View folder to import system tables.
The Filter window opens.
If the warehouse target has more than one agent site selected, the warehouse server uses the agent site with the name that sorts first (depending on the user's locale) for the import.
For example, your warehouse target has three agent sites selected: Default Agent, AIX Agent, and MVS Agent. The warehouse server uses the agent site named AIX Agent for the import.
The objects that meet the filter criteria that you entered are displayed in the Available tables list.
If the target tables do not exist, define the tables:
The Define Warehouse Target Table notebook opens.
The Data Warehouse Center supports target tables that use ordinary SQL identifiers. An ordinary identifier:
If a table has a lowercase letter as part of its ordinary identifier, the Data Warehouse Center stores the lowercase letter as an uppercase letter.
The Data Warehouse Center does not support target resource tables that use delimited identifiers. A delimited identifier:
Table names can be case sensitive, or have other restrictions, for some warehouse target types. See the documentation for your warehouse target type for information about naming conventions.
Use this option when you want the Data Warehouse Center to create the target table, such as when the target table is the result of an SQL step. Clear this check box if you are using a target table that is already defined.
Column names can be case sensitive for some data source types. See the documentation for your data source type for information about naming conventions.
For example, you must specify a length for CHAR data types.
Precision refers to the total number of digits, which can range from 1 to 131.
Scale refers to the number of digits to the right of the decimal point, which can range from 0 to the precision of the number.
The Table notebook closes. The target table is added under the Tables folder in the Selected tables list.
The warehouse group moves to the Selected security groups list.
To define a warehouse primary key:
To include all of the columns in the Available columns list, click >>.
To remove all of the columns from the warehouse primary key definition, click <<.
The Data Warehouse Center generates a default name for the warehouse primary key constraint.
You can define foreign keys for a warehouse source table, warehouse source view, or warehouse target table. The Data Warehouse Center uses foreign keys only in the join process. The Data Warehouse Center does not commit foreign keys that you define to the underlying database.
Before you define foreign keys, you must know the name and schema of the parent table to which the foreign keys correspond.
You can define foreign keys when the step is in development or test mode. If the step is in development mode, the key is created when you create the table by promoting the step to test mode. If the step is in test mode, the Data Warehouse Center alters the table to add the key when you click OK.
To define foreign keys:
If you don't provide a name, the Data Warehouse Center generates a default name for the foreign key constraint.
The Primary key columns field shows the primary key columns that are associated with the table that you specified.
To include all of the columns in the Available columns list, click >>.
To remove a foreign key definition from the table or view, select the column from the Foreign key columns list, and click <.
To remove all of the columns from the foreign key definition, click <<.
If you selected a table that exists in the warehouse database (or you already ran the step), you can view the data in the target tables. You view the data from one table at a time. The Data Warehouse Center displays all the columns of the table, and up to a maximum of 200 rows.
To view the data, click Sample Data.
The Sample Data window opens and displays a sample of your data.
Users can use the BVBESTATUS table to join tables by matching their timestamps or query editions by date range rather than by edition number.
For example, the edition number 1010 might not have any meaning to a user, but the dates on which the data was extracted might have meaning. You can create a simple view on the target table to allow users to query the data by the date on which it was extracted.
You must manually create the status table. If the table was created by Visual Warehouse Version 2.1, you must delete the table and create it again.
To create the status table:
CREATE TABLE IWH.BVBESTATUS ( BVNAME VARCHAR(80) NOT NULL, RUN_ID INT NOT NULL, UPDATIME CHAR(26)NOT NULL );
You might need to change the statement, as follows:
IN database-name.tablespace-name
IN tablespace-name partitioning-key (RUN_ID) USING HASHING