程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> DB2數據庫 >> DB2教程 >> 單向Q復制實踐:db2表復制到db2

單向Q復制實踐:db2表復制到db2

編輯:DB2教程

環境:

Macbook Mac OS X 10.5.6

cpu:酷睿2雙核2.1GHZ, DDR667 4GB

VMware Fusion : 運行Windows xp sp3

WebSphere MQ V6.0

DB2 Express-C V9.5.2

Q 復制是一種新的高速技術,用來在 IBM DB2 Universal Database 管理的數據庫之間移動數據。它是剛剛發布的 DB2 Information Integrator Version 8.2 中的一個亮點。Q 復制如此之快的原因之一是,它使用了強大的業務集成產品 WebSphere MQ,以壓縮消息的形式在網絡上縮放數據。(快意味著該產品在復制大量數據庫更新時等待時間短,或者延遲時間短。)如何設置一個簡單的 Q 復制場景:兩個遠程數據庫之間的單路(one-way)或單方向(unidirectional) 復制。除此之外,您還將了解如何創建和使用 WebSphere MQ 隊列管理器、消息隊列,以及為復制提供傳輸層的通道,只需一台計算機即可,但是您需要設置 WebSphere MQ 和 Q 復制,以模擬兩台遠程系統之間的數據移動,這樣,您就可以把教程中學到的知識應用到實際的生產環境中。與此同時,您還會在本教程的指導下,逐步掌握 Replication Center 以及其他便於進行 Q 復制的配置及管理的工具和向導的使用。

大致步驟:

* 如何創建並使用 WebSphere MQ 隊列管理器、隊列和通道。

* 如何能夠將 DB2 數據庫用於復制。

* 如何設置並操作 Q Capture 和 Q Apply 程序。

* 如何創建復制隊列映射,把源數據庫和目標數據庫連接起來。

* 如何創建 Q 訂閱,把源表映射到目標表。

如果您具備 DB2 Universal Database 的基本知識(如何創建數據庫,用命令或控制中心查看表的內容,以及發布一些簡單的 SQL 語句)

Microsoft Windows XP [版本 5.1.2600]

(C) 版權所有 1985-2001 Microsoft Corp.

C:Documents and Settingsxujm>crtmqm SRC_QM
WebSphere MQ 隊列管理器已創建。
創建或替換 SRC_QM 的缺省對象。
缺省對象統計:43 個已創建。0 個已替換。0 個已失敗。
正在完成設置。
設置完成。

C:Documents and Settingsxujm>crtmqm TGT_QM
WebSphere MQ 隊列管理器已創建。
創建或替換 TGT_QM 的缺省對象。
缺省對象統計:43 個已創建。0 個已替換。0 個已失敗。
正在完成設置。
設置完成。

C:Documents and Settingsxujm>strmqm SRC_QM
WebSphere MQ 隊列管理器“SRC_QM”正在啟動。
在日志重放階段在隊列管理器“SRC_QM”上訪問了 5 條日志記錄。
完成隊列管理器“SRC_QM”的日志重放。
為隊列管理器“SRC_QM”恢復了事務管理器狀態。
WebSphere MQ 隊列管理器‘SRC_QM’已啟動。

C:Documents and Settingsxujm>strmqm TGT_QM
WebSphere MQ 隊列管理器“TGT_QM”正在啟動。
在日志重放階段在隊列管理器“TGT_QM”上訪問了 5 條日志記錄。
完成隊列管理器“TGT_QM”的日志重放。
為隊列管理器“TGT_QM”恢復了事務管理器狀態。
WebSphere MQ 隊列管理器‘TGT_QM’已啟動。

C:Documents and Settingsxujm>runmqsc
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
AMQ8146: WebSphere MQ 隊列管理器不可用。

未讀取 MQSC 命令。
所有命令均無語法錯誤。
已處理所有的有效 MQSC 命令。

C:Documents and Settingsxujm>runmqsc SRC_QM
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
啟動隊列管理器 SRC_QM 的 MQSC。


define qlocal('ADMINQ') DEFPSIST(YES)
     1 : define qlocal('ADMINQ') DEFPSIST(YES)
AMQ8006: WebSphere MQ 隊列已創建。
define ql('RESTARTQ') defpsist(YES)
     2 : define ql('RESTARTQ') defpsist(YES)
AMQ8006: WebSphere MQ 隊列已創建。
define QL('TGT_QM') USAGE(XMITQ) DEFPSIST(YES)
     3 : define QL('TGT_QM') USAGE(XMITQ) DEFPSIST(YES)
AMQ8006: WebSphere MQ 隊列已創建。
define qremote('SENDQ') RNAME('RECVQ') RQMNAME('TGT_QM') XMITQ('TGT_QM') DEFPSIS
T(YES)
     4 : define qremote('SENDQ') RNAME('RECVQ') RQMNAME('TGT_QM') XMITQ('TGT_QM'
) DEFPSIST(YES)
AMQ8006: WebSphere MQ 隊列已創建。

C:Documents and Settingsxujm>runmqsc TGT_QM
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
啟動隊列管理器 TGT_QM 的 MQSC。


define ql('recvq') defpsist(yes)
     1 : define ql('recvq') defpsist(yes)
AMQ8006: WebSphere MQ 隊列已創建。
DEFINE QLOCAL('SRC_QM') USAGE(XMITQ) DEFPSIST(YES)
     2 : DEFINE QLOCAL('SRC_QM') USAGE(XMITQ) DEFPSIST(YES)
