473,769 Members | 4,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2187
On Sep 1, 4:09*am, "stefan.alb ert" <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.alb ert" <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.alb ert" <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
2365
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 application at the same time. Today, we are using a permanent DB2 table and getting all kinds of locking even with row level locking on. In addition, our performance is slow as we do two inserts and two deletes on each row per program iteration. ...
2
1555
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 are not taken into account for the following select. select * from DGTT where ....
2
3373
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 when the session ends Update activity on this table is going to be pretty intense, and the transient nature of the data makes it a good candidate for a temporary and/or in-memory table.
0
1582
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 temporary table that he uses to put the input parms into and then uses it to join against to create a dataset. When he runs explain (both visual explain, and CA's explain) it chokes on the SESSION.TABLE saying that it doesn't exist. Is there...
3
9552
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 stored procedure, then I can't create a second stored procedure that uses the DGTT, as the DGTT is not "visible". The only way around this is to use dynamic SQL in the second stored procedure. In this way (using dynamic sql) i can create and use the...
0
1534
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 static SQL statements that referenced the temp tables are incrementally bound at run time (SQL Reference volume 2). Should one be worried about these incremental bind? Will these binds update DB2 Catalog tables? How long with the bind take place? and...
0
2686
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 (DB2). So I used the following SQL: DECLARE GLOBAL TEMPORARY TABLE SESSION.SG_ADVICE (ID DECIMAL(11,0), ZAEHLER INTEGER) ON COMMIT PRESERVE ROWS ;
1
3044
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 insert values in to it? Can we fetch multiple rows from that GTT and return it from DB2(Note: My stored procedure is created in DB2)? Please help me out ...
0
1216
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 db2pd . Please explain .Thx in advance.
0
9590
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9424
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10051
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.