Create DB2 Customized SQL Result workspace
sushk 1100006DS0 Comments (2) Visits (10179)
DB2 monitoring agent allows you to monitor columns returned by your own SQLs through the Customized SQL feature. If you are new to this feature, then check the blog entry DB2
This blog is to show you how to create a workspace for directly viewing result of a customized SQL.
Viewing the result set (rows returned by SQL) of Customized SQL in TEP:
Once you have defined your custom SQLs (in ITM_
In this example, SQL ID "ten_worst_sqls" is used, which is defined in /opt
The screen print below shows the steps required to access the Customized SQL result workspace.
If you don't need to view the SQL results often, then this default method of accessing Customized SQL Result workspace should suffice. However, if you (as a monitoring team member) or the DBA, need to run some SQLs more frequently, then it is desirable to have a direct view of the result set of such SQLs.
The steps below show how to create a workspace to display the result rows of a custom SQL.
Step 1. Log into TEP and enter workspace admin mode by using Administer Users window as shown in the screen print below:
Step 2. Create a workspace to display the Result Set (rows returned by SQL) of the Custom SQL (using example of SQL ID 'ten_worst_sqls').
2.1 Create a new workspace.
Select the Customized SQLs navigator item for DB2 agent in TEP to bring up Customized SQLs workspace. Select File -> Save Workspace As option to save the workspace as "ten
2.2 Create a query for the Custom SQL ("ten_worst_sqls") Result Set.
Right click the "Customized SQL Definition" table view in "ten
On Properties window, select “Click here to assign a query”, to bring up the Query Editor. Duplicate the Customized SQL Result query (Hint: select the query in the left panel, and then select 'Create Another Query' icon in the query editor). In this example, the duplicate query is named ten_
2.3 Edit the new query (ten
Add the column values SQL ID (=='
Click OK to save. This new query will provide the result of custom SQL ten_worst_sqls in the new workspace.
Select OK to save the new query and title for the table view. Save the workspace ("te
The customized SQL results workspace is now ready.
Just select Customized SQLs navigator item in TEP and right click to see available workspaces, and select ten_
Customize the workspace as needed.
In the screen print below, the columns of the result table view of ten_