使用DbVisulalizer鏈接db2,查看執行計劃是報錯誤
Explain tables does not exist. Check the explain plan properties for this database connection.
就是執行計劃的表不村子,檢查執行計劃屬性。
查看連接屬性如下
只有DB2LUW裏面纔有Explain Plan屬性,所以先調整Connection屬性中的datatype,爲DB2 LUW:
然後再用,發現還是一樣的錯誤,最後仔細看,才發現有個勾沒有勾上
只有勾上了create plan table if not exists,就是如果計劃表不存在就創建。然後解決問題。
當然我們也可以把下面的Drop Explain Plan Table在執行完成後刪除對應的信息。