If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Flush Package Cache Dynamic - Does not seem to work

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-25-10, 14:41
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Flush Package Cache Dynamic - Does not seem to work

Hi All,

I was trying to flush package cache to purge statements in it. To see if one particular is seen back tomorrow.

But out of 3 statement related to the one table, two were gone whereas the last one did stay.

Why, and is it podssible to to accomplish this.

I am doing following. Did I do something wrong ?

Quote:
db2 flush package cache dynamic
and

Quote:
db2 select substr(stmt_text,1,800) from sysibmadm where ucase(varchar(stmt_text)) like '% CLIENT %'

Regards

DBFinder
Reply With Quote
  #2 (permalink)  
Old 08-25-10, 15:09
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
You cannot flush statements that belong to active connections, I think.
Reply With Quote
  #3 (permalink)  
Old 08-25-10, 15:50
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
I have noticed that after flushing package cache, some statements still show up in a Snapshot for Dynamic SQL. However, that does not mean the actual package is still valid, or that it will not require a fresh compile the next time it is executed.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 08-25-10, 15:51
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Straight from the manual:

Code:
Any cached dynamic SQL statement currently in use will be allowed to continue to exist in the package cache until it is no longer needed by the its current user; the next new user of the same statement will force an implicit prepare of the statement by DB2, and the new user will execute the new version of the cached dynamic SQL statement.
Reply With Quote
  #5 (permalink)  
Old 08-25-10, 16:18
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
But,
I had double checked this before posting. I didnot find any connection related to the statement.

I had this issue long ago, asked on this forum, same replies as now. Ther might me some reason, because in both databases I wanted remove all statements related to CLIENT table to check back tomorrow.

Still curious to find why. Our databases use connection pooling. Maybe something like connections or connection pool.

Regards

DBFinder
Reply With Quote
  #6 (permalink)  
Old 08-25-10, 16:20
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
We at our company do believe that CLIENT table is not used any more. This was to double check before we drop this table. To find if any application refers to this table or not.

Any other way to find this ??

Regards
Reply With Quote
  #7 (permalink)  
Old 08-25-10, 16:45
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
If you are on V9.7 (latest fixpack), you can look at syscat.tables.lastused. There are some caveats though. See the manual:

IBM DB2 9.7 for Linux, UNIX and Windows Information Center

Andy
Reply With Quote
  #8 (permalink)  
Old 08-25-10, 16:49
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
I am on DB2V9.5.5 on Win 2k3
Reply With Quote
  #9 (permalink)  
Old 08-25-10, 16:57
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
You can use the sysibmadm.snaptab to help determine it. You will need to turn on the tables monitor switch and then wait for a while to see what tables are being used.

Andy
Reply With Quote
  #10 (permalink)  
Old 08-25-10, 19:14
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Quote:
Originally Posted by DBFinder View Post
We at our company do believe that CLIENT table is not used any more. This was to double check before we drop this table. To find if any application refers to this table or not.

Any other way to find this ??

Regards

Rename this table and then wait for a week or so and see if an appl team starts complaining. Also, unload the data just in case. I once dropped a table that I thought no one was using and then had to recover it a few months later with no backup available.
Reply With Quote
  #11 (permalink)  
Old 08-25-10, 19:15
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
And you may want to save the DDL for this table as well
Reply With Quote
  #12 (permalink)  
Old 08-25-10, 19:30
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Alright Bella,
I will make sure to follow these steps. Currently, my mamager has asked me to check, I found 3 Sqls using table. These were the sqls that I wanted to erase from dynamic sql cache.

I just noticed that we have table monitoring switch is on. So as ARWinner said I may be able to use snaptab view.

Thanks

DBFinder
Reply With Quote
  #13 (permalink)  
Old 08-25-10, 19:31
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Quote:
Originally Posted by ARWinner View Post
You can use the sysibmadm.snaptab to help determine it. You will need to turn on the tables monitor switch and then wait for a while to see what tables are being used.

Andy

Good thing, I never thought of. Actually I did not believe that I have table monitoring on.

I will try this.
Thanks

DBFinder
Reply With Quote
  #14 (permalink)  
Old 08-25-10, 20:27
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Quote:
Originally Posted by ARWinner View Post
You can use the sysibmadm.snaptab to help determine it. You will need to turn on the tables monitor switch and then wait for a while to see what tables are being used.

Andy
sysibmadm.snaptab provides us rows_read and rows_written for a table.

regards
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On