Public.dhe.ibm

Transcription

IBM InfoSphere Data ReplicationVersion 10.1.3ASNCLP Program Reference forReplication and Event Publishing SC19-3639-00

IBM InfoSphere Data ReplicationVersion 10.1.3ASNCLP Program Reference forReplication and Event Publishing SC19-3639-00

NoteBefore using this information and the product that it supports, read the information in “Notices and trademarks” on page331. Copyright IBM Corporation 2004, 2012.US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contractwith IBM Corp.

ContentsChapter 1. Getting started with theASNCLP program . . . . . . . . . . 1Chapter 3. Sample ASNCLP scripts forQ Replication . . . . . . . . . . . . 67Before you run the ASNCLP program . . . . . .Supported operating systems . . . . . . . .Setting up a Java environment to run the ASNCLPprogram . . . . . . . . . . . . . . .Binding z/OS packages for the ASNCLP programASNCLP configuration file . . . . . . . .Use of double quotation marks in ASNCLPcommands . . . . . . . . . . . . . .Running the ASNCLP commands in batch mode . .Running the ASNCLP commands in interactive modeRunning the ASNCLP commands inexecute-immediately mode . . . . . . . . .Sample ASNCLP scripts for setting upunidirectional Q Replication . . . . . . . . .Sample ASNCLP scripts for setting upunidirectional Q Replication from a Classic datasource . . . . . . . . . . . . . . . .Sample ASNCLP scripts for setting up bidirectionalQ Replication . . . . . . . . . . . . . .Sample ASNCLP scripts for setting up peer-to-peerQ Replication (two servers) . . . . . . . . .Sample ASNCLP scripts for setting up peer-to-peerQ Replication (three servers). . . . . . . . .Sample ASNCLP script for promoting unidirectionalconfigurations . . . . . . . . . . . . .Sample ASNCLP scripts for promoting peer-to-peerconfigurations . . . . . . . . . . . . .122335577Chapter 2. ASNCLP commands for SQLReplication . . . . . . . . . . . . . 9Sample ASNCLP script for setting up SQLReplication . . . . . . . . . . . . . .Sample ASNCLP script for setting up SQLReplication from a view . . . . . . . . . .ALTER DATASTAGE DEFINITION FOR commandALTER MEMBER ADD COLS command . . . .ALTER REGISTRATION command . . . . . .ALTER SUBSCRIPTION SET command . . . . .ASNCLP SESSION SET TO command (SQLReplication) . . . . . . . . . . . . . .CREATE CONTROL TABLES FOR command (SQLReplication) . . . . . . . . . . . . . .CREATE DATASTAGE DEFINITION FOR commandCREATE MEMBER command . . . . . . . .CREATE REGISTRATION command . . . . . .CREATE STMT command . . . . . . . . .CREATE SUBSCRIPTION SET command . . . .DROP CONTROL TABLES ON command . . . .DROP DATASTAGE DEFINITION FOR . . . . .DROP MEMBER command . . . . . . . . .DROP REGISTRATION command . . . . . . .DROP STMT command . . . . . . . . . .DROP SUBSCRIPTION SET command . . . . .OFFLINE LOAD command . . . . . . . . .PROMOTE REGISTRATION command . . . . .PROMOTE SUBSCRIPTION SET command. . . .SET CAPTURE SCHEMA command (SQLReplication) . . . . . . . . . . . . . .SET DROP command (SQL Replication) . . . . .SET LOG command . . . . . . . . . . .SET OUTPUT command (SQL Replication) . . . .SET PROFILE command (SQL Replication) . . . .SET RUN SCRIPT command (SQL Replication) . .SET SERVER command (SQL Replication) . . . .SET TRACE command. . . . . . . . . . . Copyright IBM Corp. 2004, 20126768717274767710Chapter 4. ASNCLP commands forunidirectional Q Replication . . . . . 791113141518ALTER ADD COLUMN command (unidirectionalreplication) . . . . . . . . . . . . . . 80ALTER CAPTURE PARAMETERS command(Classic replication) . . . . . . . . . . . . 82ALTER CONFIGURATION APPLY command . . . 83ALTER QSUB command (unidirectional replication) 84ALTER REPLQMAP command . . . . . . . . 89ASNCLP SESSION SET TO command . . . . . 91CREATE CONTROL TABLES FOR command . . . 92CREATE MQ SCRIPT command . . . . . . . 98CREATE QSUB command (unidirectionalreplication) . . . . . . . . . . . . . . 101CREATE REPLQMAP command . . . . . . . 122CREATE SCHEMASUB command . . . . . . 124CREATE SUBSCRIPTION OPTIONS command . . 127DROP CONTROL TABLES ON command . . . . 129DROP QSUB command . . . . . . . . . . 129DROP REPLQMAP command . . . . . . . . 132DROP SCHEMASUB command . . . . . . . 133DROP SUBSCRIPTION OPTIONS command . . . 133LIST QSUB command (Q Replication) . . . . . 134LIST REPLQMAP command (Q Replication) . . . 135LIST APPLY SCHEMA command. . . . . . . 137LIST CAPTURE SCHEMA command . . . . . 138LIST SCHEMASUB command . . . . . . . . 139LOAD DONE command. . . . . . . . . . 139PROMOTE QSUB command (unidirectionalreplication) . . . . . . . . . . . . . . 141PROMOTE REPLQMAP command . . . . . . 142REINIT SCHEMASUB command . . . . . . . 143SET APPLY SCHEMA command . . . . . . . 144SET CAPTURE SCHEMA command . . . . . . 145SET DROP command (unidirectional replication)145SET LOG command . . . . . . . . . . . 147SET OUTPUT command. . . . . . . . . . 4iii

