User-defined RI



When you use CHECK PLUS to define RI rules outside of the Db2 facilities, be aware that user-defined RI is managed entirely outside of Db2’s facilities for enforcing RI. If you save user-defined RI rules, they are stored in tables in the CHECK PLUS database, not in the Db2 catalog tables. Any user-defined RI rules that are saved in the CHECK PLUS database are automatically used for subsequent utility executions when CHECK DATA runs against table spaces included in those rules.

If you make changes to the data structures that affect the user-defined RI rules, or if you want to change the rules themselves, you must modify the CHECK PLUS RI rules tables by using SQL statements. Alternatively, you can delete rules by using SQL statements and then specify new rules in the CHECK DATA control statements with SAVERULES YES. For definitions of these tables, see CHECK PLUS RI rules tables.

If you have defined RI rules through CHECK PLUS and you then define the same rules through Db2-defined RI, you should delete the rules in the CHECK PLUS RI rules tables. CHECK PLUS issues an error message if it detects duplicate rules definitions.

The CHECKRID values in the Db2 catalog are independent of user-defined RI rules. If you specify the SCOPE PENDING option, CHECK PLUS starts checking the rows for Db2 RI and user-defined RI as indicated by the CHECKRID value.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*