IIDR Q Replication Migration To 5655-DRQ or To Db2 LUW 11.5 or Above With Replication Architecture Level 1140 Nov 2019
IIDR Q Replication Migration To 5655-DRQ or To Db2 LUW 11.5 or Above With Replication Architecture Level 1140 Nov 2019
Nov 2019
Jayanti Mahapatra
[email protected]
Customization Guide:
https://www.ibm.com/support/knowledgecenter/SSTRGZ_11.4.0/com.ibm.swg.im.repl.zoscust.do
c/topics/iiyrczoscncover.html
ASNQCAP
ASNQAPP
ASNCAP
ASNAPP
ASNMON
ASNTDIFF
ASNQEXP
ASNCATM (new plan)
SQL Replication and ASNMON version 11.4 are exactly the same as version 10.2.1.
If you are upgrading to SQL Replication or ASNMON 11.4 from 10.2.1, you do not
need to run migration scripts.
The SQL Replication and the ASNMON ARCH_LEVEL stay 1021
No new tables or columns
You should run ASNVSQL to find missing tables and columns
Bind with the new 1140 DBRM. The plans and packages are same
Change the steplib to point to the 1140 libraries
Start Capture and Apply
1140 Licensing
• When source capture is new ARCH_LEVEL=1140 and target apply is older ARCH_LEVEL < 1140, then
asnclp CREATE QMAP should populate source IBMQREP_SENDQUEUES control table APPLY_LEVEL
column for the qmap with the value from target apply ARCH_LEVEL (from IBMQREP_APPLYPARMS).
This will be done for both LUW and zOS as source/target scenarios. This fix will come soon.
10 © 2019 IBM Corporation
IBM Hybrid Cloud – Data and AI
• APPLY_LEVEL (IBMQREP_SENDQUEUES)
• Attention: Apply will report an error and will follow ERROR_ACTION, if it
receives a message at a higher version or function level than what is
currently active
• E.g., after a user updated APPLY_LEVEL to an inappropriate value
• CAPTURE_LEVEL (IBMQREP_RECVQUEUES)
• The current functional level (“CURRENT_LEVEL“) of the Q Capture program that this receive
queue works with initial DEFAULT of NULL
• Q Capture 1140 sends a message to Q Apply with its currently active level
(CURRENT_LEVEL)
• each time a send queue is started
• on startup of the Q Capture process
• After receiving the first 1140 “function message” Q Apply changes the value of
CAPTURE_LEVEL from NULL to 1140.LLL, which is the trigger for Q Apply 1140 to send
function messages to Q Capture
• After Q Apply has sent the function message to Q Capture, Q Capture again responds with a
message that communicates the current Q Capture function level
• After receiving that message, Q Apply updates CAPTURE_LEVEL in RECVQUEUES
IIDR z/OS 1140 Capture and Apply are compatible with Db2 LUW 11.1 FPs (ARCH_LEVEL
1021) , 10.5 FP7 or higher (arch_level 1021), 10.5 FP7 or lower( arch_level 1001) and Db2
LUW 11.5 (ARCH_LEVEL 1140 and CURRENT_LEVEL 1140.101)
Support for parallel file transfer has been added for IIASl as level 1140.102, which will be in
11.5 FP1
You can migrate your z and LUW Captures and Applies in any order you want
ASNPATH: Specifies the location where you want the asncatm program to write the output SQL files and its log file.
You can specify either a path name or an MVS™ data set high-level qualifier (HLQ).
Migration can be done using ASNCATM. No need to add ACTIVATE to Q Capture task
Migration can be done using ASNCATM. No need to add ACTIVATE to Q Apply tasks
You can run this program with ACTIVATE=function level and not the latest
if you do not want the new functions. But we recommend LATEST.
You can also specify UPGRADE (QCAP/QAP)
CONTROL_TABLE_LEVEL=function level and not latest if you do not want
to activate the latest function level and do not want to create the new
columns and tables needed for the latest function level
You can specify RUNNOW=Y, if you want ASNCATM to update the control
tables directly or specify RUNNOW=N if you want to check the script and
run manually from the generated script
You can also check the control tables by specifying CHECK QCAP/QAPP
to check the control tables and generate the missing columns or tables
27 © 2019 IBM Corporation
IBM Hybrid Cloud – Data and AI
Migration steps:
You can migrate Capture or Apply in any order you want
Run ASNV1140 after running the migration steps to make sure all tables and
columns are there
Run ASNQBNDL to find the packages and plans
Make sure that your IBMQREP_CAPPARMS COMPATIBILTY stays at 1021 or
1001 and IBMQREP_SENDQUEUES APPLY_LEVEL will be set to 1021 or 1001
when you migrate Q Capture. Apply_level will be updated by 1140 Q Capture if
the z/OS Apply is 1140.0 or higher or LUW Apply 11.5 or higher
Update the steplib to point to 1140 libraries
Start 1140 Q Capture and Q Apply
Replication function level upgrade – next fix / FP after 1140 migration : Sequence:
Install Fixpack
Upgrade the Db2 instance
Upgrade the control tables to the appropriate level
Use the upgrade scripts
./samples/repl/mig1140/q/asnqcapluwv1140fp.sql (Q Capture for Db2 LUW)
./samples/repl/mig1140/q/asnqappluwv1140fp.sql (Q Apply for Db2 LUW)
./samples/repl/mig1140/q/<other>v1140fp.sql (heterogeneous sources/targets)
There is no asncatm utility available on LUW as of Db2 version 11.5 GA
Set CURRENT_LEVEL in CAPPARMS and/or APPLYPARMS to the appropriate level
Start Q Capture and/or Q Apply
• STATUS SHOW DETAILS command (asnqccmd, asnqacmd) provides the current level
Current level (CURRENT_LEVEL) = 1140.101
Control tables level (CONTROL_TABLES_LEVEL) = 1140.101
Possible level (POSSIBLE_LEVEL) = 1140.101
• Capture parameter COMPATIBILITY tells capture what is lowest level of Apply programs
this Capture is feeding (users have to update it)
Used for independently migrating Capture and Apply programs
But, ONLY ONE parameter for all targets: Need to upgrade ALL apply
programs before enabling the new function
1140 OBJECTIVE:
Allowing clients have compatibility at queue level.
Q Capture can send different message version by SENDQ level
If Q Capture has multiple sendqueues feeding multiple Applies, Q Capture
will send 1140 version message to the 1140 Apply and send lower version
messages to the down-level apply
Apply can understand any lower version message from a down-level
capture
Allowing clients to upgrade and test new function one replication queue at a
time
E.g., Capture can have one target queue at level 1021 and another target
queue at level 1140.0
45 © 2019 IBM Corporation
IBM Hybrid Cloud – Data and AI
The column is updated by the Capture upon receiving the function level message from Apply.
Apply sends a message to Capture with its currently active level when a new function level is activated;
and each time the queue is started, and on startup. Upon receiving the function level message from
Apply, Capture updates this column and starts sending messages in the new format thereafter, as long
as function is also active on the Capture side.
IBMQREP_RECVQUEUES
CAPTURE_LEVEL – The column is updated by Q Apply by receiving the information by Capture for
this queue.
This is not modified when installing new code or activating Capture function.
Capture sends a message to Apply with its currently active level when the level is activated; each
time the queue or Capture is started. The message is sent only if APPLY_LEVEL is 1140 or later.
Upon receiving this message Apply updates the CAPTURE_LEVEL in the recvqueues.
USERS are not expected to update this column, they must rely on Apply receiving the message on
the receive queue
This DB2 option allows customers to offload the Q Capture cost to the PPRC target and reduce
CPU consumption on the production server. The new ASNCLP option REMOTE SOURCE
SERVER can be used to set up the configuration. Q Capture reads the logs of the remote server
but does not directly connect to it. Q Capture occasionally queries the system catalog, but only by
DRDA through the CAPTURE SERVER.
More information:
https://www.ibm.com/support/knowledgecenter/SSTRGZ_11.4.0/com.ibm.swg.im.iis.repl.qrepl.doc
/topics/iiyrqcapzdlsolution.html
- DB2 V12 will provide the before and after value of the log records
in the current version. Before images will be returned in the version
written at the point in time the log record is written to the log.
Reorg Reorg
Situation needed needed
Pre V12 V12
Column was altered when table was not being replicated Yes No
Column was altered when the table was being replicated (Q
Capture or Capture maintains schema history information in the No No
version tables)
Q subscription or registration was stopped and started without any
ALTER ADD COLUMN to the table while stopped (Q Capture or No No
Capture has current schema history information in the version
tables)
When capturing changes from the log, Q Capture checks the partition number in the log
records to determine to which Q subscription the change belongs to and replicates it.
Q Replication handles changes that move rows between partitions and that might be
replicated by different Q subscriptions.
Replicating by table partitions gives you a higher degree of parallelism for workloads in
which multiple threads concurrently update different parts of a range-partitioned table.
For example, you can define multiple Q subscriptions for the same table and have all of
them replicate to the same partitioned target table.
- 10,"IBM","2007327","154145873640","MAKIV95","DEL1","ISRT","0000:0000:0000:0000:47ba","0000:0000:0000:07
d5:6a41",”2007-11-23-06.41.43",,0000,,,,1,"AAA ","2007-11-23-15.41.43. “
- 10,"IBM","2007327","154145873640","MAKIV95","DEL1","ISRT","0000:0000:0000:0000:47ba","0000:0000:0000:07
d5:6a41",”2007-11-23-06.41.43",,0000,,,,1,"AAA ","2007-11-23-15.41.43.340292“
Similarly if customer is running with codepage 500 and they specify the same code
page for message_codepage (500) , Capture still converts the data to codepage
1208 first and converts it back to 500 (double conversion)
With this fix if the Db2 codepage and message code pages are the same for
codepage 37 or 500, Q Capture will not do the codepage conversion (CPU savings)
Issue:
Q replication only allows to add a column to the replication key via
ADD_REPL_KEY_COL signal
If user wants to drop a column from the replication key or reorder or change the
replication key, the user might have to drop and recreate the sub
Solution:
Q Replication will provide a new signal that allows users to dynamically add, drop, and
reorder the columns that make up the replication key.
**The added columns must be eligible to be part of the replication key; they can not be
large object (LOB) or XML columns and the columns must exist in the source and target
table and must already be part of the Q Subscription.
Q Capture will set the IS_KEY to a sequence number starting with 1 for each source table
column that is in the SIGNAL_INPUT_IN.
Q Capture will set the first character of the COL_OPTIONS_FLAG to ‘Y’ for each source
table column that is in the SIGNAL_INPUT_IN.
Q Capture will put a REDEFINE REPL KEY message to the send queue , reinitialize the Q
Subscription, and put a schema message to the send queue .
The Q Apply program will read the REDEFINE REPL KEY message from the receive queue
and update the IBMQREP_TRG_COLS IS_KEY column to redefine the replication key.
Q Apply will set the IS_KEY to ‘N’ for each existing replication key column that is
not in the REDEFINE REPL KEY message.
Q Apply will set the IS_KEY to ‘Y’ for each replication key column that is in the
REDEFINE REPL KEY message.
Q Apply will put a REDEFINE_REPL_KEY signal to the receiving Q Capture
receive queue if the Q Subscription is bidirectional .
Q Apply will also update IBMQREP_TRG_COLS SRC_COL_MAP to reflect the
key
*(column_type, column_length,column_codepage_in_schema_message,
columncolumn_position_in_schema_message, column_is_key)
2019-12-04-18.58.29.196290 ASN7898W "Q Apply" : "QRILOAD" : "BR00001" : A transaction exceeded the apply
latency threshold that was set with the Q Apply parameter WARNTXLATENCY. Transaction ID:
"0000:0000:0007:7bd3:7a58:0000". Apply latency: "427" milliseconds. D BMS_TIME: "275" milliseconds.
DEPENDENCY_DELAY: "0" milliseconds. WORKQ_WAIT_TIME: "152" milliseconds. RETRY_TIME: "0" milliseconds.
2019-12-04-19.03.35.087163 ASN7882W "Q Apply" : "QRILOAD" : "BR00001" : Worst apply latency during the
interval that was set by the WARNTXRESET parameter was "427" ms for transaction
"0000:0000:0007:7bd3:7a58:0000" with plan name "DSNTEP3 " and authorization id “ OEUSR01 ". WARNTXRESET:
"300000" milliseconds.
If you anticipate multiple latency warnings, you can set the warntxevts parameter to specify the maximum
number of latency warnings during a reset interval. The default limit is 10.
Setting warntxreset can make it easier to manage warnings by specifying a reset interval. At the end of
each interval, Q Apply issues summary messages ASN7881W and ASN7882W and resets its latency
counters if any transactions exceeded the latency threshold. Summary message ASN7881W tells you how
many completed transactions and in-flight transactions exceeded the threshold, and ASN7882W also
identifies the transaction with the highest latency during the reset interval.
To change the value of any of these parameters while Q Apply is running, you can use the chgparms
78 © 2019 IBM Corporation