SET PROFILE command. . . . . . .SET QMANAGER command . . . . .SET RUN SCRIPT command . . . . .SET SERVER command . . . . . . .SET TRACE command . . . . . . .SHOW SET ENV command . . . . .START QSUB command . . . . . . .START SCHEMASUB command . . . .STOP QSUB command . . . . . . .STOP SCHEMASUB command . . . .VALIDATE WSMQ ENVIRONMENT FORcommand . . . . . . . . . . .VALIDATE WSMQ MESSAGE FLOW FORREPLQMAP command . . . . . . .148151152155159159159162163165. 165. 166Chapter 5. ASNCLP commands formultidirectional Q Replication . . . . 169Deprecated commands . . . . . . . . . .DROP SUBTYPE command (bidirectionalreplication) . . . . . . . . . . . . .DROP SUBTYPE command (peer-to-peerreplication) . . . . . . . . . . . . .LOAD MULTIDIR REPL SCRIPT command(multidirectional Q Replication) . . . . . .SET MULTIDIR SCHEMA command(multidirectional Q Replication) . . . . . .SET SERVER command (multidirectional QReplication) . . . . . . . . . . . . .SET TABLES command (multidirectional QReplication) . . . . . . . . . . . . .ALTER ADD COLUMN command(multidirectional replication) . . . . . . . .ALTER QSUB command (bidirectional replication)ALTER QSUB command (peer-to-peer replication)ALTER REPLQMAP command . . . . . . .ASNCLP SESSION SET TO command . . . . .CREATE MQ SCRIPT command . . . . . . .CREATE QSUB command (bidirectionalreplication) . . . . . . . . . . . . . .CREATE QSUB command (peer-to-peer replication)CREATE REPLQMAP command . . . . . . .CREATE SCHEMASUB command . . . . . .CREATE SUBSCRIPTION OPTIONS command . .DROP CONTROL TABLES ON command . . . .DROP REPLQMAP command . . . . . . . .DROP QSUB command . . . . . . . . . .DROP SCHEMASUB command . . . . . . .DROP SUBGROUP command (multidirectional QReplication) . . . . . . . . . . . . . .DROP SUBSCRIPTION OPTIONS command . . .LIST APPLY SCHEMA command. . . . . . .LIST CAPTURE SCHEMA command . . . . .LIST SCHEMASUB command . . . . . . . .LOAD DONE command. . . . . . . . . .PROMOTE QSUB command (multidirectionalreplication) . . . . . . . . . . . . . .PROMOTE REPLQMAP command . . . . . .REINIT SCHEMASUB command . . . . . . .SET APPLY SCHEMA command . . . . . . .SET BIDI NODE command . . . . . . . . .SET CAPTURE SCHEMA command . . . . . 24226SET CONNECTION command (multidirectional QReplication) . . . . . . . . . . . . . .SET ENFORCE MATCHING CONSTRAINTScommand (multidirectional Q Replication). . . .SET LOG command . . . . . . . . . . .SET OUTPUT command (multidirectional QReplication) . . . . . . . . . . . . . .SET PEER NODE command . . . . . . . .SET PROFILE command. . . . . . . . . .SET QMANAGER command . . . . . . . .SET REFERENCE TABLE command(multidirectional Q Replication) . . . . . . .SET RUN SCRIPT command . . . . . . . .SET SUBGROUP command (multidirectional QReplication) . . . . . . . . . . . . . .SET TRACE command . . . . . . . . . .SHOW SET ENV command . . . . . . . .START QSUB command . . . . . . . . . .START SCHEMASUB command . . . . . . .STOP QSUB command . . . . . . . . . .STOP SCHEMASUB command . . . . . . .VALIDATE WSMQ ENVIRONMENT FORcommand . . . . . . . . . . . . . .VALIDATE WSMQ MESSAGE FLOW FORREPLQMAP command . . . . . . . . . 48249Chapter 6. ASNCLP commands forEvent Publishing . . . . . . . . . . 251Sample ASNCLP scripts for setting up EventPublishing . . . . . . . . . . . . . .ALTER ADD COLUMN command (EventPublishing) . . . . . . . . . . . . . .ALTER PUBQMAP command . . . . . . . .ALTER PUB command . . . . . . . . . .CREATE CONTROL TABLES FOR command. . .CREATE MQ SCRIPT command (Event Publishing)CREATE PUBQMAP command . . . . . . .CREATE PUB command. . . . . . . . . .DROP CONTROL TABLES ON command . . . .DROP PUBQMAP command . . . . . . . .DROP PUB command . . . . . . . . . .LIST PUBS command. . . . . . . . . . .LIST PUBQMAPS command . . . . . . . .LIST CAPTURE SCHEMA command . . . . .PROMOTE PUB command . . . . . . . . .PROMOTE PUBQMAP command . . . . . .SET CAPTURE SCHEMA command . . . . . .SET LOG command . . . . . . . . . . .SET OUTPUT command. . . . . . . . . .SET QMANAGER command . . . . . . . .SET RUN SCRIPT command . . . . . . . .SET SERVER command (Event Publishing) . . .SET TRACE command . . . . . . . . . .SHOW SET ENV command . . . . . . . .START PUB command . . . . . . . . . .STOP PUB command . . . . . . . . . . .VALIDATE WSMQ ENVIRONMENT FORcommand . . . . . . . . . . . . . .ASNCLP Program Reference for Replication and Event 76277279280281281282283285288288288289289

