Granting privileges

You can grant (create new) privileges for any of the object types listed on the Manage Db2® Privileges panel.

To grant one or more privileges for an object, you can use any of the following methods:

  • Method 1 (specifying the object using the grant privileges panel):
    1. On the Manage Db2® Privileges panel:
      1. Type the required details (if any) in the Object Identification Criteria section.
      2. Type the appropriate number in the Object Type selection field to select the object type you want, or use the default value, 3 (table).
    2. Type G on the command line.
    3. Press Enter.

      The grant privileges panel for the specified object type is displayed. The panel lists each privilege type, with a corresponding selection entry field, that can apply to the object type.

      On the grant privileges panel:

      1. Select the privileges you want to grant by entering Y or G in the corresponding selection fields.
      2. In the entry field (or fields) provided, specify the name of the object.
      3. In the To entry field, specify the SQLID of the user to whom the privileges are to be granted (the grantee).
      4. Press Enter.
  • Method 2 (specifying the object from a privilege display panel):
    Note: This method only works if there are already privileges for the Db2® object. If not, FM/Db2 issues the message “No rows selected”.
    1. On the Manage Db2® Privileges panel,
      1. Type the required details (if any) in the Object Identification Criteria section.
      2. Type the appropriate number in the Object Type selection field to select the object type you want, or use the default value, 3 (table).
    2. Leave the command line blank.
    3. Press Enter. The privilege display panel for the specified object type is displayed listing the selected objects.
    4. On the privilege display panel, type G in the Cmd field against the object for which you want to grant privileges.
    5. Press Enter. The grant privileges panel for the specified object is displayed.
      Note: If you use this method to navigate to the grant privileges panel for the specified object type, the following details are pre-entered:
      • The existing setting for each privilege type (Y, G, or blank)
      • The name details for the object
      • The SQLID of the user to whom the existing privileges are granted (the grantee)

      On the grant privileges panel:

      1. Select the privileges you want to grant by entering Y or G in the corresponding selection fields.
      2. Press Enter.
  • Method 3 (using the Object List utility):
    1. Use the utility function, Object List (option 3.4), to display a list of the type of objects you want.
    2. On the object list panel for the selected object type, type G in the Cmd field against the object for which you want to grant privileges.
    3. Press Enter.

      The grant privileges panel for the specified object type is displayed (as for Method 1). The panel lists each privilege type, with a corresponding selection entry field, that can apply to the object type.

    4. Follow the remaining steps as for Method 1 (3.a to 3.d)

If the grant privilege processing is successful, FM/Db2 displays a message indicating that the grant ran successfully. Otherwise, a panel is displayed showing the formatted SQL return code.

Related tasks

Related references