Db2 optimization basics open EXPLAIN
As a db2 query plan, EXPLAIN needs to be opened by myself. However, it generally runs db2-tvf EXPLAIN. DDL, but it is wrong to run it many times.
Because it is not in the same directory, there will be errors.
It should be written as follows: db2-tvf "C: \ Program Files (x86) \ IBM \ SQLLIB \ MISC \ EXPLAIN. DDL"
The default directory of EXPLAIN. DDL is in C: \ Program Files (x86) \ IBM \ SQLLIB \ MISC \. If it is not in the same directory, an error occurs.
But sometimes there are still errors. In fact, this sentence executes a lot of SQL statements and creates many tables. If any problem is found, you can delete the corresponding table and index.
Explain "brush: SQL; "> db2 drop TABLE comment drop FUNCTION comment drop INDEX PRT_I1db2 drop INDEX MQT_I2db2 drop INDEX MQT_I1 on comment drop INDEX IDX_I2db2 drop INDEX IDX_I1db2 drop INDEX comment _i1db2 drop INDEX PRD_I1db2 drop INDEX ARG_I1db2 drop INDEX comment drop TABLE ADVISE_TABLEdb2 drop TABLE comment drop TABLE ADVISE_WORKLOADdb2 drop TABLE ADVISE_INDEXdb2 drop TABLE ADVISE_INSTANCE db2 drop TABLE OBJECT_METRICS db2 drop TABLE comment drop TABLE EXPLAIN_STREAMdb2 drop TABLE comment drop TABLE EXPLAIN_OPERATORdb2 drop TABLE EXPLAIN_OBJECTdb2 drop TABLE EXPLAIN_ARGUMENTdb2 drop TABLE EXPLAIN_STATEMENTdb2 drop TABLE EXPLAIN_INSTANCE
Re-create the corresponding table index and view
Db2-tvf "C: \ Program Files (x86) \ IBM \ SQLLIB \ MISC \ EXPLAIN. DDL"> d: \ 22.txt