Chapter 7. ASNCLP commands for theReplication Alert Monitor . . . . . . 291Sample ASNCLP script for setting up theReplication Alert Monitor . . . . . . . .ALTER ALERT CONDITIONS FOR APPLYcommand . . . . . . . . . . . . .ALTER ALERT CONDITIONS FOR CAPTUREcommand . . . . . . . . . . . . .ALTER ALERT CONDITIONS FOR QAPPLYcommand . . . . . . . . . . . . .ALTER ALERT CONDITIONS FOR QCAPTUREcommand . . . . . . . . . . . . .ALTER CONTACT command . . . . . . .ALTER GROUP command . . . . . . . .ALTER MONITOR SUSPENSION command . .ALTER MONITOR SUSPENSION TEMPLATEcommand . . . . . . . . . . . . .CREATE ALERT CONDITIONS FOR APPLYcommand . . . . . . . . . . . . .CREATE ALERT CONDITIONS FOR CAPTUREcommand . . . . . . . . . . . . .CREATE ALERT CONDITIONS FOR QAPPLYcommand . . . . . . . . . . . . .CREATE ALERT CONDITIONS FOR QCAPTUREcommand . . . . . . . . . . . . .CREATE CONTACT command . . . . . .CREATE CONTROL TABLES FOR command. .CREATE GROUP command . . . . . . .CREATE MONITOR SUSPENSION command .CREATE MONITOR SUSPENSION TEMPLATEcommand . . . . . . . . . . . . . 292. 293. 296. 298.300302303304. 305. 306. 308DELEGATE CONTACT command . . . .DROP ALERT CONDITIONS FOR APPLYcommand . . . . . . . . . . . .DROP ALERT CONDITIONS FOR CAPTUREcommand . . . . . . . . . . . .DROP ALERT CONDITIONS FOR QAPPLYcommand . . . . . . . . . . . .DROP ALERT CONDITIONS FOR QCAPTUREcommand . . . . . . . . . . . .DROP CONTACT command . . . . . .DROP GROUP command . . . . . . .DROP MONITOR SUSPENSION command .DROP MONITOR SUSPENSION TEMPLATEcommand . . . . . . . . . . . .LIST MONITOR SUSPENSION command . .LIST MONITOR SUSPENSION TEMPLATEcommand . . . . . . . . . . . .SET OUTPUT command. . . . . . . .SET SERVER command . . . . . . . .SUBSTITUTE CONTACT command . . . .Contacting IBM. 319. 320. 320. 321. 323. 323.321321322322323324324326. . . . . . . . . . 327. 310How to read syntax diagrams . . . . 329.312313314316317Notices and trademarks . . . . . . . 331Index . . . . . . . . . . . . . . . 335. 318Contentsv

