version 8.0.2 installation and users guide - qmirror · qmirror system database server as400 db2...
TRANSCRIPT
Version 8.0.2
Installation and Users Guide
A Real Time Data Replicator
between IBM AS400s DB2
and Oracle, MS SQL Server, MySQL,
DB2, Sybase, PostgreSQL, MaxDB
Ninth Edition (July 2016) This edition applies to the licensed program QMirror version 8.0.2, and to all subsequent releases until otherwise indicated in new editions. Make sure you are using the proper edition for the level of the product. © Copyright Middleware Technologies Limited 2005. All rights reserved.
End-User License Agreement (EULA) for MTL Software SOFTWARE PRODUCT: QMirror - real time data replication between AS400s DB2 and PC databases LICENSES: Shareware IMPORTANT - READ CAREFULLY This MTL EULA is a legal agreement between you (either an individual or a single entity) and MTL for the MTL SOFTWARE PRODUCT identified above. By installing, copying, or otherwise using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, you are not authorized to install and/or use the SOFTWARE PRODUCT. SOFTWARE PRODUCT LICENSE The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold. 1. GRANT OF LICENSE This EULA grants you the following rights with respect to the SOFTWARE PRODUCT: MTL grants you an individual, personal, nonexclusive license to make and use copies of the SOFTWARE PRODUCT for the sole purpose of using it. You may install copies of the SOFTWARE PRODUCT on an unlimited number of computers provided that you are the only individual using the SOFTWARE PRODUCT. If you are an entity, MTL grants you the right to designate one individual within your organization to have the right to use the SOFTWARE PRODUCT in the manner provided above. 2. UPGRADES/UPDATES If the SOFTWARE PRODUCT is an upgrade from another product, whether from MTL or another supplier, you may use or transfer the SOFTWARE PRODUCT only in conjunction with that upgraded product, unless you destroy the upgraded product. If the SOFTWARE PRODUCT is a MTL product, you now may use that upgraded product only in accordance with this EULA. If the SOFTWARE PRODUCT is an upgrade of a component of a package of software programs which you licensed as a single product, the SOFTWARE PRODUCT may be used and transferred only as part of that single product package and may not be separated for use on more than one computer. 3. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS - Limitations on Reverse Engineering, De-compilation, and Disassembly. You may not reverse engineer, decompile, or disassemble the object code portions of the SOFTWARE PRODUCT, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. - Software Transfer. You may permanently transfer all of your rights (not a part of them) under this EULA, provided the recipient agrees to the terms of this EULA. - Termination. Without prejudice to any other rights, MTL may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the SOFTWARE PRODUCT and all of its component parts. 4. COPYRIGHT All title and copyrights in and to the SOFTWARE PRODUCT (including but not limited to any images, photographs, animations, video, audio, music, and text incorporated into the SOFTWARE PRODUCT), the accompanying printed materials, and any copies of the SOFTWARE PRODUCT are owned by MTL or its suppliers. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE PRODUCT like any other copyrighted material. 5. NO WARRANTIES MTL expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or no infringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you. 6. NO LIABILITY FOR DAMAGES In no event shall MTL or its suppliers be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this MTL product, even if MTL has been advised of the possibility of such damages. MISCELLANEOUS 1. If you acquired this product in United States, this EULA is governed by the laws of the United States. If this product was acquired outside United States, then local laws may apply. 2. MTL does not allow you to utilize our SOFTWARE PRODUCT to do anything that violates the local law. If you utilize our SOFTWARE PRODUCT to do the illegal activity, the consequent result shall be on your own responsibility. If you disagree with this item, please don't install and/or use the SOFTWARE PRODUCT. 3. Should you have any questions concerning this EULA, or if you desire to contact MTL for any reason, please write to [email protected]. Acronyms used in this Document: MTL: Middleware Technologies Limited. SOFTWARE PRODUCT: Computer Software and all associated media (computer diskettes, printing materials and "on-line" or electronic documentation) EULA: End-User License Agreement © Copyright Middleware Technologies Limited 2005. All rights reserved.
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 i
Contents
(000) QMirror system structure .................................................................................1
(010) How to implement QMirror? ............................................................................2
(020) Quick start ..........................................................................................................3
Part I: Configure PC Database
(100) Do you have PC database installed?.................................................................4
(110) Download and install PC database ...................................................................5
(120) Check PostgreSQL setting .................................................................................6
(130) Check existing databases ...................................................................................7
Part II: Configure AS400
(300) Create an AS400 user profile for QMirror ......................................................8
(310) Check AS400 configuration ...............................................................................9
Part III: Configure QMirror
(400) Install QMirror.................................................................................................10
(430) Configure QMirror ..........................................................................................12
(440) Buildup table list from AS400 physical files ..................................................13
(450) Buildup indexes from AS400 logical files .......................................................14
(460) Start / End AS400 journaling by QMirror.....................................................15
(490) Uninstall QMirror ............................................................................................16
Part IV: QMirror Operation
(500) Normal running QMirror................................................................................17
(510) Get QMirror running log and status ..............................................................18
(520) Get QMirror status log ....................................................................................20
(530) Re-download specified AS400 table manually ...............................................21
(540) End QMirror.....................................................................................................22
(550) Add more AS400 physical files into QMirror table list.................................23
(560) Remove tables from QMirror table list ..........................................................24
(570) Data verification between AS400 DB2 and target database.........................25
(590) Learn QMirror table status.............................................................................26
Part V: Trouble Shooting
(600) Tracking mode ..................................................................................................27
(610) Test environment ..............................................................................................28
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 ii
Part VI: Advanced Setting
(710) Grant target database privileges to users ......................................................29
(720) Create extra indexes on target database ........................................................30
(730) Define extended fields on target database......................................................31
(740) Define hidden fields on target database .........................................................32
(750) Multiple AS400s / PC database servers configurations ................................33
(760) Prepare batch programs to execute QMirror................................................34
(770) Install QMirror as Windows service...............................................................35
(780) Selected download ............................................................................................36
(790) Upload data from PC database to AS400 DB2 ..............................................37
(800) Define mapped table on PC database.............................................................38
(810) Dashboards and visualization .........................................................................39
Appendix A: System Table Structures
(A10) AS400 table master (ZAMTBF) .....................................................................40
(A15) Mapped table master (ZAMTBM).................................................................41
(A20) User privileges master (ZDBUSR) .................................................................42
(A30) Extended fields master (ZEXFLD) ................................................................43
(A40) Hidden fields master (ZHDFLD) ...................................................................44
(A50) Job log file (ZJBLOG) / Job status file (ZJBSTS)........................................45
(A60) Journal master (ZJMASF) .............................................................................46
(A65) Journal count log (ZJMLOG)........................................................................47
(A70) System log file (ZPCLOG / ZPCLOG2)........................................................48
(A80) System control file (ZSERVR)........................................................................49
(A90) SQL statement master (ZTBSQL) .................................................................50
(A100) Upload controller (ZUPCTL).......................................................................51
(A110) Upload transaction detail (ZUPDTL) ..........................................................52
(A120) Upload fields master (ZUPFLD) ..................................................................53
(A130) Mapped field master (ZWHFLM) ...............................................................54
(A140) XML export detail (ZXMLDL) ....................................................................55
(A150) XML export header (ZXMLHD) .................................................................56
(A160) XML export controller (ZXMLIP) ..............................................................57
Appendix B: System Messages
(B10) Error messages.................................................................................................58
(B20) Warning messages............................................................................................59
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 1
(000) QMirror system structure
EAST QMDR (Disaster Recovery)
EAST_QMIRROR QMDR_QMIRROR
QMirrorfor ROOT
QMirror System Database Server
AS400 DB2Physical / Logical Files
TargetDatabase Server
Configuration ID:
Login information:- Database type- Instance name- IP address- Port number- Administrator ID- Administrator password
Login information:- IP address *- User ID *- User password
Login information:- Database type *- Instance name *- IP address *- Port number *- Administrator ID *- Administrator password
AS400 LibrariesAll Objects
QMirrorfor EAST
QMirror/DR for Disaster Recovery
(ROOT_) QMIRROR
ROOT
QMirrorsystemdatabase:
TargetAS400 Server
Login information:- IP address *- User password
Login information:- IP address *- User ID *- User password
AS400 DB2Physical / Logical Files
TargetDatabase Server
QMirror is designed to replicate from multiple AS400 servers to multiple PC
databases / AS400 servers:
- QMirror instances could be executed on a single PC or separately.
- AS400 servers might be same one or separately.
- Target database servers could be same one as QMirror system database server or
separately.
(Notes: All data with ‘*’ will be saved in system configuration file.)
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 2
(010) How to implement QMirror?
There has three parts to implement QMirror:
Part 1: Configure PC database
Part 2: Configure AS400
Part 3: Configure QMirror
It only takes you few minutes to complete.
Go to (020) Quick start
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 3
(020) Quick start
The steps to quick start QMirror:
Install QMirror –
1. Install PC database
2. Create an AS400 user profile for QMirror
3. Install QMirror
4. Configure QMirror
5. Performance check (command option P)
6. Buildup table list from AS400 physical files (command option 4)
7. Buildup indexes from AS400 logical files (command option 5)
8. Start AS400 journaling (command option 8)
Execute QMirror –
1. Start a new instance (command option 1)
2. Log monitoring (command option L)
3. Status monitoring (command option S)
Add more AS400 physical files into QMirror table list –
1. End current instance (command option 2)
2. Add more AS400 physical files into QMirror table list
3. Start AS400 journaling (command option 8)
4. Start a new instance (command option 1)
5. Log monitoring (command option L)
6. Status monitoring (command option S)
Go to (100) Do you have PC database installed?
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 4
(100) Do you have PC database installed?
1. No. I do not have any PC database installed.
Go to (110) Download and install PC database
2. Yes. I have Oracle database installed.
Go to (130) Check existing databases
3. Yes. I have MS SQL Server installed.
Go to (130) Check existing databases
4. Yes. I have MaxDB database installed.
Go to (130) Check existing databases
5. Yes. I have MySQL database installed.
Go to (130) Check existing databases
6. Yes. I have DB2 database installed.
Go to (130) Check existing databases
7. Yes. I have Sybase database installed.
Go to (130) Check existing databases
8. Yes. I have PostgreSQL database installed.
Go to (120) Check PostgreSQL setting
9. Yes. I have other PC database installed.
Tell us which PC database you are using. We shall do our best to fulfill your
requirement. Please send your mail to [email protected]
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 5
(110) Download and install PC database
PostgreSQL or MySQL database are recommended to use. You can download from its
Web site and install it into your PC server.
Go to (100) Do you have PC database installed?
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 6
(120) Check PostgreSQL setting
If you are not using pure ASCII characters, please set PostgreSQL encoding as UTF8
during installation.
You have to have a super user named ‘postgres’ and a database named ‘postgres’ on
PostgreSQL server.
Go to (130) Check existing databases
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 7
(130) Check existing databases
QMirror will use following databases to your existing PC database instance:
1. System database – QMIRROR
There should be no database named ‘QMIRROR’ before install QMirror.
2. User databases - named as AS400 library
QMirror assigns table name as AS400 physical file name in these databases.
Go to (300) Create an AS400 user profile for QMirror
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 8
(300) Create an AS400 user profile for QMirror
1. To create an AS400 user profile ‘QMIRROR’, enter command:
CRTUSRPRF USRPRF(QMIRROR) PASSWORD(xxxxxxxx) USRCLS(*USER) SPCAUT(*ALLOBJ *JOBCTL) PWDEXPITV(*NOMAX)
2. Or use any existing user profile which owns SPCAUT(*ALLOBJ *JOBCTL) authority.
3. The user profile has to have authority to execute following commands:
ADDRPYLE, CHGJOB, CHGJRN, CPYF, CRTDTAATA, CRTJRN, CRTJRNRCV,
CRTLIB (Notes), CRTMSGQ, DLTDTAARA, DLTF, DLTJRNRCV, ENDJRNPF, SNDJRNE,
STRJRNPF
4. If you are using non-ASCII character set, the AS400 user profile CCSID for
QMirror should not be 65535.
5. If QMirror is running, you have to reboot QMirror after you changed password of
AS400 user profile for QMirror.
(Notes: QMirror uses a default working library named ‘QMIRROR’ on AS400 server. If the user profile you used does not have authority to execute command CRTLIB, please create library ‘QMIRROR’ before start QMirror.)
Go to (310) Check AS400 configuration
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 9
(310) Check AS400 configuration
Normally, QMirror should be running well under common AS400 configuration. And
QMirror may download about 100 records per second per download thread generally.
If you got a slow download performance, then AS400 configuration checking or
tuning maybe needed.
Please refer following paragraphs and check with your AS400 configuration. Watch
the QMirror performance status and tune accordingly.
1. Use command STRTCPSVR to start FTP server and DDM server.
2. Manage access using FTP exit programs.
You can provide additional security by adding FTP exit programs to further restrict
FTP access to your AS400. Please refer http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/rzaiq/rzaiqftpscon.htm
3. Use command DSPUSRPRF QUSER to verify user’s status is *ENABLED.
4. Use command STRHOSTSVR *ALL to start the optimized host server daemons.
5. Amend QZDASOINIT/QUSER PJ jobs back to normal priority.
a) QZDASOINIT run priority based on QSYS/QPWFSERVER *CLS
b) Default value = 20
c) Use command CHGCLS CLS(QPWFSERVER) RUNPTY(20)
d) Restart QSERVER subsystem
6. Use command
CHGPJE SBSD(QSYSWRK) PGM(QSQSRVR) MAXJOBS(*NOMAX)
to set SQL maximum number of jobs to *NOMAX. You might refer http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.iseries.doc/info/iseries/ae/tins_is_cfgsql.html
Notes: For OS400 V3, use command
CHGPJE SBSD(QSYSWRK) PGM(QIWS/QZRCSRVS) MAXJOBS(*NOMAX)
7. Tune AS400 server for Java SQL Database access. Please refer
http://archive.midrange.com/java400-l/200210/msg00036.html
8. QMirror needs these ports for the connection to AS400 - 23, 446, 449, 8470, 8471,
8472, 8473, 8474, 8475, 8476.
Go to (400) Install QMirror
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 10
(400) Install QMirror
Due to QMirror uses tiny system resources, we recommend you to install it into the
PC database server machine.
1. Download
Qmirror802_1607_V5.zip for OS400 V5 server and above
qmirror680_0905_V3V4.zip for OS400 V3/V4 server
2. Uninstall QMirror earlier version from Windows program menu list
3. Unzip, execute program, and follow the instructions
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 11
4. A program menu ‘QMirror’ will be created on Windows
5. It is no need to drop any table in existing PC databases of earlier version
6. Execute QMirror from program menu list
7. Or execute QMirror on a DOS prompt
Ex. c:\QMirror\qmirror.bat
Check QMirror installed directory properties is necessary for some editions of
Windows. Make sure all users own full control permissions of QMirror directory on
security folder.
Go to (430) Configure QMirror
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 12
(430) Configure QMirror
1. Accept the terms of the license agreement
2. Select system database for multiple configurations
3. AS400 IP Address
4. AS400 User ID
5. AS400 Working Library
6. Select Target Database Server
7. Target Database Instance Name
8. Target Database IP Address
9. Target Database Connection Port
10. Target Database Administrator ID
11. Target Database Prefix
12. Enter QMirror License Key or leave it blank as non-license trial
13. Select Character Set
14. Set Default CCSID if the Character Set is DBCS/Unicode
15. Message handling
16. Configuration Description
Go to (440) Buildup table list from AS400 physical files
Target Database Server: 1 - MaxDB 2 - Oracle 3 - MS SQL Server 4 - MySQL 5 - PostgreSQL 6 – Sybase 7 – DB2 9 – AS400 Disaster Recovery Your option is (1/2/3/4/5/6/7/9/q)
EMail Messages: (N-None E-Error only W-Error and Warning) e Email Message is Error only (y/N/q) y Email SMTP Host: (Ex. qmirror.com) qmirror.com Email SMTP Host is qmirror.com (y/N/q) y Email Address: (Ex. [email protected];[email protected]) [email protected] Email Address is [email protected] (y/N/q) y Try to send a test mail to [email protected] ... The test mail was sent successfully.
Character Set: (1-ASCII 2-DBCS/Unicode)
Do you accept the terms of the license agreement? (y/N/q) y
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 13
(440) Buildup table list from AS400 physical files
To buildup table list from AS400 physical files, you need to enter AS400 library
name and physical file name.
The table list will be kept into system table QMIRROR.ZAMTBF. Please refer
(A10) AS400 table master (ZAMTBF) for detail.
If you want to rearrange download sequence, turn the field TBPRTY in system table
QMIRROR.ZAMTBF.
Go to (450) Buildup indexes from AS400 logical files
Buildup table list from AS400 physical files - Enter AS400 library name: libr1 Enter AS400 physical file name (*ALL/generic name/name): *all Ignore empty files? (Y/n) y Buildup table list from AS400 physical files LIBR1/*ALL (y/N/q) y 20xx/xx/xx 11:39:51 Buildup table list from AS400 physical files LIBR1/*ALL 20xx/xx/xx 11:39:51 This may take minutes ... 20xx/xx/xx 11:40:08 Adding: LIBR1/FCOA(FCOA) - Chart of Account 20xx/xx/xx 11:40:08 Adding: LIBR1/FJVTX(FJVTX) - Journal voucher 20xx/xx/xx 11:40:08 Adding: LIBR1/FPCTL(FPCTL) - Period controlling 20xx/xx/xx 11:40:08 Adding: LIBR1/FPLF(FPLF) - Posting log file 20xx/xx/xx 11:40:08 Adding: LIBR1/FBALSH(FBALSH) - Balance sheets 20xx/xx/xx 11:40:08 Adding: LIBR1/FINCST(FINCST) - Income statements 20xx/xx/xx 11:40:09 End of buildup table list from AS400. Buildup table list from AS400 physical files - Enter AS400 library name: (LIBR1/q) libr2 Enter AS400 physical file name (*ALL/generic name/name): fap* Ignore empty files? (Y/n) y Buildup table list from AS400 physical files LIBR2/FAP* (y/N/q) y 20xx/xx/xx 11:40:21 Buildup table list from AS400 physical files LIBR2/FAP* 20xx/xx/xx 11:40:21 This may take minutes ... 20xx/xx/xx 11:40:33 Adding: LIBR2/FAPCTL(FAPCTL) - A/P controlling 20xx/xx/xx 11:40:33 Adding: LIBR2/FAPTX(FAPTX) - A/P transactions 20xx/xx/xx 11:40:34 End of buildup table list from AS400. Buildup table list from AS400 physical files - Enter AS400 library name: (LIBR2/q) q
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 14
(450) Buildup indexes from AS400 logical files
To buildup indexes from AS400 logical files, just enter AS400 library name. QMirror
will retrieve all related logical files in the library to buildup indexes for tables on
target database.
QMirror will insert records into system table QMIRROR.ZTBSQL to build up
indexes by pulling index keys off of the AS400 logical files when you use command
option 5 to buildup indexes from AS400 logical files. Only the tables in the table list
will be affected.
Go to (460) Start / End AS400 journaling by QMirror
Buildup indexes from AS400 logical files - Enter AS400 library name: (LIBR1/q) libr1 Buildup indexes from AS400 logical files in library LIBR1 (y/N/q) y 20xx/xx/xx 11:41:05 Buildup indexes from AS400 logical files in library LIBR1 20xx/xx/xx 11:41:05 This may take minutes ... 20xx/xx/xx 11:41:14 LIBR1.FCOA; CREATE INDEX LF_FCOA1 ON LIBR1.FCOA1 (FC01) 20xx/xx/xx 11:41:14 LIBR1.FCOA; CREATE INDEX LF_FCOA1 ON LIBR1.FCOA2 (FC12) 20xx/xx/xx 11:41:14 LIBR1.FPCTL; CREATE INDEX LF_FPCTL1 ON LIBR1.FPCTL (FPYM) 20xx/xx/xx 11:41:14 End of buildup indexes from AS400 logical files. Buildup indexes from AS400 logical files - Enter AS400 library name: (LIBR1/q) q
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 15
(460) Start / End AS400 journaling by QMirror
You can let QMirror setup AS400 journaling for you. When you run QMirror
command option 8 – ‘Start / End AS400 journaling’, QMirror will keep message
queue (MSGQ), journal receivers (JRNRCV) and journal (JRN) into library
‘QMIRROR’.
The size of each journal receiver created by QMirror is 200MB. QMirror will keep
last two journal receivers and delete earlier ones at 7 o’clock every morning. If you’d
like to maintain journal receivers by yourself, please set field ZMJRCV to -1 in
system table QMIRROR.ZJMASF.
The easiest way is why just let QMirror to handle AS400 journaling for you. But you
still might buildup AS400 journaling by your own. QMirror will use the journal if it
exists. But you should keep these journal receivers at least one day before you delete
it.
(Notes: For OS400 V5 and above, check journal caching for all your own journals with AS400 command WRKJRNA. Set field ZJRCHE in system table QMIRROR.ZSERVR to ‘N’ if all the journals cache status are *NO. This may increase replication performance.)
To ignore some specified tables from journal QMIRROR/JRN, set field TBREPL to
‘N’ in system table QMIRROR.ZAMTBF.
With caution, never start journaling for any object in working library QMIRROR.
Go to (490) Uninstall QMirror
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 16
(490) Uninstall QMirror
First, run QMirror command option 8 – ‘Start / End AS400 journaling’ to end AS400
journaling which was started by QMirror.
Second, delete AS400 library ‘QMIRROR’ which was created by QMirror.
Third, clean QMirror system database and library database on the PC database server.
The last one, uninstall QMirror from Windows program menu list.
Go to (500) Normal running QMirror
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 17
(500) Normal running QMirror
To execute a QMirror instance on a new shell, choose command option 1 - ‘Start a
new instance’.
Now QMirror is starting to download and replicate AS400 DB2 into target database.
The table naming on target database is <library.file_member>. If member name is
same as file name, then the target database table name will be <library.file>.
Go to (510) Get QMirror running log and status
QMirror x.x.x (released at 20xx/xx) command list (ROOT): 1 - Start a new instance ROOT 3 - Re-configuration 4 - Buildup table list from AS400 physical files 5 - Buildup indexes from AS400 logical files 6 - Re-grant user privileges 7 - Re-download all tables 8 - Start / End AS400 journaling V - Table status verification P – Performance check Q - Quit Your option is (1/3/4/5/6/7/8/V/P/Q) 1
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 18
(510) Get QMirror running log and status
QMirror current status is kept in system table QMIRROR.ZJBSTS. Please refer
(A50) Job log file (ZJBLOG) / Job status file (ZJBSTS) for table structure and field
comments.
The administrator may monitor QMirror running log and status at any place on any
PC as following.
By Web browser:
While you are running ‘Status Monitoring’, you can also use a Web browser to
monitor QMirror status by dashboards at the same time. Execute ‘qmirror.html’ in
Windows program menu list; you will get a similar display as below.
Per Adobe Flash request, you have to add qmirror.html access path, ex.
C:\QMIRROR\, into the ‘Trust List’ through 'Adobe Flash Global Security Setting
Panel'. Otherwise, a popup dialog box ‘Error #2148’ would be shown. Just click the
button on ‘XML Information’ dialogue box to set it up.
By QMirror command:
1. To monitor QMirror running log and status, the operators have to have SELECT
privilege on these tables, QMIRROR.ZSERVR, xxxx_QMIRROR.ZAMTBF,
xxxx_QMIRROR.JBSTS and xxxx_QMIRROR.ZPCLOG2, which ‘xxxx_’ is
configuration ID for Multiple AS400s / PC databases structure.
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 19
2. Execute QMirror on a new shell. Choose command option L - ‘Log Monitoring’.
3. Execute QMirror on a new shell. Choose command option S - ‘Status
Monitoring’.
4. The monitoring displays will be refreshed every ten seconds. For security
consideration, the only way to stop monitoring display is using Ctrl-C.
By database SQL query:
1. Open PC database SQL studio
2. Login as database administrator
3. Execute SQL statement Ex. SELECT ZJTYPE,ZJJBID,ZJRPTM,ZJACTN,ZJLIB,
ZJOBJ,ZJTIME,ZJRCDS,ZJRMRK FROM QMIRROR.ZJBSTS ORDER BY ZJTYPE,ZJJBID
4. Action description: CUTOFF - Cutoff date / time of data replication, memory used CURRENT DELAY - Current delay by seconds, time period AVERAGE DELAY - Average delay by seconds, time period MINIMUM DELAY - Minimum delay by seconds, time point MAXIMUM DELAY - Maximum delay by seconds, time point
Go to (520) Get QMirror status log
--- QMirror x.x.x --- ROOT Finance Applications ----------- CUTOFF TIME 20xx/xx/xx 15:19:06 (Memory used: 34928KB) CURRENT DELAY 15 seconds (41 records mirrored) DOWNLOAD QUEUE 2 tables LIBR3 / FILE108 1250 rcds ( 450 Kbps 0:00:03 remaining) LIBR3 / FILE109 800 rcds ( 620 Kbps 0:00:02 remaining)
20xx/xx/xx 15:17:12 Download started - LIBR3/FILE106/FILE106 20xx/xx/xx 15:17:19 Delay 10 secs. Mirror from 151702 to 151709 (28 rcds) 20xx/xx/xx 15:17:32 Delay 16 secs. Mirror from 151709 to 151716 (12 rcds) 20xx/xx/xx 15:17:41 Delay 15 secs. Mirror from 151716 to 151726 (32 rcds) 20xx/xx/xx 15:17:49 Download started - LIBR3/FILE107/FILE107 20xx/xx/xx 15:18:07 Download ended - LIBR3/FILE106/FILE106 947 rcds. 20xx/xx/xx 15:18:26 Download started - LIBR3/FILE108/FILE108 20xx/xx/xx 15:18:37 Download started - LIBR3/FILE109/FILE109 20xx/xx/xx 15:18:41 Download ended - LIBR3/FILE107/FILE107 1253 rcds. 20xx/xx/xx 15:19:02 Delay 15 secs. Mirror from 151839 to 151847 (41 rcds) 20xx/xx/xx 15:19:17 Run SQL (I): CREATE INDEX PF_FILE108 ON LIBR3.FILE108 (FA15) 20xx/xx/xx 15:19:20 Download ended - LIBR3/FILE108/FILE108 1478 rcds. 20xx/xx/xx 15:19:22 Delay 15 secs. Mirror from 151902 to 151908 (22 rcds) 20xx/xx/xx 15:19:27 Download ended - LIBR3/FILE109/FILE109 892 rcds.
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 20
(520) Get QMirror status log
There have four kinds of status logs kept in system table QMIRROR.ZJBLOG. Please
refer (A50) Job log file (ZJBLOG) / Job status file (ZJBSTS) for table structure and
field comments.
1. Delay status log
2. Download status log
3. SQL status log
4. Recovery status log
When you do configuration, you can choose to keep or ignore these logs. Through
QMIRROR.ZJBLOG, you can do tracking or something else that you want to do.
For example, use following SQL to get mirror status per day: SELECT ZJRPDT AS AS400_DATE, SUM(ZJRCDS) AS TOTAL_RCDS, MAX(ZJTIME) AS MAX_DELAY, AVG(ZJTIME) AS AVG_DELAY, COUNT(*) AS CYCLES, AVG(ZJRCDS) AS AVG_RCDS FROM QMIRROR.ZJBLOG WHERE ZJTYPE=' ' AND ZJRCDS>0 AND ZJBSTS=' ' GROUP BY ZJRPDT
QMirror purges its own log tables at the end of each month. Entries in log tables,
QMIRROR.ZPCLOG, QMIRROR.ZJBLOG, and QMIRROR.ZJMLOG, earlier than
the first date of last month will be purged.
Go to (530) Re-download specified AS400 table manually
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 21
(530) Re-download specified AS400 table manually
If you want to re-download a specified AS400 table manually, you can change
download flag TBDWFG to ‘A’ in system table QMIRROR.ZAMTBF for full table
download. Or change TBDWFG to ‘Y’ for ‘Selected Download’. Please refer to (780)
Selected download on needed.
1. Download immediately Ex. UPDATE QMIRROR.ZAMTBF
SET TBDWFG='A',TBNDDT=0,TBNDTM=0,TBSTS=' ' WHERE TBLIB='LIBR1' AND TBOBJ='FILEA' AND TBMBR='FILEA'
2. Download at specified date Notice: QMirror will stop mirroring these tables till it downloaded. Ex. UPDATE QMIRROR.ZAMTBF
SET TBDWFG='A',TBNDDT=20101231,TBNDTM=135959 WHERE TBLIB='LIBR1' AND TBOBJ='FILEB' AND TBMBR='FILEB'
3. Download scheduling
Use scheduling code TBDSCH and next download time TBNDTM to setup
download scheduling. QMirror will do a ‘Selected Download’ if it was specified.
Reboot QMirror instance is needed after you changed download schedule.
Daily – Set TBDSCH to 9999 Ex. UPDATE QMIRROR.ZAMTBF SET TBREPL=’N',TBDSCH=9999,TBNDTM=001000
WHERE TBLIB='LIBR1' AND TBOBJ='FILEC' AND TBMBR='FILEC'
Weekly – Set TBDSCH from 9990 to 9996, 9990 means Sunday Ex. UPDATE QMIRROR.ZAMTBF SET TBREPL=’N',TBDSCH=9990,TBNDTM=001000
WHERE TBLIB='LIBR1' AND TBOBJ='FILED' AND TBMBR='FILED'
Monthly – Set TBDSCH from 9901 to 9931, 9901 means 1st of month Ex. UPDATE QMIRROR.ZAMTBF SET TBREPL=’N',TBDSCH=9901,TBNDTM=001000
WHERE TBLIB='LIBR1' AND TBOBJ='FILEE' AND TBMBR='FILEE'
Yearly – Set TBDSCH from 0101 to 1231, 0101 means January 1st Ex. UPDATE QMIRROR.ZAMTBF SET TBREPL=’N',TBDSCH=0101,TBNDTM=001000
WHERE TBLIB='LIBR1' AND TBOBJ='FILEF' AND TBMBR='FILEF'
Go to (540) Normal ending QMirror
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 22
(540) End QMirror
Execute QMirror on a new shell and choose command option 2 - ‘End current
instance’.
Or, you can use Ctrl-C to terminate QMirror immediately.
Go to (550) Add more AS400 physical files into QMirror table list
QMirror x.x.x (released at 20xx/xx) command list (ROOT): 0 – Reboot instance ROOT if running 1 – Start instance ROOT 2 – End instance ROOT 3 - Re-configuration 6 - Re-grant user privileges D – Dashboards and visualization L - Log monitoring S - Status monitoring Q - Quit Your option is (0/1/2/3/6/D/L/S/q) 2
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 23
(550) Add more AS400 physical files into QMirror table list
1. Execute QMirror on a new shell
2. Use command option 2 to end current instance if running
3. Use command option 4 to add tables from AS400 physical files
4. Use command option 5 to add indexes from AS400 logical files
5. Use command option 8 to add tables into AS400 journaling
6. Use command option 1 to start a new instance
Go to (560) Remove tables from QMirror table list
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 24
(560) Remove tables from QMirror table list
If you want to remove a specified table from QMirror table list, you can change
download flag TBDWFG to ‘D’ in system table QMIRROR.ZAMTBF.
Ex. UPDATE QMIRROR.ZAMTBF SET TBDWFG='D' WHERE TBLIB='LIBR1' AND TBOBJ='FILEA' AND TBMBR='FILEA'
QMirror will drop the tables which TBDWFG is ‘D’; end journal and reset TBDWFG
to ‘X’.
Go to (570) Data verification between AS400 DB2 and target database
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 25
(570) Data verification between AS400 DB2 and target database
QMirror provides a rapid and low loading data verification function for replicated
tables between AS400 DB2 and target database.
Data verification starts automatically at midnight or you can set verification schedule
time TBVRSH in system table QMIRROR.ZAMTBF for some specified tables.
Tables which were changed during last day will be selected for data verification. The
function will do the comparison of record counts and sum of numeric fields between
AS400 DB2 and target database. For overflow consideration, numeric fields scale
over 15 digits will not be included. A re-download event will be submitted if data
verification failed.
If you want to verify a specified AS400 table at once, you can change verification
flag TBVRFY to ‘Y’ in system table QMIRROR.ZAMTBF.
For some reasons if you want to ignore a table from data verification, change
verification flag TBVRFY to ‘X’ in system table QMIRROR.ZAMTBF.
Go to (590) Learn QMirror table status
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 26
(590) Learn QMirror table status
Table status is kept in field TBDWFG, QMIRROR.ZAMTBF.
’A’ - Wait for full table download
’D’ - To be removed
’G’ - Downloading
’I’ - Initiating for download
’Q’ - Queue for SQL QMIRROR.ZTBSQL statements
’R’ - Downloaded, ready to mirror
’S’ - Executing QMIRROR.ZTBSQL statements
’X’ - Excluded from QMirror
’Y’ - Waiting for full table download or ‘Selected Download’ if was specified
’Z’ - Downloaded and mirroring, ready to use
Examples:
1. To know which tables are not ready yet to use SELECT * FROM QMIRROR.ZAMTBF WHERE TBDWFG<>’Z’ AND TBDWFG<>’X’
2. To know which tables are excluded from QMirror
SELECT * FROM QMIRROR.ZAMTBF WHERE TBDWFG=’X’
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 27
(600) Tracking mode
QMirror could be executing as tracking mode to collect all running information into
system table QMIRROR.ZPCLOG.
QMirror administrator might be requested by QMirror developer to start QMirror as
tracking mode when unknown problems were happened. Then QMirror developer
team may analysis problems using this running information.
This is the fast way to solve all running problems and provide best service to QMirror
users.
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 28
(610) Test environment
Test environment is a useful tool when you are going to upgrade QMirror to a new
version. You may take time to test QMirror new functions in ‘Test Environment’
without ending existing QMirror. For efficiency consideration, only maximum 500
records will be downloaded from each AS400 physical files.
The steps to start QMirror test environment:
1. Install new version of QMirror into a temporary directory, ex. QMirror_New
2. Run QMirror in ‘Test Environment’:
c:\QMirror_NEW\qmirror.bat TEST
The test environment will create a reserved configuration ID named as ‘TEST’ and
copy configuration contents from configuration ‘ROOT’. If you want to do a test for
different AS400 server, you can re-configurate it through command option 3.
To remove test environment, you need to:
1. Drop all PC databases with prefix ‘TEST_’
2. Delete record in system table QMIRROR.ZSERVR with ZSVRID=’TEST’
3. Delete temporary directory ‘QMirror_New’.
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 29
(710) Grant target database privileges to users
You should create database users before you maintain the privileges in QMirror.
The table privileges are defined in system table QMIRROR.ZDBUSR. Basically, no
user should have edit authority on QMirror system database except DBA.
Example for user group: INSERT INTO QMIRROR.ZDBUSR (DBUSER,DBAUTH,DBLIB,DBOBJ,DBMBR) VALUES('GROUP1','SELECT','*ALL','*ALL','*ALL')
Example for single user: INSERT INTO QMIRROR.ZDBUSR (DBUSER,DBAUTH,DBLIB,DBOBJ,DBMBR) VALUES('JOHN','SELECT','*ALL','*ALL','*ALL')
Leave field DBAUTH as blank means to revoke all privileges for this table from users.
If you are going to implement target database privileges, all users should be defined
in QMIRROR.ZDBUSR. For instance, if you have five PC database users: user1,
user2, user3, user4 and user5. The table lines may look like this:
DBUSER DBAUTH DBLIB DBOBJ DBMBR
user1 SELECT *ALL *ALL *ALL
user2 SELECT LIBR1 *ALL *ALL
user3 SELECT LIBR1 FILE11 *ALL
user3 SELECT LIBR1 FILE13 *ALL
user4 SELECT LIBR2 FILE25 *ALL
user5 *ALL *ALL *ALL
Then use QMirror command option 6 to re-grant user privileges.
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 30
(720) Create extra indexes on target database
You should create sufficient indexes to get better query performance. The index
creation could be defined in system table QMIRROR.ZTBSQL.
Unique keys of physical file will be kept in field QMIRROR.ZAMTBF.TBUNIQ.
QMirror will insert a record into system table QMIRROR.ZTBSQL to build up index
by pulling index keys off of the AS400 physical file with ZQSEQ=99998 after the
table was downloaded.
QMirror will insert a records into system table QMIRROR.ZTBSQL to build up
indexes by pulling index keys off of the AS400 logical files with ZQSEQ=99999
when you use command option 5 to buildup indexes from AS400 logical files.
You can create extra indexes by insert records into system table QMIRROR.ZTBSQL
manually.
Example for Oracle, MySQL, DB2, PostgreSQL, MaxDB: INSERT INTO QMIRROR.ZTBSQL (ZQNDX,ZQBOA,ZQKEY,ZQSEQ,ZQSQL) VALUES(101,'A','LIBRARY1.FILEA;',1, 'CREATE INDEX FILEA01 ON LIBRARY1.FILEA (FIELD1,FIELD2)')
Example for MS SQL Server, Sybase: INSERT INTO QMIRROR..ZTBSQL (ZQNDX,ZQBOA,ZQKEY,ZQSEQ,ZQSQL) VALUES(101,'A','LIBRARY1..FILEA;',1, 'USE LIBRARY1;CREATE INDEX FILEA01 ON FILEA (FIELD1,FIELD2)')
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 31
(730) Define extended fields on target database
QMirror uses system table QMIRROR.ZEXFLD to add extended fields in the
replicated tables. Insert records into QMIRROR.ZEXFLD to define extended fields.
QMirror will maintain these fields for you. Please refer (A30) Extended fields master
(ZEXFLD) for table structure and field comments.
After maintained QMIRROR.ZEXFLD, you need to re-download the files which you
updated. Please refer (530) Re-download specified AS400 table manually.
1. System maintained extended field
System maintained extended fields are calculated fields in the replicated tables.
You can define formula into field EXFUNC. The formula could be a simple
function, store function, or a complex store procedure. The contents in the
extended fields will be updated by QMirror according to EXFUNC when records
are inserted or changed. Ex. INSERT INTO QMIRROR.ZEXFLD
(EXLIB,EXFILE,EXFLDE,EXFLDT,EXFUNC,EXFTXT) VALUES('LIBR1','FILEA','AMTEXT','CHAR(200)', 'MYFUN(BILLAMT)','Convert amount to text') (Notes: MYFUN is a store function defined by user)
2. User maintained extended field
A table with user maintained extended fields must have unique keys described in
field QMIRROR.ZAMTBF.TBUNIQ. If there has any unique key on AS400
physical file or logical files, QMirror will pull it off and put it into TBUNIQ. But if
it has not, then user needs to enter unique keys into TBUNIQ manually. Ex. INSERT INTO QMIRROR.ZEXFLD
(EXLIB,EXFILE,EXFLDE,EXFLDT,EXFTXT) VALUES('LIBR1','FILEA','PASSWD','CHAR(20)', 'Password for Web users')
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 32
(740) Define hidden fields on target database
If you have some fields on AS400 files are sensitive to share with users who are using
PC database, you can hide it up on target database, ex. salary. It is approached by
system table QMIRROR.ZHDFLD. Please refer (A40) Hidden fields master
(ZHDFLD) for table structure and field comments.
Insert records into QMIRROR.ZHDFLD for specified library / file / field of AS400
before file download. QMirror won't replicate the fields defined in ZHDFLD. Ex. INSERT INTO QMIRROR.ZHDFLD (HDLIB,HDFILE,HDFLDE)
VALUES('LIBR1','FILEA','FIELDC')
After maintained QMIRROR.ZHDFLD, you need to re-download the files which you
updated. Please refer to (530) Re-download specified AS400 table manually.
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 33
(750) Multiple AS400s / PC database servers configurations
QMirror supports many AS400 servers replicate to many PC database servers. It is
very useful if you have multiple AS400s and you are going to consolidate all these
data together for statistic or analysis. Or you want to split AS400 data to several
places for different purpose.
Every configuration has a unique ID in QMirror. The first configuration ID is named
as ‘ROOT’. Use command option 3 - ‘Re-configuration’ to add new configurations
into QMirror.
The PC database name in QMirror for secondary configurations will be put a prefix
before AS400 library name. For example, if the second configuration ID is ‘EAST’,
then the PC database name will be:
System database - EAST_QMIRROR
Library LIBA - EAST_LIBA (default, could be changed at configuration)
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 34
(760) Prepare batch programs to execute QMirror
There has a faster way to execute QMirror by using batch program.
A batch program named ‘run_qmirror.bat’ was installed in the QMirror directory.
Follow the instruction in ‘run_qmirror.bat’ to preset all the parameters needed by
QMirror. You can get all the encrypted data from QMirror console display under
interactive mode.
(Notes: QMirror will keep last workable run_qmirror.bat into run_qmirror.bat.ba2 automatically. So it will be no need to edit run_qmirror.bat again when you upgrade QMirror to a newer version.) For multiple configurations, copy ‘run_qmirror.bat’ to a new batch program and edit preset parameters as needed.
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 35
(770) Install QMirror as Windows service
To install QMirror as Windows service:
1. Download
Qmirror802s_1607_V5.zip for OS400 V5 server and above
qmirror680s_0905_V3V4.zip for OS400 V3/V4 server
2. Uninstall QMirror service earlier version from Windows program menu list
3. Unzip, execute program, and follow the instructions
4. A program menu ‘QMirror Service’ will be created on Windows
5. It is no need to drop any table on existing PC databases of earlier version
6. Edit preset parameters as needed in ROOT.ini (Notes: QMirror will keep last workable ROOT.ini into ROOT.ini.ba2 automatically. So it will be no need to edit ROOT.ini again when you upgrade QMirror to a newer version.)
7. Start QMirror service by launching ‘Services’ from the Windows ‘Control Panel /
Administrative Tools’
8. Refer to (510) Get QMirror running log and status
For multiple configurations, create new QMirror Service as below:
1. Copy ROOT.ini to a new file, ex. EAST.ini
2. Edit preset parameters as needed in EAST.ini (Notes: QMirror will keep last workable EAST.ini into EAST.ini.ba2 automatically. So it will be no need to edit EAST.ini again when you upgrade QMirror to a newer version.)
3. To create an extra QMirror Service: sc create QMirror5EAST binpath= "c:\QMirrorService5\qmirror5s.exe EAST.ini" displayname= "QMirror V5 EAST" (a space is required between equal '=' and double quote '”')
4. To remove an extra QMirror Service:
sc delete QMirror5EAST
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 36
(780) Selected download
Partial download of non-journaled files can be accomplished by QMirror through
SQL WHERE clause definition in ZAMTBF.TBSQLW. A new table on target
database <library.file_member_SELECTED> will be created with selected records
according to the SQL WHERE clause defined in ZAMTBF.TBSQLW.
Case study
Jack is QMirror administrator of company ABC using PostgreSQL as target database.
A large file SALES/DAILY on AS400 keeps sales daily information by product. The
date of sales is written in field SALES_DATE. A daily statistic procedure on AS400
will be started at 12:30 midnight and completed before 2:00 at morning. He wishes
QMirror to download the new records of last day after the daily procedure is done and
then merge it into the main table.
Here is what Jack did on QMirror setting.
1. Use command option 4 to include physical file SALES/DAILY into ZAMTBF
2. Use command option 5 to include index files of SALES/DAILY if any
3. Set file SALES/DAILY as a non-replication file:
ZAMTBF.TBREPL = ‘N’
4. Set ZAMTBF.TBJLIB and ZAMTBF.TBJNAM to blank if it is a journaled file and
the journal file is not QMIRROR/JRN
5. Set download schedule at 2:00am daily:
ZAMTBF.TBDSCH = 9999, TBNDTM = 020000
6. Set selected download SQL WHERE clause according to AS400 SQL syntax:
ZAMTBF.TBSQLW = ‘SALES_DATE = CURDATE() - 1 DAY’
7. Add a record in ZTBSQL to tell QMirror to delete duplicated records and merge it
into table SALES.DAILY after daily download from AS400 according to
PostgreSQL SQL syntax: INSERT INTO QMIRROR.ZTBSQL (ZQNDX,ZQBOA,ZQKEY,ZQSEQ,ZQSQL) VALUES(101,'A','SALES.DAILY_SELECTED;',100, 'DELETE FROM SALES.DAILY WHERE SALES_DATE = CURRENT_DATE - INTERVAL ''1 DAY''; INSERT INTO SALES.DAILY(SELECT * FROM SALES.DAILY_SELECTED);')
8. Start QMirror 9. QMirror will download full table of SALES.DAILY at first time
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 37
(790) Upload data from PC database to AS400 DB2
(Notes: An additional license is required to enable QMirror upload functions.)
QMirror provides a convenient and safe method to write data back to AS400 server
from PC database based on transaction management.
Only defined upload fields will be write back to AS400 server and these fields will be
restricted to download from AS400 server to PC database during replication. That
means you should not update the fields on AS400 which were defined as upload field.
To write data back to AS400 server from PC database:
1. The table must be journaled and well downloaded to PC database
2. Define upload fields in system table QMIRROR.ZUPFLD Use SQL command for rapid insertion: INSERT INTO QMIRROR.ZUPFLD (UPLIB,UPFILE,UPFLDI,UPFTXT) SELECT WHLIB,WHFILE,WHFLDI,WHFTXT FROM QMIRROR.ZWHFLD WHERE WHLIB='LIBR1' AND WHFILE='FILEA' Refer to (A120) Upload fields master (ZUPFLD)
3. Maintain upload fields' content on PC database by PC applications
4. Request QMirror to write data back based on transaction by inserting changed
records into system table QMIRROR.ZUPDTL: INSERT INTO QMIRROR.ZUPDTL (UPEDAT,UPETIM,UPTRXN,UPLIB,UPOBJ,UPMBR,UPCODE,UPRRN) VALUES(<current date>,<current time>,'POCFM','LIBR1','FILEA','FILEA','U',425);
Refer to (A110) Upload transaction detail (ZUPDTL) 5. Insert transaction controller into system table QMIRROR.ZUPCTL to close up:
INSERT INTO QMIRROR.ZUPCTL (UPEDAT,UPETIM,UPTRXN,UPRMRK) VALUES(<current date>,<current time>,'POCFM','Order confirmation')
Refer to (A100) Upload controller (ZUPCTL) 6. Check upload return code 0000 - Success 0001 - Fields definition error in ZUPFLD 0002 - Record missing on PC database 0003 - Record missing on AS400 server 0004 - Record insertion error 0005 - Record updating error 0006 - Table not journaled or well downloaded 0007 – Multiple split mapped tables can not be uploaded 9999 - Unknown error
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 38
(800) Define mapped table on PC database
(Notes: QMirror upload function does not support multiple split mapped tables.)
Normally, QMirror replicates AS400 DB2 to target database with same naming rules.
Target database name = AS400 library name
Target table name = AS400 physical file name
AS400 physical file member name
Target field name = AS400 field name
You might use QMirror system tables, ZAMTBM and ZWHFLM, to define your own
naming rules. Up to nine split mapped tables can be defined for one AS400 physical
file member by different non-zero number in ZAMTBM.MAPSEQ.
AS400 library name: ZAMTBM.TBLIB => ZAMTBM.MAPLIB
AS400 table name: ZAMTBM.TBOBJ => ZAMTBM.MAPOBJ
ZAMTBM.TBMBR
AS400 field name: ZWHFLD.WHFLDI => ZWHFLD.MAPFLD
Refer to (A15) Mapped table master (ZAMTBM)
(A130) Mapped filed master (ZWHFLM)
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 39
(810) Dashboards and visualization
(Notes: This function is not available on non-license trial mode.)
Now you can design your own dashboards to deliver greater control of your
organization’s performance management by QMirror with Xcelsius Engage.
Combined with variable list in QMirror system tables ZXMLDL and ZXMLIP, you
might construct dashboards with high flexibility for variant users.
Use QMirror command option D or batch program ‘run_dashboards.bat’ with proper
presetting parameters to execute XML exporting for dashboards and visualization.
To buy or download Xcelsius Engage trial executable from SAP webpage:
http://www.sap.com/solutions/sapbusinessobjects/sme/xcelsius/index.epx
A dashboards exercise named EXAMPLE is ready for you to study:
QMirror system tables – ZXMLHD, ZXMLDL, ZXMLIP
Xcelsius work file – example.xlf
SWF and HTML files generated by Xcelsius – example.swf, example.html
XML file generated by QMirror – ROOT_EXAMPLE.XML
Refer to (A150) XML export header (ZXMLHD)
(A140) XML export detail (ZXMLDL)
(A160) XML export controller (ZXMLIP)
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 40
(A10) AS400 table master (ZAMTBF)
Field name Key Data type Description
======== === ======= =========
TBLIB K CHAR(10) AS400 library name
TBOBJ K CHAR(10) AS400 file name
TBMBR K CHAR(10) AS400 member name
TBFMT CHAR(10) Record format
TBREPL CHAR(1) To be replicated
TBMAPS CHAR(1) Mapping table defined
TBJLIB CHAR(10) Journal library
TBJNAM CHAR(10) Journal name
TBFLDN NUMBER(5,0) Number of fields
TBRLEN NUMBER(5,0) Record length
TBTXT CHAR(50) AS400 file text
TBDWFG CHAR(1) Download flag Refer to (590) Learn QMirror table status
TBPRTY NUMBER(2,0) Download priority
TBMAXR NUMBER(10,0) Total records
TBDLTR NUMBER(10,0) Deleted records
TBDSCH NUMBER(4,0) Download schedule code Refer to (530) Re-download AS400 table manually
TBSQLW TEXT Selected download SQL WHERE clause Refer to (780) Selected download
TBNDDT NUMBER(8,0) Next download date
TBNDTM NUMBER(6,0) Next download time
TBDWDT NUMBER(8,0) Last download date
TBDWTM NUMBER(6,0) Last download time
TBSTS CHAR(1) Table status ‘E’ - Error occurred for this table
TBVRFY CHAR(1) Verification flag
TBVRSH NUMBER(6,0) Verification schedule time
TBVRDT NUMBER(8,0) Last verification date
TBVRTM NUMBER(6,0) Last verification time
TBRMRK CHAR(128) Remark
OBJTP K CHAR(8) Object type
OBJAT CHAR(10) Object attribute
OBSIZE NUMBER(15,0) Object size (bytes)
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 41
(A15) Mapped table master (ZAMTBM)
Field name Key Data type Description
======== === ======= =========
MAPLIB K CHAR(64) Mapped database name
MAPOBJ K CHAR(64) Mapped table name
TBLIB CHAR(10) AS400 library name
TBOBJ CHAR(10) AS400 file name
TBMBR CHAR(10) AS400 member name
MAPSEQ NUMBER(1,0) Mapped sequence
Refer to (800) Define mapped table on PC database
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 42
(A20) User privileges master (ZDBUSR)
Field name Key Data type Description
======== === ======= =========
DBLIB CHAR(10) AS400 library name
DBOBJ CHAR(10) AS400 file name
DBMBR CHAR(10) AS400 member name
DBUSER CHAR(32) PC database user/group name
DBAUTH CHAR(128) User privileges, separated by comma
Refer to (710) Grant target database privileges to users
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 43
(A30) Extended fields master (ZEXFLD)
Field name Key Data type Description
======== === ======= =========
EXLIB K CHAR(10) AS400 library name
EXFILE K CHAR(10) AS400 file name
EXFLDE K CHAR(15) Extended field name
EXRESV CHAR(1) Reserved
EXFLDT CHAR(32) Extended field data type
EXFUNC CHAR(500) Extended field function statement blank – User maintained field
EXFTXT CHAR(50) Extended field comment
EXSTS CHAR(1) Status of execution
Refer to (730) Define extended fields on target database
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 44
(A40) Hidden fields master (ZHDFLD)
Field name Key Data type Description
======== === ======= =========
HDLIB K CHAR(10) AS400 library name
HDFILE K CHAR(10) AS400 file name
HDFLDE K CHAR(15) Hidden field name
Refer to (740) Define hidden fields on target database
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 45
(A50) Job log file (ZJBLOG) / Job status file (ZJBSTS)
Field name Key Data type Description
======== === ======= =========
ZJTYPE CHAR(1) Log type blank - Delay status ‘D’ - Download status ‘E’ – Error occurred ‘R’ - Recovery status ‘S’ - SQL status
ZJJBID NUMBER(3,0) Job ID
ZJRPDT NUMBER(8,0) Reporting date
ZJRPTM NUMBER(6,0) Reporting time
ZJACTN CHAR(30) Action description
ZJLIB CHAR(10) AS400 library name
ZJOBJ CHAR(10) AS400 file name
ZJMBR CHAR(10) AS400 member name
ZJDATE NUMBER(8,0) Journal date
ZJTIME NUMBER(6,0) Journal time
ZJRCDS NUMBER(10,0) Journal records
ZJBSTS CHAR(1) Status code blank - Normal delay ’S’ - Starting delay
ZJRMRK CHAR(128) Remark
Refer to (520) Get QMirror status log
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 46
(A60) Journal master (ZJMASF)
Field name Key Data type Description
======== === ======= =========
ZMJLIB K CHAR(10) Journal library
ZMJNAM K CHAR(10) Journal name
ZMJNDX NUMBER(3,0) Journal index
ZMCRCV CHAR(10) Current journal receiver
ZMCSEQ NUMBER(10,0) Current sequence number
ZMJRCV NUMBER(4,0) No. of last deleted journal receiver
ZMRMRK CHAR(128) Remark
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 47
(A65) Journal count log (ZJMLOG)
Field name Key Data type Description
======== === ======= =========
ZJMRDT NUMBER(8,0) Date replicated
ZJMRHR NUMBER(6,0) Hour replicated
ZJLIB CHAR(10) AS400 library name
ZJOBJ CHAR(10) AS400 file name
ZJMBR CHAR(10) AS400 member name
ZJINS NUMBER(10,0) Records inserted
ZJUPD NUMBER(10,0) Records updated
ZJDEL NUMBER(10,0) Records deleted
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 48
(A70) System log file (ZPCLOG / ZPCLOG2)
Field name Key Data type Description
======== === ======= =========
ZPLGDT NUMBER(8,0) Logging date
ZPLGTM NUMBER(6,0) Logging time
ZPLSEQ NUMBER(3,0) Sequence number
ZPLOGS TEXT QMirror log
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 49
(A80) System control file (ZSERVR)
Field name Key Data type Description
======== === ======= =========
ZVERNO CHAR(10) QMirror version number
ZSVRID CHAR(4) Configuration ID ‘ROOT’ – Primary configuration Refer to (750) Multiple AS400s / PCs configurations ‘TEST’ – Test environment Refer to (610) Test environment
ZSYSDB CHAR(1) Separated system database
ZPTYPE NUMBER(1,0) Target database type
ZPINST CHAR(30) Target database instance name
ZPTPIP CHAR(30) Target database IP address
ZPPORT CHAR(10) Target database connection port
ZPUSER CHAR(30) Target database user ID
ZPPRFX CHAR(4) Target database prefix
ZATPIP CHAR(30) AS400 IP address
ZAUSER CHAR(10) AS400 user name
ZSLKEY CHAR(31) QMirror license key blank - Non-licensed trial edition
ZACHAR CHAR(10) Database character set
ZCCSID CHAR(5) DBCS/Unicode default CCSID
ZAJBPR NUMBER(2,0) AS400 job priority
ZXDLJB NUMBER(2,0) Maximum download threads
ZMSIZE NUMBER(5,0) Optimum mirror block size
ZJBLOG CHAR(10) Log flags
ZMLMSG CHAR(1) Email option ‘N’ - None ‘E’ - Error messages ‘W’ - Error and warning messages
ZMHOST CHAR(64) Email SMTP host
ZMADDR CHAR(128) Email address
ZMRDLN NUMBER(5,0) Maximum record length
ZJMRDT NUMBER(8,0) Replication cutoff date
ZJMRTM NUMBER(6,0) Replication cutoff time
ZJRCHE CHAR(1) Journal caching
ZSPSTS NUMBER(10,0) Mirror running status
ZRBOOT CHAR(1) Reboot QMirror instance
ZDESC CHAR(50) Configuration description
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 50
(A90) SQL statement master (ZTBSQL)
Field name Key Data type Description
======== === ======= =========
ZQNDX K NUMBER(9,0) Record index
ZQBOA CHAR(1) B/A-before or after table creation ‘A’ - Execute AFTER table was downloaded ‘B’ - Execute BEFORE table starts to be downloaded
ZQKEY TEXT Binding table list, separates by semicolon
ZQSEQ NUMBER(9,0) Sequence of execution 99998 - Index buildup from AS400 physical file 99999 - Indexes buildup from AS400 logical files
ZQSQL TEXT SQL statement
ZQSTS CHAR(1) Status of execution ‘X’ - Failed to execute SQL statement in ZQSQL ‘Y’ - Success to execute SQL statement in ZQSQL
ZQPDT NUMBER(8,0) Execution date
ZQPTM NUMBER(6,0) Execute time
Refer to (720) Create index on target database
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 51
(A100) Upload controller (ZUPCTL)
Field name Key Data type Description
======== === ======= =========
UPEDAT K NUMBER(8,0) Transaction date
UPETIM K NUMBER(12,6) Transaction time
UPTRXN K CHAR(10) Transaction code
UPRMRK CHAR(64) User remark
UPRTN CHAR(4) Return code
UPUDAT NUMBER(8,0) Upload date
UPUTIM NUMBER(8,0) Upload time
Refer to (780) Upload data from PC database to AS400 DB2
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 52
(A110) Upload transaction detail (ZUPDTL)
Field name Key Data type Description
======== === ======= =========
UPEDAT K NUMBER(8,0) Transaction date
UPETIM K NUMBER(12,6) Transaction time
UPTRXN K CHAR(10) Transaction code
UPLIB K CHAR(10) AS400 library name
UPOBJ K CHAR(10) AS400 file name
UPMBR K CHAR(10) AS400 member name
UPCODE K CHAR(1) Upload code (I/U/D)
UPRRN K NUMBER(10,0) AS400 relative record number For insertion, use negative sequence number
UPRMRK CHAR(64) User remark
UPRTN CHAR(4) Return code
UPUDAT NUMBER(8,0) Upload date
UPUTIM NUMBER(8,0) Upload time
Refer to (780) Upload data from PC database to AS400 DB2
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 53
(A120) Upload fields master (ZUPFLD)
Field name Key Data type Description
======== === ======= =========
UPLIB K CHAR(10) AS400 library name
UPFILE K CHAR(10) AS400 file name
UPFLDI K CHAR(10) AS400 field name
UPTXT CHAR(50) Field text
UPFRMK CHAR(64) User remark
Refer to (780) Upload data from PC database to AS400 DB2
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 54
(A130) Mapped field master (ZWHFLM)
Field name Key Data type Description
======== === ======= =========
MAPLIB K CHAR(64) Mapped database name
MAPOBJ K CHAR(64) Mapped table name
MAPFLD K CHAR(64) Mapped field name
WHFLDI CHAR(10) AS400 field name
Refer to (800) Define mapped table on PC database
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 55
(A140) XML export detail (ZXMLDL)
Field name Key Data type Description
======== === ======= =========
XMLFIL K CHAR(10) XML file name
XMLRNG K CHAR(30) XML range name
XMLDBS CHAR(1) Database type S – QMirror system database T – Target database
XMLAOD CHAR(1) Ascending or descending
XMLMRD FIXED(3,0) Maximum export records -1 – No maximum 256 – Default value
XMLDDS CHAR(50) Description
XMLSQL TEXT SQL statement
Refer to (810) Dashboards and visualization
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 56
(A150) XML export header (ZXMLHD)
Field name Key Data type Description
======== === ======= =========
XMLFIL K CHAR(10) XML file name
XMLTIT CHAR(30) Dashboards title
XMLGAP NUMBER(5,0) Refresh gap by seconds 0 – refresh when user pressed ENTER
XMLHDS CHAR(50) Description
XMLKEY NUMBER(16,0) Reserved for license check
Refer to (810) Dashboards and visualization
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 57
(A160) XML export controller (ZXMLIP)
Field name Key Data type Description
======== === ======= =========
XMLFIL K CHAR(10) XML file name
XMLUIP K CHAR(30) User IP address 127.0.0.1 – opened for all users
XMLVAR TEXT Variable list
XMLIDS TEXT Description
Refer to (810) Dashboards and visualization
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 58
(B10) Error messages
E001: AS400 user <user> does not have authority to execute QMirror.
E002: Table list is empty. Please buildup table list from AS400 physical files.
E003: Please download another QMirror program for OS400 V<version>.
E004: Make sure the latest PTFs are applied to the AS400 server at <IP address>.
E101: QMirror license is expired or incorrect.
E102: QMirror maintenance is expired. Please purchase it at www.qmirror.com.
E103: Configuration failure.
E104: Serious problem was happened. You need to drop QMIRROR database
in <PC database type> and re-start QMirror.
E105: Re-download setting failure.
E106: Configuration ID <id> is incorrect.
E201: System control record in system table <database.table> is missed.
E203: QMirror already started.
E204: Failed to start QMirror.
E205: Target database <database> at <IP address> does not exist.
E301: AS400 at <IP address> is not running.
E302: AS400 user password is incorrect.
E303: AS400 connection failure.
E304: <journal work file> can not be created or has been locked.
E305: Mirror threads could not be fully started.
E401: <PC database type> at <IP address> is not running
or instance <instance> not exist or installation incorrect.
E402: <PC database type> <user ID> password is incorrect or connection refused.
E403: <PC database type> <user ID> can not login.
E404: <PC database type> connection failure.
E405: Failed to end existing instance <instance>.
E406: Failed to create <PC database> on <PC database type> at <IP address>.
E501: SQL failure - <SQL statement>
E502: <database.table> failure - <SQL statement>
E503: System table <database.table> has error at <database.table> field <field>.
E504: System table <database.table> has errors at <database.table> fields unknown.
E505: <library/file/member> Library/File/Member download error occurred.
E506: <library/file/member/rrn> Library/File/Member/RRN can not be <event>.
E507: Failed uploading data to AS400 with error code <error code>.
QMirror Installation and User’s Guide
© Copyright Middleware Technologies Limited 2005 59
(B20) Warning messages
W101: QMirror configuration terminated.
W102: Non-licensed TRIAL EDITION is limited on 10 fields of each table.
W103: QMirror license will be expired at the end of this month.
W104: QMirror command terminated.
W301: No table is journaling. Mirror threads disabled.
W303: AS400 at <IP address> is not running. Will re-connect <n> minutes later.
W304: AS400 field value dumping (<offset>) <library/file/member/RRN>
W305: Failed to build up replication path. Re-starting QMirror.
W306: <library/file.field> is a reserved word. Change field name to <field>.
W307: AS400 journal <library/journal> is not available now. Will try it later.
W308: AS400 journal <library/journal> does not exist or read error.
W309: Re-download <library/file/member>
W310: Physical file member <library.file_member> has been deleted.
W311: Physical file member <library.file_member> has been moved to
<new library.new file_new member>.
W312: Physical file member <library.file_member> has been renamed to
<new library.new file_new member>.
W313: <library/file/member/rrn.field> has different field definition. Downloaded as
<default value>.
W314: <library/file/member> verification failure.
W402: <PC database type> at <IP address> is not running.
Will re-connect <n> minutes later.
W403: <database.table> is locked.
W404: <database.table> can not be dropped. Will try it later.
W405: <database.table> can not be renamed. Will try it later.
W406: <library/file/member/rrn> Library/File/Member/RRN can not be mirrored.
Will try it later. <exceptions>