220 Preparing for DB2 Near-Realtime Business Intelligence
Figure D-2 Results of enable_MQFunctions command
You should find that a default MQM named “DB2MQ_DEFAULT_MQM” has been
created and started.
Note: As a result of running enable_MQFunctions, a default MQ environment will
be established. The MQ queue manager
DB2MQ_DEFAULT_MQM and the
DB2MQ_DEFAULT_Q will be created. The files amt.xml,
and amt.dtd will be created if they do not already exist in the
directory pointed to by
AMT_DATA_PATH. If an amthost.xml file does exist, and
does not contain a definition for connectionDB2MQ, then a line will be added to
the file with the appropriate information. A copy of the original file will be saved as
D.4 Create DB2 view over the MQ queue
Creating a DB2 view (Queue View) over an MQ queue is very useful capability,
especially when you are new to MQSeries. It lets you treat the MQ queue just like
a DB2 table. This means you can use SQL statements to access the queue data
just as you would with a DB2 table.
You can develop a Queue View by using the DB2 Development Center.
Figure D-3 on page 221 shows the first step. It enables you to select a UDF or
222 Preparing for DB2 Near-Realtime Business Intelligence
Figure D-4 Select both UDFs
We now need to define a service point for the queue over which we want to build
a view. If you do not assign a service point, the queue view will based on default
queue enabled by enable_MQFunctions, which is the DB2MQ_DEFAULT_MQM
For the project we built a queue view for the
Therefore, we needed to define a service point for that queue. We gave the
service point the name
FACT_ITEM. Figure D-5 on page 223 displays the step
to create the service point name.
224 Preparing for DB2 Near-Realtime Business Intelligence
Figure D-6 Mapping queue content to table columns
Upon successful completion of the data mapping, the development center can
now create the two UDFs for the Queue View over the Fact Queue. Figure D-7 on
page 225 shows that the two UDFs have been created and been given the
QV_Receive_Fact and QV_Read_Fact.