title: DB2: PLAN_TABLE empty after EXPLAIN
body: <p>I installed IBM - DB2 Express Server Edition and I'm trying to run an EXPLAIN statement on a query.</p>
  
  <p>I already called the following procedure to create the EXPLAIN tables on SYSTOOLS</p>
  
  <pre><code>CALL SYSPROC.SYSINSTALLOBJECTS('EXPLAIN', 'C', 
        null),   null))
  </code></pre>
  
  <p>and created the PLAN_TABLE for my user</p>
  
  <pre><code>    CREATE TABLE PLAN_TABLE
     (QUERYNO             INTEGER        NOT NULL,
      QBLOCKNO            SMALLINT       NOT NULL,
      APPLNAME            CHAR(8)        NOT NULL,
      PROGNAME            VARCHAR(128)   NOT NULL,
      PLANNO              SMALLINT       NOT NULL,
      METHOD              SMALLINT       NOT NULL,
      CREATOR             VARCHAR(128)   NOT NULL,
      TNAME               VARCHAR(128)   NOT NULL,
      TABNO               SMALLINT       NOT NULL,
      ACCESSTYPE          CHAR(2)        NOT NULL,
      MATCHCOLS           SMALLINT       NOT NULL,
      ACCESSCREATOR       VARCHAR(128)   NOT NULL,
      ACCESSNAME          VARCHAR(128)   NOT NULL,
      INDEXONLY           CHAR(1)        NOT NULL,
      SORTN_UNIQ          CHAR(1)        NOT NULL,
      SORTN_JOIN          CHAR(1)        NOT NULL,
      SORTN_ORDERBY       CHAR(1)        NOT NULL,
      SORTN_GROUPBY       CHAR(1)        NOT NULL,
      SORTC_UNIQ          CHAR(1)        NOT NULL,
      SORTC_JOIN          CHAR(1)        NOT NULL,
      SORTC_ORDERBY       CHAR(1)        NOT NULL,
      SORTC_GROUPBY       CHAR(1)        NOT NULL,
      TSLOCKMODE          CHAR(3)        NOT NULL,
      TIMESTAMP           CHAR(16)       NOT NULL,
      REMARKS             VARCHAR(762)   NOT NULL,
      PREFETCH            CHAR(1)        NOT NULL WITH DEFAULT,
      COLUMN_FN_EVAL      CHAR(1)        NOT NULL WITH DEFAULT,
      MIXOPSEQ            SMALLINT       NOT NULL WITH DEFAULT,
      VERSION             VARCHAR(64)    NOT NULL WITH DEFAULT,
      COLLID              VARCHAR(128)   NOT NULL WITH DEFAULT,
      ACCESS_DEGREE       SMALLINT       ,
      ACCESS_PGROUP_ID    SMALLINT       ,
      JOIN_DEGREE         SMALLINT       ,
      JOIN_PGROUP_ID      SMALLINT       ,
      SORTC_PGROUP_ID     SMALLINT       ,
     SORTN_PGROUP_ID     SMALLINT       ,
      PARALLELISM_MODE    CHAR(1)        ,
      MERGE_JOIN_COLS     SMALLINT       ,
      CORRELATION_NAME    VARCHAR(128)   ,
      PAGE_RANGE          CHAR(1)        NOT NULL WITH DEFAULT,
      JOIN_TYPE           CHAR(1)        NOT NULL WITH DEFAULT,
      GROUP_MEMBER        CHAR(8)        NOT NULL WITH DEFAULT,
      IBM_SERVICE_DATA    VARCHAR(254)   FOR BIT DATA NOT NULL WITH DEFAULT,
      WHEN_OPTIMIZE       CHAR(1)        NOT NULL WITH DEFAULT,
      QBLOCK_TYPE         CHAR(6)        NOT NULL WITH DEFAULT,
      BIND_TIME           TIMESTAMP      NOT NULL WITH DEFAULT,
      OPTHINT             VARCHAR(128)   NOT NULL WITH DEFAULT,
      HINT_USED           VARCHAR(128)   NOT NULL WITH DEFAULT,
      PRIMARY_ACCESSTYPE  CHAR(1)        NOT NULL WITH DEFAULT,
      PARENT_QBLOCKNO     SMALLINT       NOT NULL WITH DEFAULT,
      TABLE_TYPE          CHAR(1)        ,
      TABLE_ENCODE        CHAR(1)        NOT NULL WITH DEFAULT,
      TABLE_SCCSID        SMALLINT       NOT NULL WITH DEFAULT,
      TABLE_MCCSID        SMALLINT       NOT NULL WITH DEFAULT,
      TABLE_DCCSID        SMALLINT       NOT NULL WITH DEFAULT,
      ROUTINE_ID          INTEGER        NOT NULL WITH DEFAULT,
      CTEREF              SMALLINT       NOT NULL WITH DEFAULT,
      STMTTOKEN           VARCHAR(240))
  </code></pre>
  
  <p>Then I run the EXPLAIN statement as below (I have also tried EXPLAIN PLAN instead of EXPLAIN ALL)</p>
  
  <pre><code>EXPLAIN ALL SET QUERYNO=1 FOR SELECT * FROM SYSIBM.SYSDUMMY1   
  </code></pre>
  
  <p>I can see the EXPLAIN tables such as EXPLAIN_INSTANCE or EXPLAIN_STATEMENT do get data in them, but the PLAN_TABLE is empty.</p>
  
  <p>Is there something I'm missing here or still need to configure?
  I'm used to doing EXPLAINs in a mainframe environment and my PLAN_TABLE always gets filled up correctly.</p>
  
  <p>Thanks!</p>