(300) Simulation Test
Simulation test is a well designed function for you to quickly review QMirror/BK in a few minutes. Execute Simulation Test requires QMirror/BK library list to be empty. To empty QMirror/BK library list, use command option 3 – ‘Remove libraries from library list’.
Simulation test uses the following AS400 commands to build up simulation environments:
CRTLIB, CRTDTAARA, CRTSRCPF, ADDPFM, CPYF, CRTPF, CRTLF, MOVOBJ, CHGOBJD, CRTCLPGM, and SQL statements to INSERT, UPDATE physical file.
Start QMirror/BK, use command option T – ‘Simulation test’
20xx/xx/xx 15:33:59 Login AS400 at xxx.xxx.xxx.xxx … 20xx/xx/xx 15:34:06 Timer Synchronizing 20xx/xx/xx 15:34:03 AS400 – Serial number xxxxxxx Model xxx 20xx/xx/xx 15:34:03 OS400 – Version x Release x Modification x 20xx/xx/xx 15:34:03 QMirror working library on AS400 is QMIRROR QMirror/BK x.x.x (released in 20xx/xx) command list (QMBK): 1 – Start QMirror/BK 4 – Build up object list from AS400 libraries 6 – Show selected library list 7 – Show excluded object list 8 – ENDJRNPF unselected libraries K – Change license key R – Switch to recovery mode T – Simulation test U – Uninstall QMirror/BK Q – Quit Your option is (1/4/5/6/7/8/k/r/t/u/Q)t |
QMirror/BK will create two libraries, BK001 and BK002. Then build up simulation data in both libraries.
Build up simulation data CRTLIB – Create library BK001 CRTLIB – Create library BK002 CRTDTAARA – Create data area dtaara101 on library BK001 CRTDTAARA – Create data area dtaara202 on library BK002 CRTSRCPF -CreatesourcephysicalfileQCLPSRC on library BK001 ADDPFM – Add source physical file member CLP101 to QCLPSRC Insert CLP statements into source CLP101 CRTSRCPF -Create source physical file QDDSSRC on library BK001 ADDPFM – Add source physical file member FILE101 to QDDSSRC Insert DDS statements into source FILE101 CRTPF – Create physical file FILE101 from DDS on library BK001 Insert 5 records into FILE101 ADDPFM – Add source physical file member FILE101_LF to QDDSSRC Insert DDS statements into source FILE101_LF CRTLF – Create logical file FILE101_LF from DDS on library BK001 Done. |
You can use PDM to review object list in libraries BK001 and BK002.
Work with Objects Using PDM Library . . . . . BK001 Position to . . . . . . . . Position to type . . . . . Type options, press Enter. 2=Change 3=Copy 4=Delete 5=Display 7=Rename 8=Display description 9=Save 10=Restore 11=Move … OptObjectTypeAttribute Text FILE101 *FILEPF-DTA Physical file 101 FILE101_LF*FILELFLogical file for FILE101 QCLPSRC*FILEPF-SRC QDDSSRC*FILEPF-SRC DTAARA101*DTAARAText of dtaara101 Parameters or command ===> F3=Exit F4=Prompt F5=Refresh F6=Create F9=Retrieve F10=Command entry F23=More options F24=More keys |
Use command option 4 – ‘Build up object list from AS400 libraries’
Please take the following steps: Take a look at QMirror/BK simulation test data on your AS400 Use command option 4 to build up object list from library BK001 and BK002 1 – Start QMirror/BK 4 – Build up object list from AS400 libraries 6 – Show selected library list 7 – Show excluded object list 8 – ENDJRNPF unselected libraries K – Change license key R – Switch to recovery mode Q – Quit Your option is (1/4/5/6/7/8/k/r/Q) 4 |
Build up object list from library BK001 and BK002.
Auto-select new libraries from source AS400 to target AS400? (y/N) n New libraries auto-select disabled Build up object list from source AS400 to target AS400 – Enter source AS400 library name (*ALLUSR/generic*/name): dr001 Replicate from source libraries DR001 (y/N/q) y DR001selected. Analyzing… OBJTYPESIZE(Kb) TEXT ———-——–——–——————– DTAARA101 *DTAARA 9 Text of dtaara101 QCLPSRC *FILE 58 FILE101 *FILE 91Physical file 101 QDDSSRC *FILE58 FILE101_LF*FILE 29 Logical file for FILE101 FILE101*FILE13member FILE101 QCLPSRC*FILE9 member CLP101 QCLPSRC *FILE 9 member CLP102 QDDSSRC *FILE 9 member FILE101 QDDSSRC *FILE 9 member FILE101_LF Library DR001 has 10 objects/members, 0Mb Total needs to transfer 10 objects/members, 0Mb Build up object list from source AS400 to target AS400 – Enter source AS400 library name (*ALLUSR/generic*/name): (DR001/q) dr002 Replicate from source libraries R002 (y/N/q) y DR002selected.Analyzing… OBJTYPESIZE(Kb) TEXT ———-——–——–——————– DTAARA202 *DTAARA9Text of dtaara202 Library DR002 has 1 objects/members, 0Mb Total needs to transfer 11 objects/members, 0Mb Build up object list from source AS400 to target AS400 – Enter source AS400 library name (*ALLUSR/generic*/name): (DR002/q) q Backup simulation data to save files CRTLIB – Create library BK_SAVF CRTSAVF – Create save file BK001 on library BK_SAVF SAVLIB – Save library BK001 to BK_SAVF/BK001 CRTSAVF – Create save file BK002 on library BK_SAVF SAVLIB – Save library BK002 to BK_SAVF/BK002 Done. |
Simulation Test backed up libraries BK001 and BK002 to save files in library BK_SAVF.
Use command 1 – ‘Start QMirror/BK’
Please use command option 1 to start QMirror/BK QMirror/BK x.x.x (released in 20xx/xx) command list (QMBK): 1 – Start QMirror/BK 3 – Remove libraries from library list 4 – Build up object list from source AS400 libraries 6 – Show selected library list 7 – Show excluded object list 8 – ENDJRNPF unselected libraries K – Change license key R – Switch to recovery mode U – Uninstall QMirror/BK Q – Quit Your option is (1/3/4/5/6/7/8/k/r/u/Q) 1 |
QMirror/BK Starts running.
Continue simulation test CRTDTAARA – Create data area dtaara102 on library BK001 CRTDTAARA – Create data area dtaara103 on library BK001 MOVOBJ – Move data area dtaara101 from library BK001 to BK002 20xx/xx/xx 15:59:57 Object deleted (S) – BK001/DTAARA101 *DTAARA 20xx/xx/xx 16:00:01 Back up – BK002/DTAARA101 *DTAARA 20xx/xx/xx 16:00:01 Back up – BK001/DTAARA102 *DTAARA 20xx/xx/xx 16:00:02 Back up – BK001/DTAARA103 *DTAARA CHGOBJD – Change source physical file QCLPSRC text ADDPFM – Add source physical file member CLP103 to QCLPSRC Insert CLP statements into source CLP103 CRTCLPGM -Create CLP program CLP103 ADDPFM – Add source physical file member FILE101_L2 to QDDSSRC Insert DDS statements into source FILE101_L2 CRTLF – Create another logical file FILE101_L2 from DDS on library BK001 20xx/xx/xx 16:00:15 Physical file BK001/QCLPSRC changed 20xx/xx/xx 16:00:15 Delay 7 secs. From 20xxxxxx/155959 to 160010 (3 rcds) 20xx/xx/xx 16:00:20 Back up – BK001/QCLPSRC/CLP103 20xx/xx/xx 16:00:24 Delay 6 secs. From 20xxxxxx/160010 to 160020 (5 rcds) Double records in file FILE101 (total 10 rcds) 20xx/xx/xx 16:00:27 Back up – BK001/CLP103 *PGM 20xx/xx/xx 16:00:27 Back up – BK001/QDDSSRC/FILE101_L2 Double records again in file FILE101 (total 20 rcds) 20xx/xx/xx 16:00:34 Delay 6 secs. From 20xxxxxx/160020 to 160030 (5 rcds) Double records again in file FILE101 (total 40 rcds) 20xx/xx/xx 16:00:43 Back up – BK001/FILE101_L2 *FILE 20xx/xx/xx 16:00:43 Delay 5 secs. From 20xxxxxx/160030 to 160040 (30 rcds) Double records again in file FILE101 (total 80 rcds) Double records again in file FILE101 (total 160 rcds) 20xx/xx/xx 16:00:53 Delay 5 secs. From 20xxxxxx/160040 to 160050 (40 rcds) Double records again in file FILE101 (total 320 rcds) 20xx/xx/xx 16:01:03 Delay 5 secs. From 20xxxxxx/160050 to 160100 (80 rcds) Double records again in file FILE101 (total 640 rcds) 20xx/xx/xx 16:01:13 Delay 5 secs. From 20xxxxxx/160100 to 160110 (160 rcds) Double records again in file FILE101 (total 1280 rcds) 20xx/xx/xx 16:01:23 Delay 5 secs. From 20xxxxxx/160110 to 160120 (320 rcds) 20xx/xx/xx 16:01:33 Delay 5 secs. From 20xxxxxx/160120 to 160130 (640 rcds) Double records again in file FILE101 (total 2560 rcds) 20xx/xx/xx 16:01:54 Delay 6 secs. From 20xxxxxx/160140 to 160150 (1280 rcds) Double records again in file FILE101 (total 5120 rcds) Update file FILE101 set COL02=333,COL03=’333′ where COL01=’3′ Update file FILE101 set COL02=55555,COL03=’55555′ where COL01=’5′ 20xx/xx/xx 16:02:16 Delay 8 secs. From 20xxxxxx/160200 to 160210 (3854 rcds) 20xx/xx/xx 16:02:24 Delay 6 secs. From 20xxxxxx/160210 to 160220 (1024 rcds) Done. You can do more changes on |
Simulation test continues to create and change objects on AS400. Physical file BK001/FILE001 will be inserted with more records and changes.
Continue simulation test CRTDTAARA – Create data area dtaara102 on library BK001 CRTDTAARA – Create data area dtaara103 on library BK001 MOVOBJ – Move data area dtaara101 from library BK001 to BK002 20xx/xx/xx 15:59:57 Object deleted (S) – BK001/DTAARA101 *DTAARA 20xx/xx/xx 16:00:01 Back up – BK002/DTAARA101 *DTAARA 20xx/xx/xx 16:00:01 Back up – BK001/DTAARA102 *DTAARA 20xx/xx/xx 16:00:02 Back up – BK001/DTAARA103 *DTAARA CHGOBJD – Change source physical file QCLPSRC text ADDPFM – Add source physical file member CLP103 to QCLPSRC Insert CLP statements into source CLP103 CRTCLPGM -Create CLP program CLP103 ADDPFM – Add source physical file member FILE101_L2 to QDDSSRC Insert DDS statements into source FILE101_L2 CRTLF – Create another logical file FILE101_L2 from DDS on library BK001 20xx/xx/xx 16:00:15 Physical file BK001/QCLPSRC changed 20xx/xx/xx 16:00:15 Delay 7 secs. From 20xxxxxx/155959 to 160010 (3 rcds) 20xx/xx/xx 16:00:20 Back up – BK001/QCLPSRC/CLP103 20xx/xx/xx 16:00:24 Delay 6 secs. From 20xxxxxx/160010 to 160020 (5 rcds) Double records in file FILE101 (total 10 rcds) 20xx/xx/xx 16:00:27 Back up – BK001/CLP103 *PGM 20xx/xx/xx 16:00:27 Back up – BK001/QDDSSRC/FILE101_L2 Double records again in file FILE101 (total 20 rcds) 20xx/xx/xx 16:00:34 Delay 6 secs. From 20xxxxxx/160020 to 160030 (5 rcds) Double records again in file FILE101 (total 40 rcds) 20xx/xx/xx 16:00:43 Back up – BK001/FILE101_L2 *FILE 20xx/xx/xx 16:00:43 Delay 5 secs. From 20xxxxxx/160030 to 160040 (30 rcds) Double records again in file FILE101 (total 80 rcds) Double records again in file FILE101 (total 160 rcds) 20xx/xx/xx 16:00:53 Delay 5 secs. From 20xxxxxx/160040 to 160050 (40 rcds) Double records again in file FILE101 (total 320 rcds) 20xx/xx/xx 16:01:03 Delay 5 secs. From 20xxxxxx/160050 to 160100 (80 rcds) Double records again in file FILE101 (total 640 rcds) 20xx/xx/xx 16:01:13 Delay 5 secs. From 20xxxxxx/160100 to 160110 (160 rcds) Double records again in file FILE101 (total 1280 rcds) 20xx/xx/xx 16:01:23 Delay 5 secs. From 20xxxxxx/160110 to 160120 (320 rcds) 20xx/xx/xx 16:01:33 Delay 5 secs. From 20xxxxxx/160120 to 160130 (640 rcds) Double records again in file FILE101 (total 2560 rcds) 20xx/xx/xx 16:01:54 Delay 6 secs. From 20xxxxxx/160140 to 160150 (1280 rcds) Double records again in file FILE101 (total 5120 rcds) Update file FILE101 set COL02=333,COL03=’333′ where COL01=’3′ Update file FILE101 set COL02=55555,COL03=’55555′ where COL01=’5′ 20xx/xx/xx 16:02:16 Delay 8 secs. From 20xxxxxx/160200 to 160210 (3854 rcds) 20xx/xx/xx 16:02:24 Delay 6 secs. From 20xxxxxx/160210 to 160220 (1024 rcds) Done. You can do more changes on |
To simulate recovery procedure, stop QMirror/BK first, then rename library BK001 and BK002 to BK001_NEW and BK002_NEW. Restore library BK001 and BK002 from save files from library BK_SAVF.
Please take the following steps: Use Cntl-C to end QMirror/BK Rename library BK001 to BK001_NEW: RNMOBJ OBJ(QSYS/BK001) OBJTYPE(*LIB) NEWOBJ(BK001_NEW) Rename library BK002 to BK002_NEW: RNMOBJ OBJ(QSYS/BK002) OBJTYPE(*LIB) NEWOBJ(BK002_NEW) Restore library BK001: RSTLIB SAVLIB(BK001) DEV(*SAVF) SAVF(BK_SAVF/BK001) Restore library BK002: RSTLIB SAVLIB(BK002) DEV(*SAVF) SAVF(BK_SAVF/BK002) Run run_qmirror_qmbk.bat Use command option 2 to end QMirror/BK Use command option R to switch to recovery mode Run qmirrorbkxxx.exe Use command option 9 to start recovery After recovery, compare library BK001 with BK001_NEW, and BK002 with BK002_NEW |
You can use PDM to list library BK*.
Work with Objects Using PDM Library . . . . . DR001 Position to . . . . . . . . Type options, press Enter. 2=Change 3=Copy 4=Delete 5=Display 7=Rename 8=Display description 9=Save 10=Restore ASP Opt LibraryTypeDeviceText BK_SAVF *TESTQMirror/BK test library for SAVF BK001 *TESTQMirror/BK test library 001 BK001_NEW *TESTQMirror/BK test library 001 BK002 *TESTQMirror/BK test library 002 BK002_NEW*TEST QMirror/BK test library 002 Bottom |
Execute QMirror/BK and use command option 2 – ‘End current instance’. Use command option ‘R’ to switch QMirror/BK to recovery mode.
xx/xx/xx 17:15:14 > > > RECOVERY MODE < < < 20xx/xx/xx 17:15:14 Login AS400 at xxx.xxx.xxx.xxx … 20xx/xx/xx 17:15:18 Timer Synchronizing 20xx/xx/xx 17:15:16 AS400 – Serial number xxxxxxx Model xxx 20xx/xx/xx 17:15:16 OS400 – Version x Release x Modification x 20xx/xx/xx 17:15:16 QMirror working library on AS400 is QMIRROR 20xx/xx/xx 17:15:17 Earliest save date/time at 20xxxxxx/154746 20xx/xx/xx 17:15:17 Earliest saved object – BK001 20xx/xx/xx 17:15:17 Journal backup stopped at 20xxxxxx/160220 6 – Show selected library list 9 – Start recovery B – Switch to backup mode G – Recovery triggers setting only Q – Quit Your option is (6/9/b/t/Q) 9 Earliest save date/time 20xxxxxx/154746 Earliest saved library – BK001 Recovery from date (20xxxxxx/q): Recovery from time (154746/q): Recovery from 20xxxxxx/154746 (y/N): y 20xx/xx/xx 17:21:38 QMirror/BK x.x.x recovery mode start up (QMBK) … 20xx/xx/xx 17:21:40 Object deleted – BK001/DTAARA101 *DTAARA 20xx/xx/xx 17:21:41 Recovery object – BK001/DTAARA102 *DTAARA 20xx/xx/xx 17:21:41 Recovery object – BK001/DTAARA103 *DTAARA 20xx/xx/xx 17:21:41 Recovery object – BK002/DTAARA101 *DTAARA 20xx/xx/xx 17:21:41 Recovery object – BK001/CLP103 *PGM CLP 20xx/xx/xx 17:21:41 Recovery start from 20xxxxxx/155959 20xx/xx/xx 17:21:41 Reorganize working library … 20xx/xx/xx 17:22:16 Journal recovery preparing … 20xx/xx/xx 17:22:21 Physical file BK001/QCLPSRC changed 20xx/xx/xx 17:22:22 Recovery data from 20xxxxxx/155959 to 160007 (3 rcds) 20xx/xx/xx 17:22:22 Recovery member – BK001/QCLPSRC/CLP103 20xx/xx/xx 17:22:28 Physical file BK001/QCLPSRC changed 20xx/xx/xx 17:22:28 Recovery data from 20xxxxxx/160007 to 160010 (3 rcds) 20xx/xx/xx 17:22:29 Recovery data from 20xxxxxx/160010 to 160017 (1 rcds) 20xx/xx/xx 17:22:29 Recovery object – BK001/FILE101_L2 *FILE LF 20xx/xx/xx 17:22:31 Recovery data from 20xxxxxx/160017 to 160019 (5 rcds) 20xx/xx/xx 17:22:32 Recovery member – BK001/QDDSSRC/FILE101_L2 20xx/xx/xx 17:22:34 Recovery data from 20xxxxxx/160019 to 160020 20xx/xx/xx 17:22:34 Recovery data from 20xxxxxx/160020 to 160030 (5 rcds) 20xx/xx/xx 17:22:35 Recovery data from 20xxxxxx/160030 to 160040 (30 rcds) 20xx/xx/xx 17:22:35 Recovery data from 20xxxxxx/160040 to 160050 (40 rcds) 20xx/xx/xx 17:22:36 Recovery data from 20xxxxxx/160050 to 160100 (80 rcds) 20xx/xx/xx 17:22:36 Recovery data from 20xxxxxx/160100 to 160110 (160 rcds) 20xx/xx/xx 17:22:39 Recovery data from 20xxxxxx/160110 to 160120 (320 rcds) 20xx/xx/xx 17:22:46 Recovery data from 20xxxxxx/160120 to 160130 (640 rcds) 20xx/xx/xx 17:22:54 Recovery data from 20xxxxxx/160130 to 160141 (1200 rcds) 20xx/xx/xx 17:22:54 Recovery data from 20xxxxxx/160141 to 160150 (80 rcds) 20xx/xx/xx 17:23:04 Recovery data from 20xxxxxx/160150 to 160201 (1200 rcds) 20xx/xx/xx 17:23:14 Recovery data from 20xxxxxx/160201 to 160201 (1210 rcds) 20xx/xx/xx 17:23:16 Recovery data from 20xxxxxx/160201 to 160210 (1174 rcds) 20xx/xx/xx 17:23:25 Recovery data from 20xxxxxx/160210 to 160220 (1024 rcds) 20xx/xx/xx 17:23:26 Recovery data from 20xxxxxx/160220 to 172325 20xx/xx/xx 17:23:26 Journal recovery completed 20xx/xx/xx 17:23:29 Recovery triggers setting 20xx/xx/xx 17:23:34 Recovery completed |
You can use PDM to compare object list between libraries BK001 and BK001_NEW.
Work with Objects Using PDM Library . . . . . BK001 Position to . . . . . . . . Position to type . . . . . Type options, press Enter. 2=Change 3=Copy 4=Delete 5=Display 7=Rename 8=Display description 9=Save 10=Restore 11=Move … Opt ObjectTypeAttributeText CLP103*PGMCLPQMirror/BK test CLP 103 FILE101*FILEPF-DTAPhysical file 101 FILE101_LF*FILELFLogical file for FILE101 FILE101_L2*FILE LFLogical file for FILE101 #2 QCLPSRC *FILEPF-SRCCLP source file QDDSSRC*FILEPF-SRC DTAARA102*DTAARAText of dtaara102 DTAARA103*DTAARAText of dtaara103 Bottom |
STRSQL, use the following SQL statement to check if data in file BK001/FILE101 is same as BK001_NEW/FILE101.
SELECT COL01,COUNT(*),SUM(COL02) FROM BK001/FILE101 GROUP BY COL01 ORDER BY COL01
Display Data Data width . . . . . . : Position to line . . . . .Shift to column . . . . . . ….+….1….+….2….+….3….+….4….+….5….+….6….+….7 Column 01COUNT ( * )SUM ( COL02 ) 11,024 1,024 2 1,024 2,048 3 1,024 340,992 4 1,024 4,096 5 1,024 56,888,320 ******** End of data ******** |
- End QMirror/BK
- Use QMirror/BK command option ‘3’ to clear entire library object list
- Delete library BK001 and BK002 on AS400