Chat now with support
Chat with Support

SQL Optimizer for DB2 LUW 4.3.1 - User Guide

SQL Optimizer for IBM® DB2® LUW
About SQL Optimizer for IBM DB2 LUW Getting Started Options SQL Scanner SQL Optimizer SQL Formatter SQL Inspector Database Explorer SQL Repository Index Impact Analyzer Index Usage Analyzer User-Defined Temp Table Editor Functions SQL Functions SQL Information and Functions Activity Log
Tutorials About us Copyright

SQL Formatter Tutorial

The SQL Formatter formats SQL statements, verifies syntax, and color-codes variables, invalid field or table names, optimization forces and comments. The use of indenting and highlighting gives SQL statements a standard of formatting that is easy to read.

Formatting a SQL Statement

  1. Click image\B_SQLFormatter.gif.

  2. After entering a SQL statement in the left pane of the window, click image\B_Format.gif.

  3. The formatted SQL statement displays in the right pane of the window. Comments, bind variables, optimizer forces, invalid column or table names, and variables are highlighted in different colors. If there is a syntax error, an error message from DB2 LUW is displayed.


Related Topics

SQL Inspector Tutorial

To open the SQL Inspector window

Click .

To add an Inspector

Click .

After adding an Inspector in the SQL Inspector window, SQL statements and statistics from the monitoring tables are retrieved by executing the Inspect function. The Inspector must first be selected before the inspection can begin. Only one Inspector can be marked at a time.

To start the inspecting process

  1. Select an Inspector job.

  2. Click .

If the start time of the Inspector has not been reached, the SQL Inspector waits until it is time to begin. During and at the end of the inspecting, information is updated on the SQL Inspector window. Inspect terminates automatically once the end time is reached, except for ad-hoc inspecting. The ad-hoc inspecting process has no ending time so it must be terminated manually.

To abort the inspecting

Click .

Note: If you have already executed the Inspect function for an Inspector, re-executing the Inspect function will erase all existing information.


User-Defined Temp Tables Tutorial

When your SQL statement uses a temporary table, you must create a temporary table before you use the SQL statement in several modules. When you exit from the program or connect to another session, all the temporary tables you create are dropped.

Working with Temporary Tables

  1. Click User-Defined Temp Table image\B_UserDefinedTempTable.gif.

  2. On the Creation tab, enter the statements for creating the temp table. You may include DECLARE GLOBAL TEMPORARY TABLE, INSERT, UPDATE, and DELETE statements.

  3. Click Execute.


Related Topics

SQL Repository Tutorial

The SQL Repository stores the SQL statements that are used in the analysis of database performance. These may be SQL statements that you have identified as critical to the performance of your database application.

Adding SQL to the SQL Repository

  1. Click image\B_SQLRepository.gif.

  2. If no SQL exists in the SQL Repository, then the Add SQL window appears automatically. Otherwise, you can open the Add SQL window by clicking image\B_AddSQL.gif button.
  3. In the Add SQL window enter the SQL text in the SQL Information tab. Click OK.

  4. The SQL syntax is checked and the access plan retrieved before adding a new node to the SQL tree view with the SQL name. Each SQL statement added to the SQL Repository contains an access plan, SQL classification type (Simple, Complex or Problematic), and the current connection information (login name, database alias, and schema). The access plan stored with the SQL statement is important as it indicates the current performance of the SQL.


Related Topics

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating