Question & Answer
Question
How do I create DB2 Explain tables ?
Answer
The Explain tables capture access plans when the Explain facility is activated. The Explain tables must be created before Explain can be invoked.
You can create Explain tables using one of the two methods -
a)db2 "CALL SYSPROC.SYSINSTALLOBJECTS('EXPLAIN','C',<tablespace_name>,<schema_name>)"
Example:
$ db2 "CALL SYSPROC.SYSINSTALLOBJECTS('EXPLAIN','C','USERSPACE1','db2inst1')"
Return Status = 0
If the schema name is not specified, by default explain tables are created under the SYSTOOLS schema.
b) To create under current schema use -
cd INSTHOME/sqllib/misc (for Windows cd DB2PATH\misc)
db2 CONNECT TO <dbname>
db2 -tvf EXPLAIN.DDL
You can also use the SYSPROC.SYSINSTALLOBJECTS table function to delete the Explain tables:
db2 "CALL SYSPROC.SYSINSTALLOBJECTS('EXPLAIN','D',<tablespace_name>,<schema_name>)"
Example:
$ db2 "CALL SYSPROC.SYSINSTALLOBJECTS('EXPLAIN','D','USERSPACE1','db2inst1')"
Return Status = 0
Related Information
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21685237