Connecting Tech Pros Worldwide Help | Site Map

FLUSH PACKAGE CACHE DYNAMIC

  #1  
Old November 11th, 2008, 11:05 AM
Damir
Guest
 
Posts: n/a
Hello!
I have noticed that after (sucessfully) executing the command:
FLUSH PACKAGE CACHE DYNAMIC
the dynamic SQL statement cache is not completely cleared (some of the
dynamic SQL statement elements are not reset).

For example, looking at the dynamic SQL snapshot I see a certain SQL
statement that has been executed a number of times and has read a (big)
number of rows.
Then I execute the "FLUSH PACKAGE CACHE DYNAMIC" command.
Then I execute the same SQL statement one more time.
Now, when I issue another dynamic SQL snapshot I expect for this SQL
statement the number of executions to be one, and the number of rows read to
be equal to the number of rows read by *only* that last statement
invocation.
But this doesn't happen. Instead, the number of executions remains as before
the FLUSH command, increased by one, and the number of rows read is
increased by the number of rows read by the last invocation of the
statement.

Is this the expected result of the FLUSH command?
If so, how can I reset the NUM_EXECUTIONS and ROWS_READ (and to that matter
all other) elements of the dynamic SQL cache?

Regards,
Damir


  #2  
Old November 11th, 2008, 12:35 PM
Patrick Finnegan
Guest
 
Posts: n/a

re: FLUSH PACKAGE CACHE DYNAMIC


On Nov 11, 10:56*am, "Damir" <damirwil...@yahoo.comwrote:
Quote:
* * Hello!
I have noticed that after (sucessfully) executing the command:
* * FLUSH PACKAGE CACHE DYNAMIC
the dynamic SQL statement cache is not completely cleared (some of the
dynamic SQL statement elements are not reset).
>
For example, looking at the dynamic SQL snapshot I see a certain SQL
statement that has been executed a number of times and has read a (big)
number of rows.
Then I execute the "FLUSH PACKAGE CACHE DYNAMIC" command.
Then I execute the same SQL statement one more time.
Now, when I issue another dynamic SQL snapshot I expect for this SQL
statement the number of executions to be one, and the number of rows readto
be equal to the number of rows read by *only* that last statement
invocation.
But this doesn't happen. Instead, the number of executions remains as before
the FLUSH command, increased by one, and the number of rows read is
increased by the number of rows read by the last invocation of the
statement.
>
Is this the expected result of the FLUSH command?
If so, how can I reset the NUM_EXECUTIONS and ROWS_READ (and to that matter
all other) elements of the dynamic SQL cache?
>
Regards,
* * Damir


db2 reset monitor all
db2 connect to yourdb user youruser using password
db2 flush package cache dynamic
db2 connect reset

db2 get snapshot .....................








  #3  
Old November 12th, 2008, 03:05 PM
Damir
Guest
 
Posts: n/a

re: FLUSH PACKAGE CACHE DYNAMIC


You are missing the "db2 connect reset" statement that I specified in
Quote:
the example.
Hmm... supposing that I have a WebSphere Application Server that holds open
(many) connections to the database (that keep executing the aforementioned
queries), and I cannot reset these connections (because it is a production
site), in that case it is impossible to reset the counters?
(in spite of all said, I can reset - for example - the table counters (i.e.
rows read, overflows, etc.) ... but not the dynSQL ones ...)

Regards,
Damir


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: flush package cache dynamic executed from client. Ian answers 0 September 26th, 2008 08:15 PM
Flush package cache for one sql Arun Srinivasan answers 4 February 6th, 2008 08:45 PM
Flushing Dynamic sql cache lekhrajm answers 0 December 14th, 2007 10:27 AM
SQL Functions & the Package cache... Paul Reddin answers 3 November 12th, 2005 06:59 AM