AMQ8006: WebSphere MQ 隊列已創建。
DEFINE QREMOTE('ADMINQ') RNAME('ADMINQ') RQMNAME('SRC_QM')XMITQ('SRC_QM') DEFPSI
ST(YES)
     3 : DEFINE QREMOTE('ADMINQ') RNAME('ADMINQ') RQMNAME('SRC_QM')XMITQ('SRC_QM
') DEFPSIST(YES)
AMQ8405: 在下面的命令段結尾或臨近結尾處檢測到語法錯誤:-
DEFINE QREMOTE('ADMINQ') RNAME('ADMINQ') RQMNAME('SRC_QM')XMITQ

AMQ8427: MQSC 命令的有效語法為:

  DEFINE QREMOTE(q_name)
     [ CLUSNL(namelist_name) ]               [ CLUSTER(cluster_name) ]
     [ DEFBIND( NOTFIXED | OPEN ) ]          [ DEFPRTY(integer) ]
     [ DEFPSIST( YES | NO ) ]                [ DESCR(string) ]
     [ LIKE(qremote_name) ]                  [ PUT( ENABLED | DISABLED ) ]
     [ REPLACE | NOREPLACE ]                 [ RNAME(string) ]
     [ RQMNAME(string) ]                     [ SCOPE( QMGR | CELL ) ]
     [ XMITQ(string) ]                       [ CLWLRANK(integer) ]
     [ CLWLPRTY(integer) ]
DEFINE QREMOTE('ADMINQ') RNAME('ADMINQ') RQMNAME('SRC_QM') XMITQ('SRC_QM') DEFPS
IST(YES)
     4 : DEFINE QREMOTE('ADMINQ') RNAME('ADMINQ') RQMNAME('SRC_QM') XMITQ('SRC_Q
M') DEFPSIST(YES)
AMQ8006: WebSphere MQ 隊列已創建。
DEFINE QMODEL('IBMQREP.SPILL.MODELQ') DEFSOPT(SHARED)
     5 : DEFINE QMODEL('IBMQREP.SPILL.MODELQ') DEFSOPT(SHARED)
AMQ8006: WebSphere MQ 隊列已創建。

       :
DEFINE QMODEL('IBMQREP.SPILL.MODELQ') DEFSOPT(SHARED) MSGDLVSQ(FIFO) DEFTYPE(PER
MDYN)
     6 : DEFINE QMODEL('IBMQREP.SPILL.MODELQ') DEFSOPT(SHARED) MSGDLVSQ(FIFO) DE
FTYPE(PERMDYN)
AMQ8150: WebSphere MQ 對象已存在。
DEFINE QMODEL('IBMQREP.SPILL.MODELQ') DEFSOPT(SHARED) MSGDLVSQ(FIFO) DEFTYPE(PER
MDYN)
     7 : DEFINE QMODEL('IBMQREP.SPILL.MODELQ') DEFSOPT(SHARED) MSGDLVSQ(FIFO) DE
FTYPE(PERMDYN)
AMQ8006: WebSphere MQ 隊列已創建。


C:Documents and Settingsxujm>ipconfig

Windows IP Configuration


Ethernet adapter 本地連接:

        Connection-specific DNS Suffix  . : localdomain
        IP Address. . . . . . . . . . . . : 172.16.157.128
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 172.16.157.2

C:Documents and Settingsxujm>runmqsc SRC_QM
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
啟動隊列管理器 SRC_QM 的 MQSC。


DEFINE CHL ('SRC_QM.TO.TGT_QM') CHLTYPE(SDR) TRPTYPE(TCP) CONNAME ('172.16.157.1
28(1450)') XMITQ('TGT_QM') DISCINT(0)
     1 : DEFINE CHL ('SRC_QM.TO.TGT_QM') CHLTYPE(SDR) TRPTYPE(TCP) CONNAME ('172
.16.157.128(1450)') XMITQ('TGT_QM') DISCINT(0)
AMQ8014: WebSphere MQ 通道已創建。

       :
                                                                DEFINE CHL ('TGT
_QM.TO.SRC_QM') CHLTYPE(RCVR) TRPTYPE(TCP)
     2 :                                                                DEFINE C
HL ('TGT_QM.TO.SRC_QM') CHLTYPE(RCVR) TRPTYPE(TCP)
AMQ8014: WebSphere MQ 通道已創建。

       :
C:Documents and Settingsxujm>runmqsc TGT_QM
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
啟動隊列管理器 TGT_QM 的 MQSC。


DEFINE CHL ('TGT_QM.TO.SRC_QM') CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('172.16.157.12
8(1451)') XMITQ('SRC_QM') DISCINT(0)
     1 : DEFINE CHL ('TGT_QM.TO.SRC_QM') CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('172.
16.157.128(1451)') XMITQ('SRC_QM') DISCINT(0)
AMQ8014: WebSphere MQ 通道已創建。
DEFINE CHL ('SRC_QM.TO.TGT_QM') CHLTYPE(RCVR) TRPTYPE(TCP)
     2 : DEFINE CHL ('SRC_QM.TO.TGT_QM') CHLTYPE(RCVR) TRPTYPE(TCP)
AMQ8014: WebSphere MQ 通道已創建。
END
     3 : END
已讀取 2 個 MQSC 命令。
所有命令均無語法錯誤。
已處理所有的有效 MQSC 命令。

C:Documents and Settingsxujm>


- 腳本開始 1--   DatabaseDB2LUOW (SAMPLE) [警告 *** 請不要改變此行] --

-- CONNECT TO SAMPLE USER XXXX using XXXX;

CREATE TABLESPACE QCASN3 MANAGED BY SYSTEM USING ('QCASN3_TSC');

CREATE TABLE ASN.IBMQREP_CAPPARMS
(
 QMGR VARCHAR(48) NOT NULL,
 REMOTE_SRC_SERVER VARCHAR(18),
 RESTARTQ VARCHAR(48) NOT NULL,
 ADMINQ VARCHAR(48) NOT NULL,
 STARTMODE VARCHAR(6) NOT NULL WITH DEFAULT 'WARMSI',
 MEMORY_LIMIT INTEGER NOT NULL WITH DEFAULT 500,
 COMMIT_INTERVAL INTEGER NOT NULL WITH DEFAULT 500,
 AUTOSTOP CHARACTER(1) NOT NULL WITH DEFAULT 'N',
 MONITOR_INTERVAL INTEGER NOT NULL WITH DEFAULT 60000,
 MONITOR_LIMIT INTEGER NOT NULL WITH DEFAULT 10080,
 TRACE_LIMIT INTEGER NOT NULL WITH DEFAULT 10080,
 SIGNAL_LIMIT INTEGER NOT NULL WITH DEFAULT 10080,
 PRUNE_INTERVAL INTEGER NOT NULL WITH DEFAULT 300,
 SLEEP_INTERVAL INTEGER NOT NULL WITH DEFAULT 5000,
 LOGREUSE CHARACTER(1) NOT NULL WITH DEFAULT 'N',
 LOGSTDOUT CHARACTER(1) NOT NULL WITH DEFAULT 'N',
 TERM CHARACTER(1) NOT NULL WITH DEFAULT 'Y',
 CAPTURE_PATH VARCHAR(1040) WITH DEFAULT NULL,
 ARCH_LEVEL CHARACTER(4) NOT NULL WITH DEFAULT '0905',
 COMPATIBILITY CHARACTER(4) NOT NULL WITH DEFAULT '0905',
 LOB_SEND_OPTION CHARACTER(1) NOT NULL WITH DEFAULT 'I',
 QFULL_NUM_RETRIES INTEGER NOT NULL WITH DEFAULT 30,
 QFULL_RETRY_DELAY INTEGER NOT NULL WITH DEFAULT 250
)
 IN QCASN3;

ALTER TABLE ASN.IBMQREP_CAPPARMS
 VOLATILE CARDINALITY;

CREATE UNIQUE INDEX ASN.IX1CQMGRCOL ON ASN.IBMQREP_CAPPARMS
(
 QMGR ASC
);

CREATE TABLE ASN.IBMQREP_SENDQUEUES
(
 PUBQMAPNAME VARCHAR(128) NOT NULL,
 SENDQ VARCHAR(48) NOT NULL,
 RECVQ VARCHAR(48),
 MESSAGE_FORMAT CHARACTER(1) NOT NULL WITH DEFAULT 'C',
 MSG_CONTENT_TYPE CHARACTER(1) NOT NULL WITH DEFAULT 'T',
 STATE CHARACTER(1) NOT NULL WITH DEFAULT 'A',
 STATE_TIME TIMESTAMP NOT NULL WITH DEFAULT CURRENT TIMESTAMP,
 STATE_INFO CHARACTER(8),
 ERROR_ACTION CHARACTER(1) NOT NULL WITH DEFAULT 'S',
 HEARTBEAT_INTERVAL INTEGER NOT NULL WITH DEFAULT 60,
 MAX_MESSAGE_SIZE INTEGER NOT NULL WITH DEFAULT 64,
 APPLY_SERVER VARCHAR(18),
 APPLY_ALIAS VARCHAR(8),
 APPLY_SCHEMA VARCHAR(128),
 DESCRIPTION VARCHAR(254),
 MESSAGE_CODEPAGE INTEGER,
 COLUMN_DELIMITER CHARACTER(1),
 STRING_DELIMITER CHARACTER(1),
 RECORD_DELIMITER CHARACTER(1),
 DECIMAL_POINT CHARACTER(1),
 SENDRAW_IFERROR CHARACTER(1) NOT NULL WITH DEFAULT 'N',
 PRIMARY KEY(SENDQ)
)
 IN QCASN3;

ALTER TABLE ASN.IBMQREP_SENDQUEUES
 VOLATILE CARDINALITY;

CREATE UNIQUE INDEX ASN.IX1PUBMAPCOL ON ASN.IBMQREP_SENDQUEUES
(
 PUBQMAPNAME ASC
);

CREATE TABLE ASN.IBMQREP_SUBS
(
 SUBNAME VARCHAR(132) NOT NULL,
 SOURCE_OWNER VARCHAR(128) NOT NULL,
 SOURCE_NAME VARCHAR(128) NOT NULL,
 TARGET_SERVER VARCHAR(18),
 TARGET_ALIAS VARCHAR(8),
 TARGET_OWNER VARCHAR(128),
 TARGET_NAME VARCHAR(128),
 TARGET_TYPE INTEGER,
 APPLY_SCHEMA VARCHAR(128),
 SENDQ VARCHAR(48) NOT NULL,
 SEARCH_CONDITION VARCHAR(2048) WITH DEFAULT NULL,
 SUB_ID INTEGER WITH DEFAULT NULL,
 SUBTYPE CHARACTER(1) NOT NULL WITH DEFAULT 'U',
 ALL_CHANGED_ROWS CHARACTER(1) NOT NULL WITH DEFAULT 'N',
 BEFORE_VALUES CHARACTER(1) NOT NULL WITH DEFAULT 'N',
 CHANGED_COLS_ONLY CHARACTER(1) NOT NULL WITH DEFAULT 'Y',
 HAS_LOADPHASE CHARACTER(1) NOT NULL WITH DEFAULT 'I',
 STATE CHARACTER(1) NOT NULL WITH DEFAULT 'N',
 STATE_TIME TIMESTAMP NOT NULL WITH DEFAULT CURRENT TIMESTAMP,
 STATE_INFO CHARACTER(8),
 STATE_TRANSITION VARCHAR(256) FOR BIT DATA,
 SUBGROUP VARCHAR(30) WITH DEFAULT NULL,
 SOURCE_NODE SMALLINT NOT NULL WITH DEFAULT 0,
 TARGET_NODE SMALLINT NOT NULL WITH DEFAULT 0,
 GROUP_MEMBERS CHARACTER(254) FOR BIT DATA WITH DEFAULT NULL,
 OPTIONS_FLAG CHARACTER(4) NOT NULL WITH DEFAULT 'NNNN',
 SUPPRESS_DELETES CHARACTER(1) NOT NULL WITH DEFAULT 'N',
 DESCRIPTION VARCHAR(200),
 TOPIC VARCHAR(256),
 PRIMARY KEY(SUBNAME),
 CONSTRAINT FKSENDQ FOREIGN KEY(SENDQ) REFERENCES
 ASN.IBMQREP_SENDQUEUES(SENDQ)
)
 IN QCASN3;

ALTER TABLE ASN.IBMQREP_SUBS
 VOLATILE CARDINALITY;

CREATE TABLE ASN.IBMQREP_SRC_COLS
(
 SUBNAME VARCHAR(132) NOT NULL,
 SRC_COLNAME VARCHAR(128) NOT NULL,
 IS_KEY SMALLINT NOT NULL WITH DEFAULT 0,
 COL_OPTIONS_FLAG CHARACTER(10) NOT NULL WITH DEFAULT 'NNNNNNNNNN',
 PRIMARY KEY(SUBNAME, SRC_COLNAME),
 CONSTRAINT FKSUBS FOREIGN KEY(SUBNAME) REFERENCES ASN.IBMQREP_SUBS
(SUBNAME)
)
 IN QCASN3;

ALTER TABLE ASN.IBMQREP_SRC_COLS
 VOLATILE CARDINALITY;

CREATE TABLE ASN.IBMQREP_SRCH_COND
(
 ASNQREQD INTEGER
)
 IN QCASN3;

CREATE TABLE ASN.IBMQREP_SIGNAL
(
 SIGNAL_TIME TIMESTAMP NOT NULL WITH DEFAULT CURRENT TIMESTAMP,
 SIGNAL_TYPE VARCHAR(30) NOT NULL,
 SIGNAL_SUBTYPE VARCHAR(30),
 SIGNAL_INPUT_IN VARCHAR(500),
 SIGNAL_STATE CHARACTER(1) NOT NULL WITH DEFAULT 'P',
 SIGNAL_LSN CHARACTER(10) FOR BIT DATA
)
 DATA CAPTURE CHANGES
 IN QCASN3;

ALTER TABLE ASN.IBMQREP_SIGNAL
 VOLATILE CARDINALITY;

CREATE TABLE ASN.IBMQREP_CAPTRACE
(
 OperaTION CHARACTER(8) NOT NULL,
 TRACE_TIME TIMESTAMP NOT NULL,
 DESCRIPTION VARCHAR(1024) NOT NULL,
 REASON_CODE INTEGER,
 MQ_CODE INTEGER
)
 IN QCASN3;

CREATE TABLE ASN.IBMQREP_CAPMON
(
 MONITOR_TIME TIMESTAMP NOT NULL,
 CURRENT_LOG_TIME TIMESTAMP NOT NULL,
 CAPTURE_IDLE INTEGER NOT NULL,
 CURRENT_MEMORY INTEGER NOT NULL,
 ROWS_PROCESSED INTEGER NOT NULL,
 TRANS_SKIPPED INTEGER NOT NULL,
 TRANS_PROCESSED INTEGER NOT NULL,
 TRANS_SPILLED INTEGER NOT NULL,
 MAX_TRANS_SIZE INTEGER NOT NULL,
 QUEUES_IN_ERROR INTEGER NOT NULL,
 RESTART_SEQ CHARACTER(10) FOR BIT DATA NOT NULL,
 CURRENT_SEQ CHARACTER(10) FOR BIT DATA NOT NULL,
 LAST_EOL_TIME TIMESTAMP,
 PRIMARY KEY(MONITOR_TIME)
)
 IN QCASN3;

ALTER TABLE ASN.IBMQREP_CAPMON
 VOLATILE CARDINALITY;

CREATE TABLE ASN.IBMQREP_CAPQMON
(
 MONITOR_TIME TIMESTAMP NOT NULL,
 SENDQ VARCHAR(48) NOT NULL,
 ROWS_PUBLISHED INTEGER NOT NULL,
 TRANS_PUBLISHED INTEGER NOT NULL,
 CHG_ROWS_SKIPPED INTEGER NOT NULL,
 DELROWS_SUPPRESSED INTEGER NOT NULL,
 ROWS_SKIPPED INTEGER NOT NULL,
 QFULL_ERROR_COUNT INTEGER NOT NULL,
 LOBS_TOO_BIG INTEGER NOT NULL WITH DEFAULT 0,
 XMLDOCS_TOO_BIG INTEGER NOT NULL WITH DEFAULT 0,
 PRIMARY KEY(MONITOR_TIME, SENDQ)
)
 IN QCASN3;

ALTER TABLE ASN.IBMQREP_CAPQMON
 VOLATILE CARDINALITY;

CREATE TABLE ASN.IBMQREP_CAPENQ
(
 LOCKNAME INTEGER
)
 IN QCASN3;

CREATE TABLE ASN.IBMQREP_ADMINMSG
(
 MQMSGID CHARACTER(24) FOR BIT DATA NOT NULL,
 MSG_TIME TIMESTAMP NOT NULL WITH DEFAULT CURRENT TIMESTAMP,
 PRIMARY KEY(MQMSGID)
)
 IN QCASN3;

ALTER TABLE ASN.IBMQREP_ADMINMSG
 VOLATILE CARDINALITY;

CREATE TABLE ASN.IBMQREP_IGNTRAN
(
 AUTHID CHARACTER(128),
 AUTHTOKEN CHARACTER(30),
 PLANNAME CHARACTER(8),
 IGNTRANTRC CHARACTER(1) NOT NULL WITH DEFAULT 'Y'
)
 IN QCASN3;

CREATE TABLE ASN.IBMQREP_IGNTRANTRC
(
 IGNTRAN_TIME TIMESTAMP NOT NULL WITH DEFAULT CURRENT TIMESTAMP,
 AUTHID CHARACTER(128),
 AUTHTOKEN CHARACTER(30),
 PLANNAME CHARACTER(8),
 TRANSID CHARACTER(10) FOR BIT DATA NOT NULL,
 COMMITLSN CHARACTER(10) FOR BIT DATA NOT NULL
)
 IN QCASN3;

CREATE TABLE ASN.IBMQREP_CAPENVINFO
(
 NAME VARCHAR(30) NOT NULL,
 VALUE VARCHAR(3800)
)
 IN QCASN3;

INSERT INTO ASN.IBMQREP_CAPPARMS
 (qmgr, restartq, adminq, startmode, memory_limit, commit_interval,
 autostop, monitor_interval, monitor_limit, trace_limit, signal_limit,
 prune_interval, sleep_interval, logreuse, logstdout, term, arch_level
, compatibility)
 VALUES
 ('SRC_QM', 'RESTARTQ', 'ADMINQ', 'WARMSI', 500, 500, 'N', 60000,
 10080, 10080, 10080, 300, 5000, 'N', 'N', 'Y', '0905', '0905');

-- COMMIT;

-- 腳本開始 1--   DatabaseDB2LUOW (TARGET) [警告 *** 請不要改變此行] --

-- CONNECT TO TARGET USER XXXX using XXXX;

CREATE TABLESPACE QAASN2 MANAGED BY SYSTEM USING ('QAASN2_TSC');

CREATE TABLE ASN.IBMQREP_APPLYPARMS
(
 QMGR VARCHAR(48) NOT NULL,
 MONITOR_LIMIT INTEGER NOT NULL WITH DEFAULT 10080,
 TRACE_LIMIT INTEGER NOT NULL WITH DEFAULT 10080,
 MONITOR_INTERVAL INTEGER NOT NULL WITH DEFAULT 60000,
 PRUNE_INTERVAL INTEGER NOT NULL WITH DEFAULT 300,
 AUTOSTOP CHARACTER(1) NOT NULL WITH DEFAULT 'N',
 LOGREUSE CHARACTER(1) NOT NULL WITH DEFAULT 'N',
 LOGSTDOUT CHARACTER(1) NOT NULL WITH DEFAULT 'N',
 APPLY_PATH VARCHAR(1040) WITH DEFAULT NULL,
 ARCH_LEVEL CHARACTER(4) NOT NULL WITH DEFAULT '0905',
 TERM CHARACTER(1) NOT NULL WITH DEFAULT 'Y',
 PWDFILE VARCHAR(48) WITH DEFAULT NULL,
 DEADLOCK_RETRIES INTEGER NOT NULL WITH DEFAULT 3,
 SQL_CAP_SCHEMA VARCHAR(128) WITH DEFAULT NULL
)
 IN QAASN2;

ALTER TABLE ASN.IBMQREP_APPLYPARMS
 VOLATILE CARDINALITY;

CREATE UNIQUE INDEX ASN.IX1AQMGRCOL ON ASN.IBMQREP_APPLYPARMS
(
 QMGR ASC
);

CREATE TABLE ASN.IBMQREP_RECVQUEUES
(
 REPQMAPNAME VARCHAR(128) NOT NULL,
 RECVQ VARCHAR(48) NOT NULL,
 SENDQ VARCHAR(48) WITH DEFAULT NULL,
 ADMINQ VARCHAR(48) NOT NULL,
 NUM_APPLY_AGENTS INTEGER NOT NULL WITH DEFAULT 16,
 MEMORY_LIMIT INTEGER NOT NULL WITH DEFAULT 64,
 CAPTURE_SERVER VARCHAR(18) NOT NULL,
 CAPTURE_ALIAS VARCHAR(8) NOT NULL,
 CAPTURE_SCHEMA VARCHAR(128) NOT NULL WITH DEFAULT 'ASN',
 STATE CHARACTER(1) NOT NULL WITH DEFAULT 'A',
 STATE_TIME TIMESTAMP NOT NULL WITH DEFAULT CURRENT TIMESTAMP,
 STATE_INFO CHARACTER(8),
 DESCRIPTION VARCHAR(254),
 SOURCE_TYPE CHARACTER(1) WITH DEFAULT ' ',
 MAXAGENTS_CORRELID INTEGER WITH DEFAULT NULL,
 PRIMARY KEY(RECVQ)
)
 IN QAASN2;

ALTER TABLE ASN.IBMQREP_RECVQUEUES
 VOLATILE CARDINALITY;

CREATE UNIQUE INDEX ASN.IX1REPMAPCOL ON ASN.IBMQREP_RECVQUEUES
(
 REPQMAPNAME ASC
);

CREATE TABLE ASN.IBMQREP_TARGETS
(
 SUBNAME VARCHAR(132) NOT NULL,
 RECVQ VARCHAR(48) NOT NULL,
 SUB_ID INTEGER WITH DEFAULT NULL,
 SOURCE_SERVER VARCHAR(18) NOT NULL,
 SOURCE_ALIAS VARCHAR(8) NOT NULL,
 SOURCE_OWNER VARCHAR(128) NOT NULL,
 SOURCE_NAME VARCHAR(128) NOT NULL,
 SRC_NICKNAME_OWNER VARCHAR(128),
 SRC_NICKNAME VARCHAR(128),
 TARGET_OWNER VARCHAR(128) NOT NULL,
 TARGET_NAME VARCHAR(128) NOT NULL,
 TARGET_TYPE INTEGER NOT NULL WITH DEFAULT 1,
 FEDERATED_TGT_SRVR VARCHAR(18) WITH DEFAULT NULL,
 STATE CHARACTER(1) NOT NULL WITH DEFAULT 'I',
 STATE_TIME TIMESTAMP NOT NULL WITH DEFAULT CURRENT TIMESTAMP,
 STATE_INFO CHARACTER(8),
 SUBTYPE CHARACTER(1) NOT NULL WITH DEFAULT 'U',
 CONFLICT_RULE CHARACTER(1) NOT NULL WITH DEFAULT 'K',
 CONFLICT_ACTION CHARACTER(1) NOT NULL WITH DEFAULT 'I',
 ERROR_ACTION CHARACTER(1) NOT NULL WITH DEFAULT 'Q',
 SPILLQ VARCHAR(48) WITH DEFAULT NULL,
 OKSQLSTATES VARCHAR(128) WITH DEFAULT NULL,
 SUBGROUP VARCHAR(30) WITH DEFAULT NULL,
 SOURCE_NODE SMALLINT NOT NULL WITH DEFAULT 0,
 TARGET_NODE SMALLINT NOT NULL WITH DEFAULT 0,
 GROUP_INIT_ROLE CHARACTER(1) WITH DEFAULT NULL,
 HAS_LOADPHASE CHARACTER(1) NOT NULL WITH DEFAULT 'N',
 LOAD_TYPE SMALLINT NOT NULL WITH DEFAULT 0,
 DESCRIPTION VARCHAR(254),
 SEARCH_CONDITION VARCHAR(2048) WITH DEFAULT NULL,
 MODELQ VARCHAR(36) NOT NULL WITH DEFAULT 'IBMQREP.SPILL.MODELQ',
 CCD_CONDENSED CHARACTER(1) WITH DEFAULT 'Y',
 CCD_COMPLETE CHARACTER(1) WITH DEFAULT 'Y',
 SOURCE_TYPE CHARACTER(1) WITH DEFAULT ' '
)
 IN QAASN2;

ALTER TABLE ASN.IBMQREP_TARGETS
 VOLATILE CARDINALITY;

CREATE UNIQUE INDEX ASN.IX1TARGETS ON ASN.IBMQREP_TARGETS
(
 SUBNAME ASC,
 RECVQ ASC
);

CREATE INDEX ASN.IX2TARGETS ON ASN.IBMQREP_TARGETS
(
 TARGET_OWNER ASC,
 TARGET_NAME ASC,
 RECVQ ASC,
 SOURCE_OWNER ASC,
 SOURCE_NAME ASC
);

CREATE INDEX ASN.IX3TARGETS ON ASN.IBMQREP_TARGETS
(
 RECVQ ASC,
 SUB_ID ASC
);

CREATE TABLE ASN.IBMQREP_TRG_COLS
(
 RECVQ VARCHAR(48) NOT NULL,
 SUBNAME VARCHAR(132) NOT NULL,
 SOURCE_COLNAME VARCHAR(254) NOT NULL,
 TARGET_COLNAME VARCHAR(128) NOT NULL,
 TARGET_COLNO INTEGER WITH DEFAULT NULL,
 MSG_COL_CODEPAGE INTEGER WITH DEFAULT NULL,
 MSG_COL_NUMBER SMALLINT WITH DEFAULT NULL,
 MSG_COL_TYPE SMALLINT WITH DEFAULT NULL,
 MSG_COL_LENGTH INTEGER WITH DEFAULT NULL,
 IS_KEY CHARACTER(1) NOT NULL,
 MAPPING_TYPE CHARACTER(1) WITH DEFAULT NULL,
 SRC_COL_MAP VARCHAR(2000) WITH DEFAULT NULL,
 BEF_TARG_COLNAME VARCHAR(128) WITH DEFAULT NULL
)
 IN QAASN2;

ALTER TABLE ASN.IBMQREP_TRG_COLS
 VOLATILE CARDINALITY;

CREATE UNIQUE INDEX ASN.IX1TRGCOL ON ASN.IBMQREP_TRG_COLS
(
 RECVQ ASC,
 SUBNAME ASC,
 TARGET_COLNAME ASC
);

CREATE TABLE ASN.IBMQREP_SPILLQS
(
 SPILLQ VARCHAR(48) NOT NULL,
 SUBNAME VARCHAR(132) NOT NULL,
 RECVQ VARCHAR(48) NOT NULL,
 PRIMARY KEY(SPILLQ)
)
 IN QAASN2;

ALTER TABLE ASN.IBMQREP_SPILLQS
 VOLATILE CARDINALITY;

CREATE TABLE ASN.IBMQREP_EXCEPTIONS
(
 EXCEPTION_TIME TIMESTAMP NOT NULL WITH DEFAULT CURRENT TIMESTAMP,
 RECVQ VARCHAR(48) NOT NULL,
 SRC_COMMIT_LSN VARCHAR(48) FOR BIT DATA NOT NULL,
 SRC_TRANS_TIME TIMESTAMP NOT NULL,
 SUBNAME VARCHAR(132) NOT NULL,
 REASON CHARACTER(12) NOT NULL,
 SQLCODE INTEGER,
 SQLSTATE CHARACTER(5),
 SQLERRMC VARCHAR(70) FOR BIT DATA,
 OperaTION VARCHAR(18) NOT NULL,
 TEXT CLOB(32768) NOT LOGGED NOT COMPACT NOT NULL,
 IS_APPLIED CHARACTER(1) NOT NULL,
 CONFLICT_RULE CHARACTER(1)
)
 IN QAASN2;

CREATE TABLE ASN.IBMQREP_APPLYTRACE
(
 OperaTION CHARACTER(8) NOT NULL,
 TRACE_TIME TIMESTAMP NOT NULL,
 DESCRIPTION VARCHAR(1024) NOT NULL,
 REASON_CODE INTEGER,
 MQ_CODE INTEGER
)
 IN QAASN2;

ALTER TABLE ASN.IBMQREP_APPLYTRACE
 VOLATILE CARDINALITY;

CREATE INDEX ASN.IX1TRCTMCOL ON ASN.IBMQREP_APPLYTRACE
(
 TRACE_TIME ASC
);

CREATE TABLE ASN.IBMQREP_APPLYMON
(
 MONITOR_TIME TIMESTAMP NOT NULL,
 RECVQ VARCHAR(48) NOT NULL,
 QSTART_TIME TIMESTAMP NOT NULL,
 CURRENT_MEMORY INTEGER NOT NULL,
 QDEPTH INTEGER NOT NULL,
 END2END_LATENCY INTEGER NOT NULL,
 QLATENCY INTEGER NOT NULL,
 APPLY_LATENCY INTEGER NOT NULL,
 TRANS_APPLIED INTEGER NOT NULL,
 ROWS_APPLIED INTEGER NOT NULL,
 TRANS_SERIALIZED INTEGER NOT NULL,
 RI_DEPENDENCIES INTEGER NOT NULL,
 RI_RETRIES INTEGER NOT NULL,
 DEADLOCK_RETRIES INTEGER NOT NULL,
 ROWS_NOT_APPLIED INTEGER NOT NULL,
 MONSTER_TRANS INTEGER NOT NULL,
 MEM_FULL_TIME INTEGER NOT NULL,
 APPLY_SLEEP_TIME INTEGER NOT NULL,
 SPILLED_ROWS INTEGER NOT NULL,
 SPILLEDROWSAPPLIED INTEGER NOT NULL,
 OLDEST_TRANS TIMESTAMP NOT NULL,
 OKSQLSTATE_ERRORS INTEGER NOT NULL,
 HEARTBEAT_LATENCY INTEGER NOT NULL,
 KEY_DEPENDENCIES INTEGER NOT NULL,
 UNIQ_DEPENDENCIES INTEGER NOT NULL,
 UNIQ_RETRIES INTEGER NOT NULL,
 OLDEST_INFLT_TRANS TIMESTAMP,
 JOB_DEPENDENCIES INTEGER,
 CAPTURE_LATENCY INTEGER,
 PRIMARY KEY(MONITOR_TIME, RECVQ)
)
 IN QAASN2;

ALTER TABLE ASN.IBMQREP_APPLYMON
 VOLATILE CARDINALITY;

CREATE TABLE ASN.IBMQREP_DONEMSG
(
 RECVQ VARCHAR(48) NOT NULL,
 MQMSGID CHARACTER(24) FOR BIT DATA NOT NULL,
 PRIMARY KEY(RECVQ, MQMSGID)
)
 IN QAASN2;

ALTER TABLE ASN.IBMQREP_DONEMSG
 VOLATILE CARDINALITY
 APPEND ON;

CREATE TABLE ASN.IBMQREP_SPILLEDROW
(
 SPILLQ VARCHAR(48) NOT NULL,
 MQMSGID CHARACTER(24) FOR BIT DATA NOT NULL,
 PRIMARY KEY(SPILLQ, MQMSGID)
)
 IN QAASN2;

ALTER TABLE ASN.IBMQREP_SPILLEDROW
 VOLATILE CARDINALITY;

CREATE TABLE ASN.IBMQREP_SAVERI
(
 SUBNAME VARCHAR(132) NOT NULL,
 RECVQ VARCHAR(48) NOT NULL,
 CONSTNAME VARCHAR(128) NOT NULL,
 TABSCHEMA VARCHAR(128) NOT NULL,
 TABNAME VARCHAR(128) NOT NULL,
 REFTABSCHEMA VARCHAR(128) NOT NULL,
 REFTABNAME VARCHAR(128) NOT NULL,
 ALTER_RI_DDL VARCHAR(1680) NOT NULL,
 TYPE_OF_LOAD CHARACTER(1) NOT NULL,
 DELETERULE CHARACTER(1),
 UPDATERULE CHARACTER(1)
)
 IN QAASN2;

ALTER TABLE ASN.IBMQREP_SAVERI
 VOLATILE CARDINALITY;

CREATE TABLE ASN.IBMQREP_APPLYENQ
(
 LOCKNAME INTEGER
)
 IN QAASN2;

CREATE TABLE ASN.IBMQREP_APPENVINFO
(
 NAME VARCHAR(30) NOT NULL,
 VALUE VARCHAR(3800)
)
 IN QAASN2;

INSERT INTO ASN.IBMQREP_APPLYPARMS
 (qmgr, monitor_limit, trace_limit, monitor_interval, prune_interval,
 autostop, logreuse, logstdout, arch_level, term, deadlock_retrIEs)
 VALUES
 ('TGT_QM', 10080, 10080, 60000, 300, 'N', 'N', 'N', '0905', 'Y', 3);

-- COMMIT;


- 腳本開始 1--   DatabaseDB2LUOW (SAMPLE) [警告 *** 請不要改變此行] --

-- CONNECT TO SAMPLE USER XXXX using XXXX;

INSERT INTO ASN.IBMQREP_SENDQUEUES
 (pubqmapname, sendq, message_format, msg_content_type, state,
 error_action, heartbeat_interval, max_message_size, description,
 apply_alias, apply_schema, recvq, apply_server, sendraw_iferror)
 VALUES
 ('EMPLOYEE_QMAP', 'SENDQ', 'C', 'T', 'A', 'S', 60, 64, '', 'TARGET',
 'ASN', 'recvq', 'TARGET', 'N');

-- COMMIT;

-- 腳本開始 2--   DatabaseDB2LUOW (TARGET) [警告 *** 請不要改變此行] --

-- CONNECT TO TARGET USER XXXX using XXXX;

INSERT INTO ASN.IBMQREP_RECVQUEUES
 (repqmapname, recvq, sendq, adminq, capture_alias, capture_schema,
 num_apply_agents, memory_limit, state, description, capture_server,
 source_type, maxagents_correlid)
 VALUES
 ('EMPLOYEE_QMAP', 'recvq', 'SENDQ', 'ADMINQ', 'SAMPLE', 'ASN', 16, 2
, 'A', '', 'SAMPLE', 'D', 0);

-- COMMIT;


-- 腳本開始 1--   DatabaseDB2LUOW (SAMPLE) [警告 *** 請不要改變此行] --

-- CONNECT TO SAMPLE USER XXXX using XXXX;

ALTER TABLE XUJM.EMPLOYEE
 DATA CAPTURE CHANGES INCLUDE LONGVAR COLUMNS;

INSERT INTO ASN.IBMQREP_SUBS
 (subname, source_owner, source_name, sendq, subtype,
 all_changed_rows, before_values, changed_cols_only, has_loadphase,
 state, source_node, target_node, options_flag, suppress_deletes,
 target_server, target_alias, target_owner, target_name, target_type,
 apply_schema)
 VALUES
 ('EMPLOYEE0001', 'XUJM', 'EMPLOYEE', 'SENDQ', 'U', 'N', 'N', 'Y',
 'I', 'N', 0, 0, 'NNNN', 'N', 'TARGET', 'TARGET', 'XUJM',
 'TGT_EMPLOYEE', 1, 'ASN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'EMPNO', 1, 'YNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'FIRSTNME', 0, 'NNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'MIDINIT', 0, 'NNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'LASTNAME', 0, 'NNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'WORKDEPT', 0, 'NNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'PHONENO', 0, 'NNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'HIREDATE', 0, 'NNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'JOB', 0, 'NNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'EDLEVEL', 0, 'NNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'SEX', 0, 'NNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'BIRTHDATE', 0, 'NNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'SALARY', 0, 'NNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'BONUS', 0, 'NNNNNNNNNN');

INSERT INTO ASN.IBMQREP_SRC_COLS
 (subname, src_colname, is_key, col_options_flag)
 VALUES
 ('EMPLOYEE0001', 'COMM', 0, 'NNNNNNNNNN');

-- COMMIT;

-- 腳本開始 2--   DatabaseDB2LUOW (TARGET) [警告 *** 請不要改變此行] --

-- CONNECT TO TARGET USER XXXX using XXXX;

CREATE TABLESPACE TSEMPLOYEE MANAGED BY DATABASE USING (FILE
 'EMPLOYEE' 32768 K);

CREATE TABLE XUJM.TGT_EMPLOYEE
(
 EMPNO CHARACTER(6) NOT NULL,
 FIRSTNME VARCHAR(12) NOT NULL,
 MIDINIT CHARACTER(1),
 LASTNAME VARCHAR(15) NOT NULL,
 WORKDEPT CHARACTER(3),
 PHONENO CHARACTER(4),
 HIREDATE DATE,
 JOB CHARACTER(8),
 EDLEVEL SMALLINT NOT NULL,
 SEX CHARACTER(1),
 BIRTHDATE DATE,
 SALARY DECIMAL(9,2),
 BONUS DECIMAL(9,2),
 COMM DECIMAL(9,2)
)
 IN TSEMPLOYEE;

CREATE UNIQUE INDEX XUJM.IXEMPLOYEE ON XUJM.TGT_EMPLOYEE
(
 EMPNO ASC
);

INSERT INTO ASN.IBMQREP_TARGETS
 (subname, recvq, source_owner, source_name, target_owner,
 target_name, modelq, source_server, source_alias, target_type, state,
 subtype, conflict_rule, conflict_action, error_action, source_node,
 target_node, load_type, has_loadphase, source_type)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'XUJM', 'EMPLOYEE', 'XUJM', 'TGT_EMPLOYEE'
, 'IBMQREP.SPILL.MODELQ', 'SAMPLE', 'SAMPLE', 1, 'I', 'U', 'K', 'I',
 'Q', 0, 0, 0, 'I', 'D');

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'EMPNO', 'EMPNO', 'Y', 0, 'R', null, null);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'FIRSTNME', 'FIRSTNME', 'N', 1, 'R', null,
 null);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'MIDINIT', 'MIDINIT', 'N', 2, 'R', null,
 null);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'LASTNAME', 'LASTNAME', 'N', 3, 'R', null,
 null);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'WORKDEPT', 'WORKDEPT', 'N', 4, 'R', null,
 null);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'PHONENO', 'PHONENO', 'N', 5, 'R', null,
 null);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'HIREDATE', 'HIREDATE', 'N', 6, 'R', null,
 null);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'JOB', 'JOB', 'N', 7, 'R', null, null);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'EDLEVEL', 'EDLEVEL', 'N', 8, 'R', null,
 null);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'SEX', 'SEX', 'N', 9, 'R', null, null);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'BIRTHDATE', 'BIRTHDATE', 'N', 10, 'R',
 null, null);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'SALARY', 'SALARY', 'N', 11, 'R', null,
 null);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'BONUS', 'BONUS', 'N', 12, 'R', null, null
);

