16.10.2015 Views

Getting Started with IBM Data Studio for DB2

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7 – Tuning queries ...............................................................................................213<br />

7.1 Query tuning: The big picture...................................................................................213<br />

7.2 Configuring <strong>DB2</strong> to enable query tuning ..................................................................214<br />

7.3 Start tuning ...............................................................................................................219<br />

7.4 Tuning an SQL statement ........................................................................................221<br />

7.4.1 Selecting statements to tune (Capture view).....................................................222<br />

7.4.2 Run the Statistics Advisor and tools (Invoke section) .......................................223<br />

7.4.3 Review the results and recommendations (Review section).............................225<br />

7.4.4 Review the query tuner report ...........................................................................229<br />

7.4.5 Save the analysis results...................................................................................230<br />

7.5 Opening Visual Explain from the SQL editor............................................................232<br />

7.6 Summary ..................................................................................................................235<br />

7.7 Review questions .....................................................................................................236<br />

Chapter 8 – Developing SQL stored procedures...............................................................237<br />

8.1 Stored procedures: The big picture..........................................................................238<br />

8.2 Steps to create a stored procedure..........................................................................238<br />

8.3 Developing a stored procedure: An example...........................................................240<br />

8.3.1 Create a data development project ...................................................................240<br />

8.3.2 Create a stored procedure.................................................................................245<br />

8.3.3 Deploy the stored procedure .............................................................................248<br />

8.3.4 Run the stored procedure..................................................................................251<br />

8.3.5 View the output ..................................................................................................253<br />

8.3.6 Edit the procedure .............................................................................................253<br />

8.3.7 Deploy the stored procedure <strong>for</strong> debugging ......................................................255<br />

8.3.8 Run the stored procedure in debug mode.........................................................255<br />

8.4 Exercises..................................................................................................................261<br />

8.5 Summary ..................................................................................................................261<br />

8.6 Review questions .....................................................................................................262<br />

Chapter 9 – Developing user-defined functions.................................................................265<br />

9.1 User-defined functions: The big picture ...................................................................265<br />

9.2 Creating a user-defined function ..............................................................................266<br />

9.3 Deploy the user-defined function..............................................................................269<br />

9.4 Run the user-defined function ..................................................................................273<br />

9.5 View the output.........................................................................................................274<br />

9.6 Edit the procedure ....................................................................................................275<br />

9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!