MIRROR_COMPARE_NODE procedure
The MIRROR_COMPARE_NODE procedure populates a result table with one or
more rows for each object in every library that is different from the same object on the other node.
The compares can be made for all libraries in SYSBAS, for all libraries in the current IASP, or for
all libraries in SYSBAS and all active IASPs.
The objects that are compared are those that return a value that is not EXCLUDE or INELIGIBLE from the QSYS2.CHECK_REPLICATION_CRITERIA function. For replication-eligible objects, comparison operations can be performed for the definitional attributes of the object, the data contained in the object, or both. Only *FILE, *USRIDX, *USRSPC, *DTAQ, and *OUTQ objects support data comparisons. A value of YES or QUICK must be specified for at least one of the compare-attributes or compare-data parameters. For more information about object comparisons, see MIRROR_COMPARE_OBJECT table function.
![Start of change](./delta.gif)
Authorization: The privileges held by the authorization ID of the statement must include *ALLOBJ special authority. For the authority needed to use this function, see Authorization.
To specify a parallel degree value other than NONE, the privileges held by the authorization ID of the statement must include *JOBCTL special authority or QIBM_DB_SQLADM, function usage authority.
![End of change](./deltaend.gif)
- compare-scope
- A character or graphic string expression that determined the scope of the comparisons.
- ALL
- The scope includes all libraries in SYSBAS and in all active and available IASPs on the primary
node.
This option submits multiple batch jobs with a job name of MCOMP_ALL to do the comparisons. A result set is returned from the procedure that contains the list of all the jobs that were submitted. When all the jobs are complete, result-file will contain information from all the compares.
- IASP
- The scope includes all libraries in the IASP namespace of the caller.
- *SYSBAS
- The scope includes all libraries in SYSBAS on the primary node.
- compare-attributes
- A character or graphic string expression that indicates whether the replication-eligible
attributes are compared for each object.
- NO
- The attributes are not compared for an object.
- QUICK
- The attributes are compared for an object until the first difference is found. Only a single row is returned for an object if any differences are detected. This option is faster because a complete list of differences for an object is not returned.
- YES
- All the attributes are compared for an object. A row is returned for each difference found. This is the default.
- compare-data
- A character or graphic string expression that indicates whether the data is compared for *FILE,
*USRIDX, *USRSPC, *DTAQ, and *OUTQ objects. compare-data is ignored
for all other objects.
- NO
- The data is not compared for an object.
- QUICK
- The data is compared for *FILE, *USRIDX, *USRSPC, *DTAQ, and *OUTQ objects until the first difference is found. Only a single row is returned if any differences are detected. This option is faster because a complete list of differences for an object is not returned.
- YES
- All the data is compared for a *FILE, *USRIDX, *USRSPC, *DTAQ, or *OUTQ object. A row is returned for each difference found. This is the default.
- parallel-degree
- A character or graphic string that specifies the maximum degree of parallelism to use for
comparing each object.
If the Db2® Symmetric Multiprocessing (SMP) feature is not installed, an error is issued if the value is not NONE.
- 2-256
- The maximum degree of parallelism to be used.
- NONE
- No parallelism will be used. This is the default.
- parallel-jobs
- An integer value that specifies the maximum number of jobs that can be run at one time to compare individual objects in a library. The default is 1.
- result-library
- A character or graphic string expression that identifies the name of the library to contain the details from the compare. The library must exist. When compare-scope is ALL, the result library cannot be QTEMP. If this parameter is omitted, QTEMP is the default.
- result-file
- A character or graphic string expression that identifies the system name of the file to contain the details from the compare. The result includes rows for miscompare details and any additional rows returned when verbose-log has a value of YES. If this parameter is omitted, QIBM_MCOMP is the default. If the file already exists, new rows are inserted into the file.
- verbose-log
- A character or graphic string expression that indicates whether to return at least one row for
each object that is compared.
- NO
- Rows are returned only for objects that do not compare as identical. This is the default.
- YES
- A row is returned for every object that is compared.
The table that contains the result is identical to the table returned by QSYS2.MIRROR_COMPARE_LIBRARY. See Table 1.
Example
- Compare all the replicated objects that reside in
SYSBAS.
CALL QSYS2.MIRROR_COMPARE_NODE(COMPARE_SCOPE =>'*SYSBAS', RESULT_LIBRARY => 'DB2M_COMP', RESULT_FILE => 'SYSBASCOMP');
- Compare all replicated objects in IASP33. At least one row will be returned for every object
that is
compared.
-- Set your job to run in IASP33. CALL QSYS2.MIRROR_COMPARE_NODE(COMPARE_SCOPE => 'IASP', RESULT_LIBRARY => 'DB2M_COMP', RESULT_FILE => 'IASP_COMP', VERBOSE_LOG => 'YES');
- Compare all the replicated object types in SYSBAS and in all ASPs. A quick compare of both the
object attributes and the object data is used to identify the objects that might need a full
compare. The result is returned in COMPARES/COMP1. The COMPARES library must exist. The file will be
created by the procedure.
CALL QSYS2.MIRROR_COMPARE_NODE(COMPARE_SCOPE => 'ALL', COMPARE_ATTRIBUTES => 'QUICK', COMPARE_DATA => 'QUICK', RESULT_LIBRARY => 'COMPARES', RESULT_FILE => 'COMP1');
A result set is returned from the procedure that contains the name of each job submitted to process the compare with a compare_scope of ALL.