Granting privileges on a table
- Create a list of tables that includes the table or tables for which you want to grant privileges. For information, see Generating-lists-in-Catalog-Manager.
In the Cmd (C) column beside the name of the table for which you want to grant privileges, type GRANT (GR) in the following figure. You can specify any number of tables.To grant privileges for every listed table, on the Command line, type GRANT ALL.
DEFF-R -------------------------- TABLE LIST ---------------- ROW 17 OF 1392
Command ===> Scroll ===> CSR
01
CMD will show commands for this list. Type command and press ENTER
Lists: AL CA CD CK CL CO CP C2 DB DS DT FK IC IM IS IX KC KU LK MK MQT MX NP
LIKE %.QZU%
C Table Name Database Tblspace ColsPK Type Rows Pages
----v----1----v----2----v----3----v----4----v----5----v----6----v----7----v----
GRANTZU.QZUT01_DACS03 QZUDAC QZUS03AC 21 1 T 65K 4376
QZU.QZUT01_DACS04 QZUDAC QZUS04AC 21 1 T 65K 21K
QZU.QZUT01_DACS05 QZUDAC QZUS05AC 21 1 T 65K 21K
QZU.QZUT01_DACS06 QZUDAC QZUS06AC 21 1 T 65K 21K
QZU.QZUT01_DACS07 QZUDAC QZUS07AC 21 1 T 65K 21K
QZU.QZUT01_DACS08 QZUDAC QZUS08AC 21 1 T 65K 21K
QZU.QZUT01_DACS09 QZUDAC QZUS09AC 21 1 T 975K 304K
QZU.QZUT01_DA1S01 QZUDA1 QZUS01A1 21 1 T 2036 128
QZU.QZUT01_DA1S02 QZUDA1 QZUS02A1 21 1 T 2036 128
QZU.QZUT01_DA1S03 QZUDA1 QZUS03A1 21 1 T 2036 129
QZU.QZUT01_DA1S04 QZUDA1 QZUS04A1 20 0 T 2007 79
QZU.QZUT01_DA1S05 QZUDA1 QZUS05A1 2 0 T 46K 245
QZU.QZUT01_DB1S01 QZUDB1 QZUS01B1 11 0 T 120K 6150
QZU.QZUT01_DB1S02 QZUDB1 QZUS02B1 11 0 T 120K 750
QZU.QZUT01_DB1S03 QZUDB1 QZUS03B1 11 0 T 120K 3033
QZU.QZUT01_DB1S04 QZUDB1 QZUS04B1 11 0 T 120K 1505Press Enter.The Grant Table Privileges panel is displayed:
DEFF-R Grant Table Privileges 1 to 1 of 1
Command ===> Scroll ===> PAGE
Generate SQL . N
Grant privileges to . . .
AUTHIDs . . . , , , , ,
. . . . . . . , , , ,
ROLEs . . . . , , , ,
With Grant . . N
Table Privileges:
All. . . . . . . . . N Index. . . . . . . . N Select . . . . . . . N
Alter. . . . . . . . N Insert . . . . . . . N Trigger. . . . . . . N
Delete . . . . . . . N References . . . . . N Unload . . . . . . . N
Update . . . . . . . N
Cmd Creator.TBname
-------------------------------------------------------------------------------
QZU.QZUT01_DACS03
******************************* Bottom of data ********************************- Specify the authorization IDs and the roles for which you want the privilege granted:
- To identify the grantees, in the AUTHIDs field, enter a maximum of 10 authorization IDs.
- To identify the roles, in the ROLEs field, enter a maximum of 5 roles.
- In the With Grant field, type Y to enable the grantees to grant their table privileges to other users.
- Specify which table privileges to grant, as follows:
- In the All field, enter Y to grant all of the table privileges listed. If you used the GRANT ALL command on the object list panel, the default value in the All field is Y.
In the Privileges fields, type Y beside the appropriate privileges to grant individual table privileges.
After setting all of the panel values, in the Generate SQL field, type Y and press Enter.The Confirm SQL panel is displayed:
DEFF-R Confirm SQL 1 to 6 of 6
Command ===> Scroll ===> PAGE
Current SQLID. . . . . . . . MVSSXS2
Edit Options . . . . . . . . N Y/N Modify SQL processing options
Edit SQL . . . . . . . . . . N Y/N Edit SQL before executing
Save in SQL table. . . . . . N A/Y/R/N A/Y-Append, R-Replace
Name of saved data. . . . . 20220228_072236
Save in PDS. . . . . . . . . N Y/N Save in PDS
PDS(member) . . . . . . . .
Execute SQL. . . . . . . . . N Remote Db2 . NONE Enter ? for list
------------------------------------- SQL -----------------------------------
GRANT ALL PRIVILEGES
ON TABLE
QZU.QZUT01_DACS03
TO RDACRJ, RDAMRJ, RDASKJ,
ROLE ROLE1
WITH GRANT OPTION ;
******************************* Bottom of data ********************************- On the Confirm SQL panel, you can edit and save the SQL and then execute it:
(Optional) From the Command line, issue the SET sqlid command to change the value of the current SQLID.
- (Optional) In the Edit options field, type Y to modify the default values for the options on the Confirm SQL panel and then press Enter.The Options panel is displayed. In the Edit SQL and Confirm options field, type Y to display the options for the Confirm SQL panel. Press END to return to the Confirm SQL panel.
- (Optional) In the Edit SQL field, type Y to invoke an ISPF edit session to edit the SQL and then press Enter.
- Press END to save the SQL and return to the Confirm SQL panel.
(Optional) In the Save in SQL table field, type A, Y, R, or N to specify whether to save the SQL in the Catalog Manager SQL_Table.
Purpose
Action
Append the SQL to the SQL in the SQL_Table
Enter A
Save the SQL in the SQL_Table
Enter Y
Replace the SQL in the SQL_Table
Enter R
Discard the SQL
Enter N
- (Optional) In the Name of saved SQL field, type a name for the SQL.
- (Optional) In the Save in PDS field, type Y to save the SQL in a member of a partitioned data set (PDS).The saved SQL uses the ID displayed in the Current SQLID field as the object qualifier. If the SQL is not saved, the ID in the Current SQLID is used only to identify DB2 authority.
- (Optional) In the PDS(member) field, type the name of the PDS and member.
(Optional) In the Remote Db2 field, perform one of the following steps to execute the SQL displayed on a different Db2 subsystem:
- Enter a Db2 subsystem ID.
- To select a Db2 subsystem from a list, type ? and then press Enter.
- (Optional) In the Execute SQL field, type Y to execute the SQL displayed on the Confirm SQL panel and then press Enter.The SQL Progress Indicator panel is displayed. The panel automatically refreshes to display the status of the SQL that is being executed.