473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Re: Reg: Owner for Declared Global Temporary tables

Hello Ravi,
what you want to do is very tricky, but possible.
I've had this same problem - we want to identify the top user of
tempspace and eventually force him off when using too much space (FS
runs full).
For temptables (NON-DGTT) you can use db2pd to find the owner (-
tcbstats) here the application handle (agent id) is listed. But this
won't help for DGTTs, because this information isn't given.

--Serge : This would be a nice feature to have... because my
solution only works for SMS!

What you can do is this - quite much work:
When a DGTT is held by an agent, you can get information about it by
sending a signal 36 to the agent process. Then it writes (ascii text)
to a trapfile (name: g[PID].[NODE]) which holds your desired
information: The TID of the DGTT. With this information you can derive
the size from the file object in your SMS-containers. I think with DMS
you can't get this infos...

The g[PID].[NODE] file should be deleted after your work - new text
would be appended, thats not nice to parse (and space is used).
Sep 1 '08 #1
2 2161
On Sep 1, 4:09*am, "stefan.albert" <stefan.alb...@spb.dewrote:
Hello Ravi,
what you want to do is very tricky, but possible.
I've had this same problem - we want to identify the top user of
tempspace and eventually force him off when using too much space (FS
runs full).
For temptables (NON-DGTT) you can use db2pd to find the owner (-
tcbstats) here the application handle (agent id) is listed. But this
won't help for DGTTs, because this information isn't given.

--Serge : This would be a nice feature to have... because my
solution only works for SMS!

What you can do is this - quite much work:
When a DGTT is held by an agent, you can get information about it by
sending a signal 36 to the agent process. Then it writes (ascii text)
to a trapfile (name: g[PID].[NODE]) which holds your desired
information: The TID of the DGTT. With this information you can derive
the size from the file object in your SMS-containers. I think with DMS
you can't get this infos...

The g[PID].[NODE] file should be deleted after your work - new text
would be appended, thats not nice to parse (and space is used).

Can you please send me a sample script. I donot know how to send a
signal to a agent process and what signal 36 will do. Secondly, does
the signal needs to be sent to all the agents connected to the
database, as It is not known which agent has created Global temporary
table.
Thanks
Ravi
Sep 2 '08 #2
On Sep 2, 6:06*pm, Ravi <nissanka.r...@gmail.comwrote:
On Sep 1, 4:09*am, "stefan.albert" <stefan.alb...@spb.dewrote:


Hello Ravi,
what you want to do is very tricky, but possible.
I've had this same problem - we want to identify the top user of
tempspace and eventually force him off when using too much space (FS
runs full).
For temptables (NON-DGTT) you can use db2pd to find the owner (-
tcbstats) here the application handle (agent id) is listed. But this
won't help for DGTTs, because this information isn't given.
--Serge : This would be a nice feature to have... because my
solution only works for SMS!
What you can do is this - quite much work:
When a DGTT is held by an agent, you can get information about it by
sending a signal 36 to the agent process. Then it writes (ascii text)
to a trapfile (name: g[PID].[NODE]) which holds your desired
information: The TID of the DGTT. With this information you can derive
the size from the file object in your SMS-containers. I think with DMS
you can't get this infos...
The g[PID].[NODE] file should be deleted after your work - new text
would be appended, thats not nice to parse (and space is used).

Can you please send me a sample script. I donot know how to send a
signal to a agent process and what signal 36 will do. Secondly, does
the signal needs to be sent to all the agents connected to the
database, as It is not known which agent has created Global temporary
table.
Thanks
Ravi- Hide quoted text -

- Show quoted text -
On Sep 2, 6:06 pm, Ravi <nissanka.r...@gmail.comwrote:
On Sep 1, 4:09 am, "stefan.albert" <stefan.alb...@spb.dewrote:


Hello Ravi,
what you want to do is very tricky, but possible.
I've had this same problem - we want to identify the top user of
tempspace and eventually force him off when using too much space (FS
runs full).
For temptables (NON-DGTT) you can use db2pd to find the owner (-
tcbstats) here the application handle (agent id) is listed. But this
won't help for DGTTs, because this information isn't given.
--Serge : This would be a nice feature to have... because my
solution only works for SMS!
What you can do is this - quite much work:
When a DGTT is held by an agent, you can get information about it by
sending a signal 36 to the agent process. Then it writes (ascii text)
to a trapfile (name: g[PID].[NODE]) which holds your desired
information: The TID of the DGTT. With this information you can derive
the size from the file object in your SMS-containers. I think with DMS
you can't get this infos...
The g[PID].[NODE] file should be deleted after your work - new text
would be appended, thats not nice to parse (and space is used).

Can you please send me a sample script. I donot know how to send a
signal to a agent process and what signal 36 will do. Secondly, does
the signal needs to be sent to all the agents connected to the
database, as It is not known which agent has created Global temporary
table.
Thanks
Ravi- Hide quoted text -

- Show quoted text -
Hello Ravi,

there is no sample script - I've written a perl script to do that - it
is tailored to our environment (SMS only).
Also: I'm not allowed to give away our scripts - thats a company
policy... sorry.

You send signal 36 to an agent with "kill -36 $PID ..." or you can use
"db2pd -db $DBNAME -stack $PID".
This signals the agent to write trapfiles with current status
information to DIAGPATH (dbm cfg).
The PIDs of the agent(s) are listed in a snapshot for application.

For your special problem:
You can make snapshots for all applications and have a look at the
values in "Rows written".
If it is not an Insert/Update and the value is "quite big" this could
be a session which uses much temp (either SYS or USER(=DGTT)). But
this only works for the current SQL - if the DGTT was created by an
older SQL you won't see a reference.
You can only guess with the help of "Rows written" for the whole
Session (the first occurence of "Rows written", the second seems to be
for the current SQL running).
Sep 5 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chuck Crews | last post by:
I am interested in declaring a global temporary table within an application. The application processes 1 set of 600 or less rows each iteration. Multiple programs can and do call this one...
2
by: Jean-Marc Blaise | last post by:
Hi Folks, 1) Why do we have to commit so that statistics are taken into account : Insert into DGTT call ADMIN_CMD ('runstats ...') <<- If we don't commit here, explain plans show that stats...
2
by: David Parker | last post by:
In our application we have a table that tracks network sessions. The usage is: 1) create a session record 2) read/update the record several times during the session 3) delete the session record...
0
by: dataguy | last post by:
I have my developers explaining the stored procedures that they write using visual studio. These stored procedures are for DB2 os390. In one case, one of the developers has defined a global...
3
by: Otto Carl Marte | last post by:
Hi, As I understand it, Declared Global Temporary Tables (DGTTs) have a scope that is session/connection based. Using the same connection, I have discovered that if I declare a DGTT in one...
0
by: Mo Nguyen | last post by:
Hi All, I'm planning to write a stored procedure which will be executed million times a day by many people, and is planning to use Declared Global Temporary Tables. One of the concern: the...
0
by: sgueder | last post by:
Hi there, hope anybody can help me: I want to create a temporary table, want to fill that table with data and finally I want to use that table as my base-table for running some selects on it...
1
by: birundha | last post by:
Hi Hope this will help more peolpe... We got a new design where we use Global temporary tables(GTT) inside stored procedure... My question is can we use GTT inside a stored procedure and...
0
by: thinkpod | last post by:
After running RUNSTATS on Declared global temporary tables,How would I see the collected statistics,As sysstat doesn't store that information. I have little clue abt using db2pd. But I am new to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.