INSERT INTO ASN.IBMQREP_TRG_COLS
 (subname, recvq, target_colname, source_colname, is_key,
 target_colNo, mapping_type, src_col_map, bef_targ_colname)
 VALUES
 ('EMPLOYEE0001', 'recvq', 'COMM', 'COMM', 'N', 13, 'R', null, null);

-- COMMIT;


C:>strmqm SRC_QM
WebSphere MQ 隊列管理器正在運行。

C:>strmqm TGT_QM
WebSphere MQ 隊列管理器正在運行。

C:>runmqlsr -t tcp -m SRC_QM -p 1451
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.

在 Windows 上,您還可以用 start runmqlsr 為監聽器打開新的命令窗口,這樣您就可以繼續使用當前的命令窗口。在 Linux 和 UNIX 上,在命令的末尾加上空格和( &)符號,也可以達到同樣的效果。

Microsoft Windows XP [版本 5.1.2600]
(C) 版權所有 1985-2001 Microsoft Corp.

C:Documents and Settingsxujm>runmqsc SRC_QM
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
啟動隊列管理器 SRC_QM 的 MQSC。


start channel (SRC_QM.TO.TGT_QM)
     1 : start channel (SRC_QM.TO.TGT_QM)
AMQ8018: 啟動 WebSphere MQ 通道已接受。
end
     2 : end
