Excluding objects from the compare process

To be more selective about which objects are included in a comparison, you can specify that certain objects be excluded from the compare process. To do so, you must define an exclude specification.

About this task

An exclude specification is a defined list of objects that Object Comparison Tool is to exclude from the source, target, or both. For example, you might want to use exclude specifications in the following scenarios:

  • Object Comparison Tool does not add source authorizations to the target if the source authorization does not exist at the target. Instead, a warning is issued. If, however, you exclude authorizations from the source, no message is issued.
  • When comparing objects, if an object exists in the target only, the resulting action is to drop the object from the target. However, if the object is excluded, it is not processed and the object is not dropped at the target. The object is retained. The same action occurs with authorizations. During the compare process, when you exclude an authorization, the authorization that already exists at the target is retained.
  • When you use the Db2 Administration Tool GEN function, any authorizations in the exclude specification are excluded from DDL generation.

An exclude specification can include authorizations. You can exclude authorizations independent from the object with which they are associated.

The exclude specification on an object does not cascade to its dependent objects. You must list all objects to exclude. For example, the exclusion of a table does not mean that its dependent objects, such as indexes and views, are also excluded. Any objects to be excluded must be explicitly included in an exclude specification. The exceptions are history tables, schemas, and archive tables:

  • If a temporal table is excluded, its history table is also excluded. If the history table is specified in an exclude specification, both the temporal and history table are excluded.
  • If a schema is excluded, all UDFs, UDTs, procedures, triggers, and sequences that are part of the schema are excluded.
  • When an archive-enabled table is excluded, its corresponding archive table is also excluded. Similarly, if an archive table is excluded, its corresponding archive-enabled table is also excluded.

You can set the duration of an exclude specification. After the date is passed, the exclude specification is eligible for deletion. You can later change an auto-delete date by modifying the exclude specification.

Excluded objects can still be dropped implicitly as a result of a comparison, depending on the setting of the Allow implicit drop of excluded objects field on the Generate Compare Jobs (GOC5) panel. An implicit drop occurs when the action of dropping an object results in the drop of a dependent object. For example, if a comparison results in a table space being dropped at the target, the table, index, and other objects dependent on the table space should also be dropped. If Allow implicit drop of excluded objects is set to YES, excluded objects can be dropped as needed and are re-created according to the target definition. If this option is set to NO, if an excluded object needs to be dropped (perhaps because its parent object was dropped or because its dependent object was dropped), Object Comparison Tool stops processing the compare, and a severe message is issued.

Restriction: You cannot manage exclude specifications when you are analyzing or running a change in Change Management.

Procedure

To exclude objects from a comparison:

  1. Create an exclude specification by using one of the following methods:
  2. Reference the exclude specification when specifying the source or target. See 1. Specifying source objects or 2. Specifying target objects or both.