Re: How to get dbspace for a table???
Posted in 1994
Bill Ennis (ennis@ssd.comm.mot.com) wrote: : I am trying to get th dbspace which a table is resident to. Bill, You can do this, but it takes a little manipulation. There are a couple of ways to do it. Maybe easiest is to do a tbcheck -pe report out to a file and then grep the output out of the file. Tbcheck -pe is pretty fast and does not interfere with any of the db operations. No nasty locks or such (for this option anyway). The other way is to look at the tbstat -t output. First, you have to be sure that your table is in use. Secondly, you need to know how to identify the table. This can be done by SELECT hex(partnum) from systables where tabname="YOURTABLENAME". This hex(partnum) corresponds to the physical address in the tbstat -t output. The first digit of physical address or tblnum in this output then corresponds to the dbspace number from the tbstat -d output. (See, I told you the tbcheck -pe was easiest :) I run the tbcheck -pe report out of a cron process in the early morning and massage the data with an awk report that gives me a tablespace usage report that goes off to a file. I then let utilities work against the file all day (I don't need real-time data). Regards Joe k -- --------------------------------------------------------------------------- Joe Lumbley Dallas, Texas Hi, y'all Watch for my INFORMIX DBA Survival Guide from Prentice-Hall/Informix Press ISBN 0-13-124314-4 (12431-3) Due in bookstores October 28, 1994 orders: orders@prenhall.com (515) 284-6761 fax (515) 284-2607 ----------------------------------------------------------------------------