Help with DBMS_STATS.GATHER_TABLE_STATS - Oracle for DB2

Asked

Viewed 109 times

0

I am passing an Oracle protocol for DB2 and I am not able to run on DBMS_STATS account.GATHER_TABLE_STATS :

DBMS_STATS.GATHER_TABLE_STATS ('DMTLDBR','TB_FATO_OBJETIVO',PART_MES_ANT,10, TRUE,'FOR ALL COLUMNS SIZE REPEAT',4,'ALL',TRUE,null,null,null,FALSE);
DBMS_STATS.GATHER_TABLE_STATS('DMTLDBR','TB_FATO_AGR_SEMAN_DATAEXT_CUST',PART_MES_ANT,10, TRUE,'FOR ALL COLUMNS SIZE REPEAT',4,'ALL',TRUE,null,null,null,FALSE);

What I must change for the process to run, I have DBMS error;

Thank you!

1 answer

0

DBMS_STATS is a command package of oracle that does not exist in the db/2.

In your query, you are using DBMS_STATS.GATHER_TABLE_STATS, that the goal is to optimize the query with statistics, so in principle should remove this, the hints performance of a bank are not the same in another bank, it should not work in the same way because the banks behave differently in relation to performance as indices and execution plans (it would be the same with index(..)).

Anyway, the closest command in the db/2 is the RUNSTATS

  • Ricardo, Thanks for your help. RUNSTATS in DB2 it does not recognize. You know what the syntax would look like DBMS_STATS.GATHER_TABLE_STATS ('DMTLDBR','TB_FATO_OBJETIVO',PART_MES_ANT,10, TRUE,'FOR ALL COLUMNS SIZE REPEAT',4,'ALL',TRUE,null,null,null,FALSE); with the RUNSTATS? I’m looking for tutorials but I can’t find anything.

  • do not know well db2 nor the RUNSTATS to help you, I would have to read the documentation and do tests, but as I said, I should first run the query without any hint/enhancement, test, see if the performance is good and maybe not need, if you need to analyze the execution plan and experiment with possible options that leave the query with better performance.

  • Obrigado Ricardo!!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.