Displaying global variables and their authorizations
Global variables enable you to share relational data between SQL statements without the need for application logic to support the data transfer. Information about global variables is stored in the SYSVARIABLES catalog table.
Procedure
- On the DB2 Administration Menu (ADB2) panel, specify option 1, and press Enter.
-
On the System Catalog (ADB21) panel, specify option GV, and press Enter.
The Global Variables (ADBP1GV) panel is displayed, as shown in the following figure:
Figure 1. Global Variables (ADBP1GV) panel ADBP1GV n ---------------- DD1A Global Variables ----------------- Row 1 of 74 Command ===> ________________________________________________ Scroll ===> PAGE Line commands: I - Interpretation A - Auth GEN - Generate DDL DDL - Object DDL CRE - Create COM - Comment ALT - Alter DROP - Drop DO - Dependent objects ? - Show all line commands Data Max Select Schema Name Type Length Scale Default Text * * * * * * ------ -------- ------------------ -------- <----- ------ --------------------> ______ RIP INT INTEGER 4 0 ______ RIP CH1 CHAR 1 0 ______ ULVEMAN INT INTEGER 4 0 ______ ULVEMAN CH1 CHAR 1 0 ______ ULVEMAN TUJCHAR CHAR 10 0 '1111111111' ______ ULVEMAN TUJINT INTEGER 4 0 121 ______ ULVEMAN TUJCH12DCD CHAR 4 0 CURRENT DEGREE ______ ULVEMAN TUJDEC52 DECIMAL 5 2 ______ ULVEMAN TUJFLOAT FLOAT 8 0 ______ ULVEMAN TUJTS0 TIMESTMP 7 0 ______ ULVEMAN TUJTS2 TIMESTMP 8 2 ______ ULVEMAN TUJTS6 TIMESTMP 10 6 ______ ULVEMAN TUJTS12 TIMESTMP 13 12 ______ ULVEMAN TUJTZ12 TIMESTZ 15 12 ______ ULVEMAN TUJLVCH VARCHAR 32704 0 ______ ULVEMAN TTJTS6 TIMESTMP 10 6 CURRENT TIMESTAMP ______ ULVEMAN TUJDATE DATE 4 0 ______ ULVEMAN TUJTIME TIME 3 0 ______ ULVEMAN TUJCH12 CHAR 12 0 CURRENT DATE ______ ULVEMAN TUJDATEDCD DATE 4 0 CURRENT DEGREE ______ ULVEMAN TUJVCH128DCS VARCHAR 128 0 CURRENT SQLID ______ ULVEMAN TUJVCH128DUSER VARCHAR 128 0 USER ______ ULVEMAN TUJVCH8DCAC CHAR 8 0 CURRENT APPLICATION C ______ ULVEMAN TUJVCH8DCMTTFO CHAR 8 0 CURRENT MAINTAINED TA ______ S29168 SMI SMALLINT 2 0 ______ S29168 BI BIGINT 8 0 ______ S29168 INT INTEGER 4 0 ______ S29168 REAL FLOAT 4 0 ______ S29168 DOUBLE FLOAT 8 0 ______ S29168 DATE DATE 4 0 ______ S29168 TIME TIME 3 0 ______ S29168 CHAR_FBD CHAR 8 0 ______ S29168 VCH VARCHAR 8 0
The following fields are displayed on this panel:
- Schema
- The schema of the global variable.
- Name
- The name of the global variable.
- Data Type
- The name of the data type.
- Max Length
- The maximum length of the global variable.
- Scale
- The scale of the global variable.
- Default Text
- The text of the default value of the global variable.
If the text is truncated, type EXPAND on the primary command line, position the cursor on the default text field, and press Enter to display all of the text.
-
Issue the I line command next to the global variable about which you
want more information, and press Enter.
The Interpretation of an Object in SYSVARIABLES (ADBP1GVI) panel is displayed, as shown in the following figure:
Figure 2. Interpretation of an Object in SYSVARIABLES (ADBP1GVI) panel ADBP1GVI ------- DD1A Interpretation of an Object in SYSVARIABLES ------ 15:57 Command ===> Details for global variable : MARLINO.PJGVARRWDEF Schema . . : SYSADM Name . . . . : PJGVARRWDEF Owner . . . : SYSADM Ownertype . . : Auth ID Identifier . . . . . . : 47 Type schema . . . . . . : SYSADM Type name . . . . . . . : PJARRTY1 Maximum length . . . . : 0 - Array type variable Scale . . . . . . . . . : 0 Default value . . . . . : N Default text . . . . . : NULL DB2 release created . . : Q - Unrecognized Date/time of creation . : 2015-12-17-15.55.57.085723 Source type ID . . . . : 900 - Variable is based on this type CCSID . . . . . . . . . : 0 - Not applicable Row ID for LOBs . . . . : 3ACC72308C00B651E81401681DA00100000000000316 Environment ID . . . . : 15 Remarks . . . . . . . . :The following fields are displayed on this panel:
- Schema
- The schema of the global variable.
- Name
- The name of the global variable.
- Owner
- The authorization ID of the owner of the global variable.
- Ownertype
- The type of owner:
- L
- The owner is a role.
- blank
- The owner is an authorization ID.
- Type schema
- The schema name of the data type. For built-in data types, this value is SYSIBM.
- Type name
- The unqualified name of the data type.
- Maximum length
- The maximum length of the global variable.
- Scale
- The scale of the global variable.
- Default text
- The text of the default value of the global variable.
If the text is truncated, type EXPAND on the primary command line, position the cursor on the default text field, and press Enter to display all of the text.
- Identifier
- The identifier of the global variable.
- DB2® release created
- The release of Db2® that was used to create the object.
- Date/time of creation
- The date and time that the global variable was created.
- Source type
- The source type:
- 0
- A built-in data type.
- internal_ID
- A distinct type.
- CCSID
- The CCSID of the global variable. The CCSID encoding scheme and character set.
- Default clause
- The default clause that is specified for the global variable.
- Row ID for LOBs
- The row ID values for the LOB columns in the SYSVARIABLES table.
- Internal environment
- The internal environment identifier.
- IBM® required
- The origin of the row:
- Y
- The row came from the basic machine-readable material (MRM) tape.
- N
- The row did not come from the basic machine-readable material (MRM) tape.
Displaying global variable authorizations
You can display information about the users who grant privileges to global variables, and information about the users who hold the privileges. You can also display information about any plans that use the privileges.
About this task
Procedure
-
On the System Catalog (ADB21) panel, specify option AO, and press Enter.
Authorization options are displayed on the System Catalog (ADB21) panel - Authorization options, as shown in the following figure.
Figure 3. System Catalog (ADB21) panel - Authorization options ADB21 min ---------- DD1A System Catalog - Authorizations --------------- 12:16 Option ===> DB2 System: DD1A OO - Display Object options DB2 SQL ID: ADM001 Authorization options: GA - Storage group auths PA - Plan authorizations DA - Database authorizations LA - Collection authorizations SA - Table space authorizations KA - Package authorizations TA - Table authorizations HA - Schema authorizations VA - View authorizations EA - User defined data type authorization CA - Column authorizations FA - Function authorizations ZA - System authorizations OA - Stored procedure authorizations UA - User authorizations QA - Sequence authorizations RA - Resource authorizations TR - Trusted contexts RO - Roles PM - Permissions CM - Column masks GVA - Global variable authorizations Enter standard selection criteria: Settings: '=' operator; Criteria not saved. Name . . . . > Grantor . . . > Schema . . . > Grantee . . . > Owner . . . . > In DB/Coll . > Switch Catalog Copy . . N (N/S/C) And/or other selection criteria (option xC shows you columns for option x) Column . . . > Oper . . Value . .
-
Specify option GVA, and press Enter.
The Global Variable Authorizations (ADBPAGV) panel is displayed, as shown in the following figure:
Figure 4. Global Variable Authorizations (ADBPAGV) panel ADBPAGV n ----------- DD1A Global Variable Authorizations ---- Row 1 to 3 of 3 Command ===> Scroll ===> CSR Commands: GRANT REVOKE RMIMPL Line commands: GR - Grant R - Revoke I - Interpret GV - Global Variable W ? - Show all line commands R R E I G H A T Select Grantor Grantee T Schema Name G Timestamp D E * * * * * * * * * ------ -------- -------- - -------> ----------------- - ---------> - - SYSADM PUBLIC SYSIBM CLIENT_IPADDR 2012-12-21 Y SYSADM PUBLIC SYSIBMAD GET_ARCHIVE 2012-12-21 Y SYSADM PUBLIC SYSIBMAD MOVE_TO_ARCHIVE 2012-12-21 Y ******************************* END OF DB2 DATA *******************************The following fields are displayed on this panel:
- Grantor
- The authorization ID of the user who granted the privilege.
- Grantee
- The authorization ID of the user who holds the privilege or the name of the plan that uses the privilege.
- GT
- Grantee type, which can be one of the following values:
- blank
- An authorization ID.
- L
- A role.
- P
- An application package. The grantee is a package if COLLID is not blank.
- Schema
- The schema name of the global variable.
- Name
- The unqualified name of the global variable.
- HG
- The authorization level of the user who granted the privileges:
- blank
- Not applicable.
- E
- SECADM.
- G
- ACCESSCTRL.
- S
- SYSADM.
- T
- DATAACCESS.
- Timestamp
- The time when the GRANT statement was run.
- READ
- The privilege to read the global variable:
- blank
- Not held.
- G
- Read from GRANT.
- Y
- Read without GRANT.
- WRITE
- The privilege to write the global variable:
- blank
- Not held.
- G
- Read from GRANT.
- Y
- Read without GRANT.
-
Issue the I line command for the authorization about which you want more
information, and press Enter.
The Interpretation of Object in SYSVARIABLEAUTH (ADBPAGVI) panel is displayed with the requested authorization information.