DB2 Visual Explain

21
Visual Explain- Manual

Transcript of DB2 Visual Explain

Page 1: DB2 Visual Explain

Visual Explain- Manual

Page 2: DB2 Visual Explain

Table of Contents

Visual Explain-Induction Manual........................................................................................11.1 Introduction..........................................................................................................31.2 Pre-requisites to run visual explain on the desired database:..............................31.3 Visual Explain Functionalities in brief:...............................................................5

1.3.1 Connecting to the database..........................................................................51.4 Options.................................................................................................................8

1.4.1 Subsystem Option........................................................................................81.4.2 Tools Option..............................................................................................101.4.3 Help Option...............................................................................................19

Page 3: DB2 Visual Explain

1.1 Introduction

Visual Explain for DB2(R) for z/OS(TM) provides graphical depictions of the access plans that DB2 chooses for your SQL queries and statements. Such graphs eliminate the need to manually interpret plan table output. The relationships between database objects, such as tables and indexes, and operations, such as table space scans and sorts, are clearly illustrated in the graphs. You can use this information to tune your queries.

You can also use Visual Explain to generate customized reports on explainable statements, to view subsystem parameters, and to view data from the plan table, the statement table, and the function table.

1.2 Pre-requisites to run visual explain on the desired database:

1. Need to have admin rights to your PC to install visual explain.2. Need to have DB2 Client installed on your system before you actually install

Visual Explain.3. Once the DB2 Client is installed, ADD the database that you need to access to the

list.4. The steps that need to be followed for adding the database are:

Open the client configuration assistant.

Page 4: DB2 Visual Explain

Click on the ADD button and add the required database into the list.For E.g.: Consider that the database DB2AFMR needs to be

added to the list. The steps that need to be followed are:1. In the client configuration assistant screen shown in the above

screen shot, click on the Add button.2. Select the option, manually configure the connection to a

database and click the Next button.3. Select TCP/IP and click the Next button.4. Enter the Host Name – mfbtstmmk1.ess.fmr.com and the Port

Number – 50530 (this is specific to each database) and click the Next button.

5. Enter the database name - DB2AFMR and click the Next button.6. Check the Checkbox, Register this database for ODBC and

select the radio button, ‘As a system data source’ and Click the Next button.

7. Do not enter anything on this screen and click the Next button.8. Click the Finish button and the database will be added to the

list.

Note: For more information on the port number and hostname for a particular Mainframe DB use the link:

http://dbserve.fmr.com/docs/mf/db2Connect_instances.htm

Page 5: DB2 Visual Explain

5. Using the Test button you can check the accessibility to that particular Database.

1.3 Visual Explain Functionalities in brief:

1.3.1 Connecting to the database

1. Select the desired database and click on the Connect button.

2. Enter the TSO userid and password and click on OK.

Page 6: DB2 Visual Explain
Page 7: DB2 Visual Explain

3. The icon under the status tab shows that it is connected by highlighting it in yellow.

Page 8: DB2 Visual Explain

1.4 Options

1.4.1 Subsystem Option

Page 9: DB2 Visual Explain
Page 10: DB2 Visual Explain

1.4.2 Tools Option

Click on the option List static SQL to retrieve the SQL from the backend package

Page 11: DB2 Visual Explain

Now choose Add Package and click on the List All button. This will list package owners. Select the desired package owner and hit the “Add” button.

Desired package owner is added to the list. Now click on OK and wait till the package list is displayed.

Select the desired package and add to the list. If the DBRM name is known, then a select on the same can be made.

Page 12: DB2 Visual Explain
Page 13: DB2 Visual Explain
Page 14: DB2 Visual Explain
Page 15: DB2 Visual Explain
Page 16: DB2 Visual Explain

Click on the Retrieve Statements button to retrieve the SQL’s in this package. On the filter window click Cancel and wait till the SQL’s are retrieved.

Page 17: DB2 Visual Explain

Now select the required SQL and generate the graph access path for analysis.

Page 18: DB2 Visual Explain

Placing the cursor on these boxes will give the details.

Page 19: DB2 Visual Explain

1.4.3 Help Option

Visual Explain has a tutorial that can be used to familiarize oneself with the tool.

Page 20: DB2 Visual Explain