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 > Show all open tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-31-11, 10:44
rockycj rockycj is offline
Registered User
 
Join Date: Feb 2007
Posts: 73
Show all open tables

I'm working with DB2 9.1 LUW on AIX 6.1. Is there a way to tell which tables have been left open on a database? For example, if processes are run, opening tables and run against tables in a database with SQL etc. and then the tables are not closed.

I would like to see a listing of these open tables in a database.
Could someone help me out?

Thank you.

CC
Reply With Quote
  #2 (permalink)  
Old 10-31-11, 11:07
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
For the most part, DB2 will try to leave the tables open even if they are not currently being used. This is because it is rather expensive to keep opening and closing the files for the tables. You can user db2top to see what is currently active and open.

Andy
Reply With Quote
  #3 (permalink)  
Old 10-31-11, 13:29
rockycj rockycj is offline
Registered User
 
Join Date: Feb 2007
Posts: 73
Open Remote Cursors

This SQL, gives me the Open remote cursors and lists the Agents...? So this is the only thing I can come up. Any ideas?

select SUBSTR(i.DB_NAME,1,8) AS DB_NAME,
i.AGENT_ID,
SUBSTR(i.APPL_NAME,1,10) AS APPL_NAME,
i.APPL_STATUS ,
a.uow_start_time,
a.uow_stop_time,
a.appl_idle_time,
a.open_loc_curs
from sysibmadm.SNAPAPPL_INFO as i
inner join sysibmadm.SNAPAPPL as a on (i.agent_id = a.agent_id)
AND i.DB_NAME = 'PSFTPROD'
AND i.APPL_NAME like '%RF%'
AND a.OPEN_REM_CURS <> 0 -- open remote cursors


Thanks.

CC
Reply With Quote
  #4 (permalink)  
Old 10-31-11, 14:18
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Apparently I did not understand your question. And I still do not. What are you after exactly. Also state your DB2 version and OS.

Andy
Reply With Quote
  #5 (permalink)  
Old 10-31-11, 16:49
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Why do you need to know this info? From the OS side, you could use lsof command to see which files/containers are open. As Andy mentioned, they can remain open even if not currently being used.
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