viASNCLP Program Reference for Replication and Event Publishing

Chapter 1. Getting started with the ASNCLP programThe replication programs store information about your configurations in controltables. The ASNCLP commands create, modify, and remove this information.The ASNCLP program generates SQL scripts that insert or modify information intothe control tables about replication sources, targets, queues, and other options. Youcan use multiple commands together to generate the SQL for an entireconfiguration. Three types of commands are available:Task commandsThese commands create, modify, list, or remove replication objects such ascontrol tables and queue maps. They also start objects such as Qsubscriptions and publications.Environment commandsThese commands define the environment for task commands. For example,they define the servers where objects are created, set defaults for taskcommands, and identify output files for messages that are issued when theASNCLP processes task commands.Validation commandsThese commands validate some aspects of the runtime environment for QCapture and Q Apply. For example, they can validate the attributes ofWebSphere MQ objects for replication or publishing.The ASNCLP program can process these commands in one of three modes:BatchAssemble ASNCLP commands in a scriptfile that is processed by a single invocationof the programInteractiveRun ASNCLP commands one at a time froma command promptExecute immediatelyRun independent operational commandssuch as START QSUBThe best way to get started writing ASNCLP scripts is to work from the examplesfound in these topics:v Sample ASNCLP scripts for setting up SQL Replicationv Sample ASNCLP scripts for Q Replicationv Sample ASNCLP scripts for setting up Event Publishingv Sample ASNCLP scripts for setting up the Replication Alert MonitorBefore you run the ASNCLP programBefore you run the ASNCLP program, you might need to take some configurationsteps depending on the operating system on which the program runs and theservers to which it connects. Copyright IBM Corp. 2004, 20121

Supported operating systemsThe ASNCLP program runs on Linux, UNIX, Windows, z/OS, and UNIX SystemServices (USS) on z/OS . The ASNCLP program does not run natively on Systemi .The ASNCLP commands generate replication definitions for all operating systemenvironments that are supported by the replication products: z/OS, System i (SQLReplication only), Linux, UNIX, and Windows. You must have connectivity to eachserver for which you are generating replication definitions; that is, you must beable to issue a database connection statement to each of the servers.Note: Additional configuration steps are required to enable the ASNCLP to runnatively on z/OS or on USS. For details, see Optional: Enabling the ASNCLPprogram to run with JCL or Optional: Enabling the ASNCLP program to run onUSS in the Information Management Software for z/OS Solutions InformationCenter.Restriction: The ASNCLP program does not support z/VM or VSE because DB2 in these operating system environments does not support the replicationarchitecture for DB2 Version 8 and later.Setting up a Java environment to run the ASNCLP programThe ASNCLP program runs in a Java environment. Your PATH environmentvariable must contain a path to a Java runtime environment in order to run theASNCLP program.Starting with Version 9.7 Fix Pack 2, the ASNCLP program automatically sets thepath to a Java runtime environment (JVM) that was installed along with DB2before it processes commands.For all DB2 products except the IBM Data Server Runtime Client, the DB2Database for Linux, UNIX, and Windows installation process automatically installsthe SDK for Java. If you need to install the SDK, go to the "IBM developer kits"page on IBM developerWorks : tml. The IBM SDK for Java must support the code page under which youplan to run the ASNCLP program. When a code set is not supported by the IBMSDK for an operating system, you must run the ASNCLP on another operatingsystem whose SDK supports the code page. For example, character set 5026(Cp290)is not supported by the IBM JDK for HP-UX and Solaris, so you must run theASNCLP from Linux, AIX , or Windows.Use the following procedure if the PATH environment variable does not contain apath to a Java runtime environment.ProcedureAdd the following path to your PATH environment variable:INSTDIR\java\jdkWhere INSTDIR is the DB2 instance directory. On Linux and UNIX, the instancedirectory is the INSTDIR/sqllib directory, where INSTDIR is the home directory ofthe instance owner. On Windows, the instance directory is the \sqllib directorywhere DB2 was installed.2ASNCLP Program Reference for Replication and Event Publishing

