How does DB2 create an explain table to monitor the SQL Execution Plan?

Source: Internet
Author: User
Tags db2 connect db2 connect to

DB2 does not exist in the explain table of the SQL Execution Plan by default. Therefore, you need to create an explain table as needed during use. How can you create it? In fact, DB2 still provides a variety of methods for you to use. The first method is to use the script EXPLAIN. DDL by default, which is created in the following path of the database by default:

C: \ Program Files (x86) \ IBM \ SQLLIB \ MISC> ls
DB2AutoBackupPolicy. xsd DB2EvmonPkgCache. xsd DB2MonRoutines. xsd DB2SchemaAnnotation. xsl db2adminV8.exe db2uext2. v2
DB2AutoReorgPolicy. xsd DB2EvmonUOW. xsd DB2OptProfile. xsd EXPLAIN. DDL db2audit. ddl wlmevmon. ddl
DB2AutoRunstatsPolicy. xsd DB2MaintenanceWindowPolicy. xsd DB2PolicyLang. xsd db2InstallReg.exe db2ckupgrade.exe
DB2EvmonLocking. xsd DB2MonCommon. xsd DB2RecommendationSchema. xsd db2InstallReg.txt db2hdr.exe

 

Therefore, you only need to connect to the specified database and execute the file to create the explain table,

Db2 connect to sample

Db2-tvf EXPLAIN. DDL

The table can be created successfully. The default table schema is the current user schema.

However, this requires related files, or you can directly create them using the following SP:

Db2 connect to sample

Db2 "call sysproc. SYSINSTALLOBJECTS ('explain ', 'C', NULL, 'db2inst1 ')"

In this way, specify Schmma to create an explain table, and then analyze the SQL Execution Plan.

DB2 database performance adjustment and optimization (1st and 2) PDF

DB2 database performance optimization

DB2 9.7 for Linux 5.4 Installation Steps

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.