Example: Adding an exception via the Boolean logic editor
This example shows how to add an exception condition when using the Boolean logic editor.
For example, the best practice exception profile provided with Db2 Automation Expert called BEST PRACTICE IMAGE COPY FULL comes configured with the following exceptions. These exceptions are designed for triggering a utility (probably a full image copy) if either a REORG, LOAD REPLACE, or RUNSTATS was performed on the object after the last COPY, or if the percentage of inserts, deletes, and updates of the total number of object rows exceeds 25%. The default profile is as follows:
------------------------------------------------------
FOR EACH TABLESPACE OBJECT...
IF (
REALTIME ICOPY REORG_LOAD_STATS EQ
O REALTIME ICOPY COPY_CHANGES_PCT > 25
) TRIGGER OBJECT
ENDIF
FOR EACH INDEX OBJECT...
IF (
REALTIME ICOPY REORG_LOAD_STATS EQ
O REALTIME ICOPY COPY_CHANGES_PCT > 25
) TRIGGER OBJECT
ENDIF
***************************** Bottom of Data *********
For this example, we want to add a condition to trigger a table space object if the conditions above are met, and in addition, no full image copy has been done in the past 30 days. To customize this profile, you can do the following:
- Export the sample profile to a different profile with a different user ID. Make sure to change the Update option to "U" during the export.
- Update the exported profile.
- On the Edit Exceptions Boolean Logic panel, in the table space object section, enter I in the C column next to the last exception condition and press Enter.
A ( C O ) Category---------- Column------------ CC Exception Value- FOR EACH TABLESPACE OBJECT... IF ( REALTIME ICOPY REORG_LOAD_STATS EQ I O REALTIME ICOPY COPY_CHANGES_PCT > 25 ) TRIGGER OBJECT
- On the Select Boolean Logic Exceptions panel, find and expand the Real Time Image Copy related Thresholds...since last COPY group (enter + in the S column).
- Select the DAYS_SINCE_LAST exception by entering S in the Selection area. Enter GT (greater than) for the condition and 30 (indicating 30 days) for the exception value, as follows:
S Statistics Type--- *Column------------ Cond ---------Exception Value--------- REALTIME ICOPY *REBUILD *REORG_OR_LOAD s DAYS_SINCE_LAST GT 30
- Press Enter, then PF3 to accept the changes. The new condition is added by default as an OR with other two conditions.
A ( C O ) Category---------- Column------------ CC Exception Value----------------- FOR EACH TABLESPACE OBJECT... IF ( REALTIME ICOPY REORG_LOAD_STATS EQ O REALTIME ICOPY COPY_CHANGES_PCT > 25 O REALTIME ICOPY DAYS_SINCE_LAST GT 30 ) TRIGGER OBJECT
- To group the exceptions, add blank lines above and below the exception that you want to group by entering L in the C column next to the exceptions in the group.
A ( C O ) Category---------- Column------------ CC Exception Value FOR EACH TABLESPACE OBJECT... IF ( L REALTIME ICOPY REORG_LOAD_STATS EQ L O REALTIME ICOPY COPY_CHANGES_PCT > 25 O REALTIME ICOPY DAYS_SINCE_LAST GT 30 ) TRIGGER OBJECT ENDIF
- Press Enter. The blank lines are added.
A ( C O ) Category---------- Column------------ CC Exception Value- FOR EACH TABLESPACE OBJECT... IF ( REALTIME ICOPY REORG_LOAD_STATS EQ O REALTIME ICOPY COPY_CHANGES_PCT > 25 O REALTIME ICOPY DAYS_SINCE_LAST GT 30 ) TRIGGER OBJECT
- Add a left parenthesis in the ( ) column in the first blank line, and a right parenthesis in the blank line after the second exception to be grouped.
A ( C O ) Category---------- Column------------ CC Exception Value- FOR EACH TABLESPACE OBJECT... IF ( ( REALTIME ICOPY REORG_LOAD_STATS EQ O REALTIME ICOPY COPY_CHANGES_PCT > 25 ) O REALTIME ICOPY DAYS_SINCE_LAST GT 30 ) TRIGGER OBJECT
- Change the O that is next to the DAYS_SINCE_LAST exception to A, and press Enter.
A ( C O ) Category---------- Column------------ CC Exception Value- FOR EACH TABLESPACE OBJECT... IF ( ( REALTIME ICOPY REORG_LOAD_STATS EQ O REALTIME ICOPY COPY_CHANGES_PCT > 25 ) A REALTIME ICOPY DAYS_SINCE_LAST GT 30 ) TRIGGER OBJECT
- Press PF3 to save the profile and exit.
These exception conditions will be evaluated as follows:
IF
(
(REORG, LOAD, or RUNSTATS has been run on the table space since the last
image copy of the table space was taken)
OR
(The number of inserts, deletes, and updates as a percentage of the total
number of rows of the table space is greater than 25%)
)
AND
(It has been more than 30 days since the last image copy was taken of the table space)
THEN
Trigger the utility