ExamplesTo set the PATH environment variable from a UNIX commandprompt:exportPATH PATH:/u/INSTDIR/sqllib/java/jdkTo set the PATH environment variable from a Windowscommand prompt:set PATH %PATH%;%\INSTDIR\sqllib\java\jdkNote: On Windows, if the database manager stores the value of the JDK PATHdatabase configuration parameter as c:\program files\ibm\sqllib\java\jdk, thespace in program files can cause a problem for the ASNCLP program. To avoidthis problem, change the value of JDK PATH to c:progra 1\ibm\sqllib\java\jdk.For example:db2 update dbm cfg using JDK PATH c:\progra 1\ibm\sqllib\java\jdkBinding z/OS packages for the ASNCLP programBefore you use the ASNCLP program with DB2 for z/OS, you must bind the basicDRDA and CLI packages to the DB2 subsystem that you will be working with.Before you beginBefore you can bind the z/OS packages, you must connect to the DB2 subsystemon the z/OS server.ProcedureTo bind the basic z/OS packages for the ASNCLP program, open an operatingsystem command prompt and issue the following command:bind @ddcsmvs.lst blocking all sqlerror continuedb2 bind @db2cli.lst isolation ur blocking allIf you do not perform this bind, the first time you use the ASNCLP program witha DB2 for z/OS server, the ASNCLP program might return the following errormessage:ASN1560E The replication action ended in error. An SQL error was encountered.SQL Message: "[IBM][CLI Driver][DB2] SQL0805N Package"package name" was not found. SQLSTATE 51002ASNCLP configuration fileTo access Classic or Oracle sources, the ASNCLP program requires connectivityinformation to be provided through a configuration file.You can also use a configuration file when the ASNCLP is running on UNIXSystem Services for z/OS (USS). When you run ASNCLP on USS, you also havethe choice of specifying connection information in a communication database inthe same manner that is required when running ASNCLP natively on z/OS. Formore details, see Optional: Enabling the ASNCLP program to run with JCL.Chapter 1. Getting started with the ASNCLP program3

The ASNCLP configuration file contains a group of lines for each data source thatthe ASNCLP needs to access. Each grouping has a unique name for the groupfollowed by lines that specify the connection information. The unique name is usedin ASNCLP scripts to identify a source.SyntaxSpecify the server information in the configuration file in the following format:[NAME]Type source typeData source data source nameHost host namePort port numberCodepage code page.Parameters[NAME]Specifies a unique name for a configuration. You provide this name inASNCLP scripts so that the ASNCLP program can connect to the data source.You can define multiple servers in a single configuration file by indicating thebeginning of a new server definition in the enclosing brackets (for example,[NAME2]).Important: The value cannot be longer than eight characters.TypeSpecifies the type of server:Classic replicationSpecify Type classic.ASNCLP on USSIf the server is DB2 for z/OS or DB2 for Linux, UNIX, and Windowsand you are running the ASNCLP on USS, specify Type DB2.Oracle sourcesSpecify Type oracle.Data sourceSpecifies the location of the source data:Classic replicationSpecifies the name of the query processor on the Classic data server.ASNCLP on USSIf you are running the ASNCLP on USS, for DB2 sources thisparameter specifies the DB2 for z/OS location name or DB2 for Linux,UNIX, and Windows database name.Oracle sourcesSpecifies the name of the Oracle database.HostSpecifies the host name or IP address of

SET PROFILE command.148 SET QMANAGER command .151 SET RUN SCRIPT command .152 SET SERVER