讀取一個 MQSC 命令。
所有命令均無語法錯誤。
已處理所有的有效 MQSC 命令。

C:Documents and Settingsxujm>runmqlsr -t tcp -m TGT_QM -P 1450
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.

C:Documents and Settingsxujm>runmqsc TGT_QM
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
啟動隊列管理器 TGT_QM 的 MQSC。


start channel (TGT_QM.TO.SRC_QM)
     1 : start channel (TGT_QM.TO.SRC_QM)
AMQ8018: 啟動 WebSphere MQ 通道已接受。
END
     2 : END
讀取一個 MQSC 命令。
所有命令均無語法錯誤。
已處理所有的有效 MQSC 命令。

C:Documents and Settingsxujm>
C:Documents and Settingsxujm>runmqsc TGT_QM
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
啟動隊列管理器 TGT_QM 的 MQSC。


DISPLAY CHSTATUS (TGT_QM.TO.SRC_QM)
     1 : DISPLAY CHSTATUS (TGT_QM.TO.SRC_QM)
AMQ8417: 顯示通道狀態細節。
   CHANNEL(TGT_QM.TO.SRC_QM)               CHLTYPE(SDR)
   CONNAME(172.16.157.128(1451))           CURRENT
   RQMNAME(SRC_QM)                         STATUS(RUNNING)
   SUBSTATE(MQGET)                         XMITQ(SRC_QM)

C:Documents and Settingsxujm>runmqsc TGT_QM
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
啟動隊列管理器 TGT_QM 的 MQSC。


DISPLAY CHSTATUS (TGT_QM.TO.SRC_QM)
     1 : DISPLAY CHSTATUS (TGT_QM.TO.SRC_QM)
AMQ8417: 顯示通道狀態細節。
   CHANNEL(TGT_QM.TO.SRC_QM)               CHLTYPE(SDR)
   CONNAME(172.16.157.128(1451))           CURRENT
   RQMNAME(SRC_QM)                         STATUS(RUNNING)
   SUBSTATE(MQGET)                         XMITQ(SRC_QM)

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved