You are on page 1of 10

How I successfully designed, Implemented and Monitored IBM INFOSPHERE EVENT PUBLISHER : My Experience

3/18/2013
DB2's GOT TALENT FINALS #2 BY Renu Sharma ACE DBA CONSULTING Inc 1

Requirement
Asked by e-commerce client to write input feed for Netezza data warehouse Data feed should land at staging server Delimited format as Column delimiter | (pipe) Character delimiter ` (acute) Decided to

What is Event Publishing ?


It is a subset of Q Replication Its target is not a table It has not got Q Apply Q Capture puts the messages Into MQ websphere Queues The data messages are written in either XML or CSV format It can publish subset of columns and rows Application program reads destructively/nondestructively the message Queues
3/18/2013 DB2's GOT TALENT FINALS #2 BY Renu Sharma ACE DBA CONSULTING Inc

use Event Publisher After Looking at source, Target and OS

Event Publication Process


SOURCE
Source Tab1, Tab2

TARGET
Meta DATA MQ MESSAGE BROKER USER Application

DB2 Log

Q Capture

User Application

ADMINISTRATION
Replication Center Replication Monitor Replication Dashboard ASNCLP Commands
3/18/2013 DB2's GOT TALENT FINALS #2

WBI Event Broker User Stored Procedure DB2 MQ Listener


BY Renu Sharma ACE DBA CONSULTING Inc

EVENT PUBLISHING SETUP FOR NETEZZA

pdbin006@aixdb313p Instance "pdbin006" uses "64" bits and DB2 code release "SQL09072" with level identifier "08030107". Informational tokens are "DB2 v9.7.0.2", "s100514", and Fix Pack "2". Product is installed at "/udb/ pdbin006/IBM/db2/V9.7". MQSERVER QMGR NAME : SQLP0232 RESTART QUEUE: ASN.RESTARTQ ADMINQ : ASN.ADMINQ SENDQ : NETEZZA.PUB.QL01 PUBLISHING QUEUE MAP : XCHREPP_EVP_TO_XCHTEZZA_EVP01

DBNAME : REPP SCHEMA : EVP01 CAPTURE LOG :/install/db2/caplog

MQ CLIENT Name: WebSphere MQ Version: 6.0.2.10 CMVC level: p600-210-100825 BuildType: IKAP - (Production)

3/18/2013

4 DB2's GOT TALENT FINALS #2 BY Renu Sharma ACE DBA CONSULTING Inc

Setting up Event Publisher Components


Installing InfoSphere Data Event Publisher using ./ISEPSETUP Register license key of InfoSphere Data Event Publisher db2licm a isep.lic Get QMGR and MQ Objects created by MQ Administrator QMGR NAME : SQLP0232 RESTART QUEUE: ASN.RESTARTQ ADMINQ : ASN.ADMINQ SENDQ : NETEZZA.PUB.QL01 Setup following MQ environment Variables on AIX OS: export ASNUSEMQCLIENT=TRUE export MQCHLLIB=/var/mqm export MQCHLTAB=AMQCLCHL.TAB

3/18/2013 DB2's GOT TALENT FINALS #2 BY Renu Sharma ACE DBA CONSULTING Inc

Create Control Tables


ASNCLP SESSION SET TO Q REPLICATION; SET SERVER CAPTURE TO REPP DB REPP ID evpbusr1 password "password"; SET QMANAGER "SQLP0232" FOR CAPTURE SCHEMA; SET CAPTURE SCHEMA SOURCE EVP01; SET OUTPUT CAPTURE SCRIPT "epcontrol.sql"; SET RUN SCRIPT LATER; CREATE CONTROL TABLES FOR CAPTURE SERVER USING RESTARTQ "ASN.RESTARTQ" ADMINQ "ASN.ADMINQ" SLEEP INTERVAL 1000; QUIT;

asnclp f asnevpcntrl.qrp db2 tvf epcontrol.sql


6 DB2's GOT TALENT FINALS #2 BY Renu Sharma ACE DBA CONSULTING Inc

3/18/2013

Create Publishing Q MAP


SET LOG "pqmap.err"; SET SERVER CAPTURE TO DB REPP ; SET CAPTURE SCHEMA SOURCE EVP01; SET OUTPUT CAPTURE SCRIPT "pqmap01.sql"; SET QMANAGER "SQLP0232" FOR CAPTURE SCHEMA; SET RUN SCRIPT LATER; CREATE PUBQMAP XCHREPP_EVP_TO_XCHTEEZA_EVP01 USING SENDQ "NETEZZA.PUB.QL01" MESSAGE FORMAT DELIMITED MESSAGE CONTENT TYPE T MAX MESSAGE SIZE 128; asnclp f epqmap.qrp db2 tvf pqmap01.sql To setup LOAD feed format: db2 "update evp01.IBMQREP_SENDQUEUES set COLUMN_DELIMITER = '|'" db2 "update evp01.IBMQREP_SENDQUEUES set DECIMAL_POINT = .' db2 "update evp01.IBMQREP_SENDQUEUES set STRING_DELIMITER = `"
3/18/2013 DB2's GOT TALENT FINALS #2 BY Renu Sharma ACE DBA CONSULTING Inc 7

Create Publication
ASNCLP SESSION SET TO Q REPLICATION; SET LOG "pub.err"; SET SERVER CAPTURE TO DB REPP ID DB2ADMIN password XXX; SET CAPTURE SCHEMA SOURCE EP1; SET OUTPUT CAPTURE SCRIPT "pub.sql"; SET RUN SCRIPT LATER; CREATE PUB USING PUBQMAP XCHREPP_EVP_TO_XCHTEZZA_EVP01 (PUBNAME "DEPARTMENT0001" DB2ADMIN.DEPARTMENT ALL CHANGED ROWS Y SUPPRESS DELETES Y); QUIT; asnclp f asnpublication.qrp db2 tvf pub.sql asnqcap capture_server=REPP capture_schema=EVP01 capture_path=/install/db2/caplog startmode=cold View the messages using :asnqmfmt NETEZZA.PUB.QL0 SQLP0232 Data was written at staging server using a JAVA CODE
8
3/18/2013 DB2's GOT TALENT FINALS #2 BY Renu Sharma ACE DBA CONSULTING Inc

Some monitoring SQLs To Know


Querying the Status of Q Capture
asnqccmd capture_server = SQLP0232 status show details

Starting and Stopping the Publication :


INSERT INTO EVP01.ibmqrep_signal (signal_type,signal_subtype, signal_input_in, signal_state ) VALUES ( 'CMD','CAPSTART', 'DEPARTMENT0001','P'); INSERT INTO EVP01.ibmqrep_signal (signal_type,signal_subtype, signal_input_in, signal_state ) VALUES ( 'CMD','CAPSTOP', 'DEPARTMENT0001', 'P');

Status of sendq:
SELECT sendq,state FROM EVP01.ibmqrep_sendqueues;

Status of restartq:
SELECT SUBSTR(qmgr,1,10) AS qmgr, SUBSTR(restartq,1,20) AS restartq FROM EVP01.ibmqrep_capparms ;

Status of Q subscription:
SELECT SUBSTR(subname,1,10) AS subname,state AS s, state_time FROM EVP01.ibmqrep_subs;
9 3/18/2013
DB2's GOT TALENT FINALS #2 BY Renu Sharma ACE DBA CONSULTING Inc

Links and resources Please Vote For me


InfoSphere Replication Server and InfoSphere Data Event Publisher Version 9.7 product documentation in PDF format http://www-01.ibm.com/support/docview.wss?uid=swg27016356
My contact and blog info : Renu Sharma ACE DBA Consulting Inc www.db2dbas.com renusharma@db2dbas.com, renusharma@aol.com 732-342-7630, 732-995-9963,732-374-3601 Facebook :https://www.facebook.com/home.php#!/pages/ACE-DBAConsulting/138802816289257 Twitter : @db2_dbas Linkedin : http://www.linkedin.com/home?trk=hb_tab_home_top

3/18/2013

DB2's GOT TALENT FINALS #2 BY Renu Sharma ACE DBA CONSULTING Inc

10