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 > Informix > Dynamic identification of Informix temp tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-26-03, 19:28
ddodgeaz ddodgeaz is offline
Registered User
 
Join Date: Jan 2003
Location: Arizona, USA
Posts: 8
Dynamic identification of Informix temp tables

I would like to develop a process which can determine if there were temp tables created during my current database connection. I am the system architect for a very large application which establishes a database connection at user startup, and that connection persists while the user navigates from screen to screen. We have a problem with too many concurrent database connections and would like to reduce the number of active connections by disconnecting after a fixed period of inactivity. However, there are processes in this application which retain data in temp tables for use within the same connection by other screens or processes.

If I can dynamically determine what temp tables exist, and what the column names and datatypes are, we can develop a process which would write these out to the file system and disconnect from the database. At a later point (on request by the user) the system would reestablish a database connection and use the file system to recreate the temp tables. My problem is determining what temp tables exist and the specific structure of those tables.

We operate in a multi IBM AIX RS/6000 environment running Informix 7.31.UD5.

Any ideas?

Dan Dodge
Reply With Quote
  #2 (permalink)  
Old 08-27-03, 11:50
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Re: Dynamic identification of Informix temp tables

Quote:
Originally posted by ddodgeaz
I would like to develop a process which can determine if there were temp tables created during my current database connection. I am the system architect for a very large application which establishes a database connection at user startup, and that connection persists while the user navigates from screen to screen. We have a problem with too many concurrent database connections and would like to reduce the number of active connections by disconnecting after a fixed period of inactivity. However, there are processes in this application which retain data in temp tables for use within the same connection by other screens or processes.

If I can dynamically determine what temp tables exist, and what the column names and datatypes are, we can develop a process which would write these out to the file system and disconnect from the database. At a later point (on request by the user) the system would reestablish a database connection and use the file system to recreate the temp tables. My problem is determining what temp tables exist and the specific structure of those tables.

We operate in a multi IBM AIX RS/6000 environment running Informix 7.31.UD5.

Any ideas?

Dan Dodge
Hello Dan,

I have the script in Unix maybe serves to yuo, this is

{
dbaccess sysmaster 2>/dev/null << EOF
SELECT trim(n.dbsname) type,
trim(n.owner) users,
trim(n.tabname) table,
trim(dbinfo('DBSPACE', i.ti_partnum)) dbspace,
round(i.ti_nptotal*4,0) kb -- 4 for AIX, 2 for HP-UX
FROM systabnames n, systabinfo i
WHERE (bitval(i.ti_flags, 32) = 1
OR bitval(i.ti_flags, 64) = 1
OR bitval(i.ti_flags, 128) = 1)
AND i.ti_partnum = n.partnum
into temp ggtmp with no log;
SELECT type[1,12], users, table, dbspace[1,12], kb
from ggtmp
order by 1,2,3,4
EOF
} |more

Gustavo.
Reply With Quote
  #3 (permalink)  
Old 08-28-03, 14:46
ddodgeaz ddodgeaz is offline
Registered User
 
Join Date: Jan 2003
Location: Arizona, USA
Posts: 8
Re: Dynamic identification of Informix temp tables

Quote:
Originally posted by gurey
Hello Dan,

I have the script in Unix maybe serves to yuo, this is

{
dbaccess sysmaster 2>/dev/null << EOF
SELECT trim(n.dbsname) type,
trim(n.owner) users,
trim(n.tabname) table,
trim(dbinfo('DBSPACE', i.ti_partnum)) dbspace,
round(i.ti_nptotal*4,0) kb -- 4 for AIX, 2 for HP-UX
FROM systabnames n, systabinfo i
WHERE (bitval(i.ti_flags, 32) = 1
OR bitval(i.ti_flags, 64) = 1
OR bitval(i.ti_flags, 128) = 1)
AND i.ti_partnum = n.partnum
into temp ggtmp with no log;
SELECT type[1,12], users, table, dbspace[1,12], kb
from ggtmp
order by 1,2,3,4
EOF
} |more

Gustavo.

THANK YOU Gustavo. I tried the query and it works great! This will satisfy my most important requirement.

Do you know where I can find the documentation for the systabinfo table, expecially the bit flag values? I found the systabnames documented in Chapter 34 of the Administrator's Guide, but no documentation for the systabinfo table.

Dan
Reply With Quote
  #4 (permalink)  
Old 08-29-03, 08:42
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Re: Dynamic identification of Informix temp tables

Quote:
Originally posted by ddodgeaz
THANK YOU Gustavo. I tried the query and it works great! This will satisfy my most important requirement.

Do you know where I can find the documentation for the systabinfo table, expecially the bit flag values? I found the systabnames documented in Chapter 34 of the Administrator's Guide, but no documentation for the systabinfo table.

Dan
Hi, DAN

Congratulation !!!

The information to all tables of sysmaster this in $INFORMIXDIR/etc/sysmaster.sql.

a hug !!!

Gustavo.
Reply With Quote
  #5 (permalink)  
Old 08-29-03, 17:34
ddodgeaz ddodgeaz is offline
Registered User
 
Join Date: Jan 2003
Location: Arizona, USA
Posts: 8
Re: Dynamic identification of Informix temp tables

Gustavo,

Thank you for your time and assistance. The information is very helpful.

Dan Dodge
Arizona, USA
Reply With Quote
  #6 (permalink)  
Old 01-21-09, 16:08
sentientmachine sentientmachine is offline
Registered User
 
Join Date: Jan 2009
Posts: 1
Run this Informix SQL to see temporary tables:

SELECT partnum, dbsname, owner, tabname, dbinfo('UTC_TO_DATETIME',ti_created) created, ti_nrows
from sysmaster:systabnames s,sysmaster:systabinfo i
where i.ti_partnum = s.partnum
and sysmaster:BITVAL(i.ti_flags,'0x0020') = 1
and owner !="informix"
order by created asc
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