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 > Identify Unused tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-09, 02:42
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Identify Unused tables

Hi Experts,


How can we identify unused tables in a database?

How can i find database activities? Is there any log from which i can find the particular user or IP and the task done by that user?

TIA
Reply With Quote
  #2 (permalink)  
Old 12-02-09, 03:13
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #3 (permalink)  
Old 12-02-09, 04:11
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Thanks Rahul but thats not helping me.

I want tables which are not used in a database and also those have no data in it
Reply With Quote
  #4 (permalink)  
Old 12-02-09, 04:26
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
I am sure you would have little problem identifying tables with no data ...

As for unused tables, Rahul's suggestion is for identifying used tables (and unfortunately you put in the effort to find the ununsed tables!) ... You can also use Table event monitor to capture a list of all tables accessed between activation and deactivation of the database.

But there is no gurantee any of these will give the results you want in real life ... How long are you going to monitor the table (un)usage for ... say 1 month ... There may be a table accessed by quartelry job that did not run in your data capture period ...
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #5 (permalink)  
Old 12-02-09, 05:29
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Hi Satya,

Thanks for the reply i have used the same Rahul said to find the used tables but i felt that not correct.

We have created the database 1 year back and i want to know the tables we havent used yet.

Also is there any query to find the tables having no data?
Reply With Quote
  #6 (permalink)  
Old 12-02-09, 06:00
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
There is no way as far as I am aware to identify tables that have never been used ..
What application is this ? - you should be able to get info from the development/architecture team ... well, it is easier said than done I know ..

If you have just done runstats, then card column in sysstat.tables will give you the info .. otherwise, you have to do on a table basis
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #7 (permalink)  
Old 12-02-09, 06:01
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
Quote:
Originally Posted by ratheeshknair View Post
Hi Satya,
Thanks for the reply i have used the same Rahul said to find the used tables but i felt that not correct.
it depends how you interpret the result. for a table not used since last instance recycle the scans/upsate/ins/del values will be tending towards 0
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #8 (permalink)  
Old 12-02-09, 07:37
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Reply With Quote
  #9 (permalink)  
Old 12-02-09, 07:52
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Thanks Bella ...
Good to know .. I thought indexes were the only ones in-scope for LASTUSED



Quote:
Originally Posted by db2girl View Post
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
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