INSPECT_REPLICATION_CRITERIA table function
The INSPECT_REPLICATION_CRITERIA table function returns one row for each rule that applies to the object identified by the iasp-name, library-name, object-type, and object-name parameters. The list of rules generated with and without a pending apply-label can be examined to understand the effect of applying a pending rule.
Each row describes a rule in the Replication Criteria List (RCL) that is used to determine if the specified object will be included or excluded from replication through Db2® Mirror.
- The rule that matches iasp-name, library-name, object-type, and object-name.
- The rule that matches iasp-name, library-name, and object-type.
- The rule that matches iasp-name and library-name.
- The rule that matches iasp-name. This rule is always returned, reflecting the default inclusion state.
RULE_SOURCE
values of
SYSTEM
and USER
. In this case, additional rows would be returned
that have the same rule identifier and precedence order.- For the authority needed to use this procedure, see Authorization.
- *EXECUTE authority on the QSYS2 library.
- *OBJOPR and *READ authority on QSYS2/MIRROR_RCL
- iasp-name
- A character or graphic string expression that identifies the name of the auxiliary storage pool
(ASP) group. Can contain the following special value:
- *SYSBAS
- The replication criteria rule is associated with the system ASP (ASP 1) and any basic user ASPs (ASPs 2-32).
- library-name
- A character or graphic string expression that identifies the library name.
- object-type
- A character or graphic string expression that identifies the object type.
Any system object type can be specified. However, only the following type values are eligible for replication. All others will return a row for this object with an INCLUSION_STATE column value of INELIGIBLE.
- *AUTL
- Authorization list. library-name must be QSYS.
- *DTAARA
- Data area
- *DTAQ
- Data queue
- *ENVVAR
- System-level environment variable. library-name must be QSYS.
- *FCNUSG
- Function usage
- *FILE
- Database file
- *JOBD
- Job description
- *JOBQ
- Job queue
- *JRN
- Journal
- *LIB
- Library
- *OUTQ
- Output queue
- *PGM
- Program
- *SECATR
- Security attribute
- *SQLPKG
- SQL package
- *SQLUDT
- SQL user-defined type
- *SQLXSR
- SQL XML schema repository
- *SRVPGM
- Service program
- *SYSVAL
- System value. library-name must be QSYS.
- *USRIDX
- User index
- *USRPRF
- User profile. library-name must be QSYS.
- *USRSPC
- User space
- object-name
- A character or graphic string expression that identifies the system name of the object, system-level environment variable, or system value. When the object-type is *SECATR, object-name must be omitted. In all other cases, object-name is required.
- apply-state
- A character or graphic string expression that indicates the replication criteria rules to use
for evaluating the inclusion state for the object.
- ACTIVE
- Only consider active replication criteria rules. This is the default.
- PENDING
- Consider active replication criteria rules and any pending replication criteria rules with a label of apply-label.
- apply-label
- A character or graphic string expression that identifies a label for the pending replication criteria rules to be considered.
The result of the function is a table containing rows with the format shown in the following table. All columns are nullable.
Column Name | Data Type | Description |
---|---|---|
RULE_IDENTIFIER | BIGINT | A system-assigned value that identifies this RCL rule. Identical
rules can exist with RULE_SOURCE values of SYSTEM and
USER. These will have the same rule identifier. Contains the null value if INCLUSION_STATE is INELIGIBLE or RESTRICTED. |
APPLY_STATE | VARCHAR(14) | The state of the replication criteria rule in the RCL.
|
INCLUSION_STATE | VARCHAR(10) | The replication inclusion state for this rule in the RCL.
Contains the null value when APPLY_STATE is PENDING REMOVE. |
PRECEDENCE_ORDER | SMALLINT | Indicates the order, in ascending sequence, in which this rule
would be applied for the specified object. If the rule with precedence order of 1 is removed from
the RCL, the rule numbered 2 would be used for replicating the object. Identical rules can exist
with RULE_SOURCE values of SYSTEM and USER . These
will have the same precedence order. |
APPLY_LABEL | VARCHAR(26) | The apply-label assigned to a pending rule. All pending
rules with the same label will be applied as a group. Contains the null value if
|
IASP_NAME | VARCHAR(10) | Name of the independent ASP group associated with the replication
criteria rule. Contains either the name of the ASP group or the following special value:
|
LIBRARY_NAME | VARCHAR(10) | Name of the library associated with the replication criteria
rule. Contains the null value if this replication criteria rule does not use the library name in its definition. |
OBJECT_TYPE | VARCHAR(8) | Object type associated with the replication criteria rule.
Contains the null value if this replication criteria rule does not use the object type in its definition. |
OBJECT_NAME | VARCHAR(128) | System name of the object, system-level environment variable, or
system value associated with the replication criteria rule. Contains the null value if this replication criteria rule does not use the object name in its definition. |
RULE_SOURCE | VARCHAR(6) | Indicates the source of this replication criteria rule.
|
REMOVABLE | VARCHAR(3) | Indicates whether this replication criteria rule can be removed
by using the QSYS2.REMOVE_REPLICATION_CRITERIA procedure.
|
RESTRICTED | VARCHAR(3) | Indicates whether this replication criteria rule restricts the
addition of other rules. A value of YES can only occur when
RULE_SOURCE is SYSTEM .
|
Examples
- List all the active replication criteria rules that are used to determine the inclusion state
for table MYTABLE in library APPLIB1.
SELECT * FROM TABLE(QSYS2.INSPECT_REPLICATION_CRITERIA( IASP_NAME => '*SYSBAS', LIBRARY_NAME => 'APPLIB1', OBJECT_TYPE => '*FILE', OBJECT_NAME => 'MYTABLE')) ORDER BY PRECEDENCE_ORDER;
- Determine whether there is a RESTRICTED attribute that would prevent the addition of a new rule
for the QPFRADJ system
value.
SELECT DISTINCT PRECEDENCE_ORDER AS ORDER, IASP_NAME AS IASP, LIBRARY_NAME AS LIBRARY, OBJECT_TYPE AS TYPE, OBJECT_NAME AS NAME, RESTRICTED, REMOVABLE FROM TABLE(QSYS2.INSPECT_REPLICATION_CRITERIA( IASP_NAME => '*SYSBAS', LIBRARY_NAME => 'QSYS', OBJECT_TYPE => '*SYSVAL', OBJECT_NAME => 'QPFRADJ')) ORDER BY PRECEDENCE_ORDER ;
The rows that are returned contain the following information.
A row specific to the QPFRADJ system value was not returned. The first row indicates that adding system values in QSYS is not restricted. Since the first row matches the object type you want to add and it is not restricted, a new rule for QPFRADJ would be allowed.ORDER IASP LIBRARY TYPE NAME RESTRICTED REMOVABLE 1 *SYSBAS QSYS *SYSVAL (null) NO NO 2 *SYSBAS QSYS (null) (null) YES NO 3 *SYSBAS (null) (null) (null) NO NO
The second row indicates that you cannot generally add a rule to an object in library QSYS. The third row describes the default inclusion state for SYSBAS.
- Determine whether there is a RESTRICTED attribute that would prevent the addition of a new rule
for the QDATE system
value.
SELECT DISTINCT PRECEDENCE_ORDER AS ORDER, IASP_NAME AS IASP, LIBRARY_NAME AS LIBRARY, OBJECT_TYPE AS TYPE, OBJECT_NAME AS NAME, RESTRICTED, REMOVABLE FROM TABLE(QSYS2.INSPECT_REPLICATION_CRITERIA( IASP_NAME => '*SYSBAS', LIBRARY_NAME => 'QSYS', OBJECT_TYPE => '*SYSVAL', OBJECT_NAME => 'QDATE')) ORDER BY PRECEDENCE_ORDER ;
The rows that are returned contain the following information.
The first row indicates that a specific rule for the QDATE system value already exists. Since the first row exactly matches the system value and the rule is restricted and cannot be removed, a new rule for QDATE or any changes to the existing rule for QDATE would not be allowed.ORDER IASP LIBRARY TYPE NAME RESTRICTED REMOVABLE 1 *SYSBAS QSYS *SYSVAL QDATE YES NO 2 *SYSBAS QSYS *SYSVAL (null) NO NO 3 *SYSBAS QSYS (null) (null) YES NO 4 *SYSBAS (null) (null) (null) NO NO