Controlling data definition by object name

You can register object names in the object registration table (ORT) as a way to control data definition. You need to control data definition by object names if you want all objects in the subsystem to be registered and if you want some applications to control specific sets of objects.

About this task

When you control data definition by object name, all objects are registered regardless of whether they are controlled by specific applications.

Procedure

To control data definition by object name:

  1. Choose not to control all applications. On the DSNTIPZ installation panel, specify the following value for option 2:
    2 CONTROL ALL APPLICATIONS ===> NO
    When you specify NO, you allow unregistered applications to use data definition statements on some objects.
  2. On the DSNTIPZ installation panel, complete option 4 as follows:
    4 UNREGISTERED DDL DEFAULT ===> REJECT
    When you specify REJECT for option 4, you totally restrict the use of data definition statements for objects that are not registered in the ORT. Therefore, no application can use data definition statements for any unregistered object.
  3. In the ORT, register all of the objects in the subsystem, and enter Y in the APPLMATCHREQ column. You must supply values for the QUALIFIER, NAME, TYPE, APPLMATCHREQ, APPLIDENT, and APPLIDENTTYPE columns of the ORT. You can enter information in other columns of the ORT for your own use.
  4. In the ART, register any plan or package collection that can use a set of objects that you register in the ORT with an incomplete name. Enter the value Y in the QUALIFIEROK column. These plans or package collections can use data definition language on sets of objects regardless of whether a set of objects has a value of Y in the APPLMATCHREQ column.

Example

The following table shows entries in the ORT for a Db2 subsystem that contains the following objects that are controlled by object name:
  • Two storage groups (STOG1 and STOG2) and a database (DATB1) that are not controlled by a specific application. These objects can be created, altered, or dropped by a user with the appropriate authority by using any application, such as SPUFI or QMF.
  • Two table spaces (TBSP1 and TBSP2) that are not controlled by a specific application. Their names are qualified by the name of the database in which they reside (DATB1).
  • Three objects (OBJ1, OBJ2, and OBJ3) whose names are qualified by the authorization IDs of their owners. Those objects might be tables, views, indexes, synonyms, or aliases. Data definition statements for OBJ1 and OBJ2 can be issued only through the application plan named PLANX. Data definition statements for OBJ3 can be issued only through the package collection named PACKX.
  • Objects that match the qualifier pattern E%D and the name OBJ4 can be created, altered, or deleted by application plan SPUFI. For example, the objects EDWARD.OBJ4, ED.OBJ4, and EBHARD.OBJ4, can be created, altered, or deleted by application plan SPUFI. Entry E%D in the QUALIFIER column represents all three objects.
  • Objects with names that begin with TRULY.MY_, where the underscore character is actually part of the name. Assuming that you specify # as the escape character, all of the objects with this name pattern can be created, altered, or dropped only by plans with names that begin with TRULY.
Table 1. Table DSN_REGISTER_OBJT for total control by object
QUALIFIER NAME TYPE APPLMATCHREQ APPLIDENT APPLIDENTTYPE
  STOG1 S N    
  STOG2 S N    
  DATB1 D N    
DATB1 TBSP1 T N    
DATB1 TBSP2 T N    
KIM OBJ1 C Y PLANX P
FENG OBJ2 C Y PLANX P
QUENTIN OBJ3 C Y PACKX C
E%D OBJ4 C Y SPUFI P
TRULY MY#_% C Y TRULY% P

Assume the following installation option:

3 REQUIRE FULL NAMES       ===> YES

The entries do not specify incomplete names. Hence, objects that are not represented in the table cannot be created in the subsystem, except by an ID with installation SYSADM authority.