SQL Explorer and Db2 authority requirements
Dynamic Explain requests now use the ADMIN_EXPLAIN_MAINT IBM Db2 stored procedure. This stored procedure can create or update Explain tables to the correct format for the version of Db2 that you are running. It can also create the indexes recommended by IBM on the Explain tables.
Ensure that the ADMIN_EXPLAIN_MAINT stored procedure is installed correctly for successful Explains.
Specifying an Explain user ID for batch Explain
The Batch Explain process uses the Db2 Install SYSADM when the STEPLIB data sets are APF-authorized. Alternatively, you can specify a valid user ID for Batch Explain to use that has the appropriate Db2 authorization for the Explains, such as SYSADM.
To specify an Explain user ID for Batch Explain, follow these steps:
- Copy the members PSSDEFL and #PSSDEFL from the BMCSAMP data set to your own data set.
Modify the EXPUSRID field in your copy of PSSDEFL with a valid user ID that has the required Db2 authorizations. We recommend SYSADM.
- Modify and submit the copy of the #PSSDEFL JCL member to assemble and link the PSSDEFLT module to the UBMCLINK data set.
Installing the ADMIN_EXPLAIN_MAINT stored procedure
Use the following procedure to install the ADMIN_EXPLAIN_MAINT stored procedure:
- Create a JCL startup procedure for the IBM z/OS Workload Manager (WLM) environment (if you do not already have one).
- Set up the IBM stored procedure by using the DSNTESR member from the Db2 DSNSAMP data set as follows:
- Create the following global temporary tables:
- SYSIBM.EXPLAIN_MAINT_SUMMARY
- SYSIBM.EXPLAIN_MAINT_SQL
- SYSIBM.EXPLAIN_MAINT_TB_NOT_UPGRADED
- Define the SYSPROC.ADMIN_EXPLAIN_MAINT stored procedure by specifying your WLM environment and the COLLID for the DSN% packages.
- Issue a GRANT ALL to PUBLIC authority to the global temporary tables.
- Issue a GRANT EXECUTE to PUBLIC authority to the stored procedure.
- Remove the comments from the bind statement.
- Run the bind for the DSNADMEM package.
- Specify the DSNDBRM Db2 library, and perform the bind.
- Create the following global temporary tables:
- Activate the WLM environment.
- Start the stored procedure.
For more information, see the IBM Db2 for z/OS installation documentation.
For information about the authorities you require for Workload Advisor Explains, see Required authorities for Workload Advisor Explains and the Index Advisor feature.