DB2 user query utilization?


 
Thread Tools Search this Thread
Operating Systems AIX DB2 user query utilization?
# 1  
Old 04-09-2013
DB2 user query utilization?

I am new to AIX, but not new to the UNIX world. Recently I got a request to come with some kind of report to do the following: report if user query is using > 70% CPU (within DB2) > 5 minutes. I am by no means a DB2 guru so I do not know how to get that from within it, so I was wondering if there is another way to do it. Any help is appreciated.
# 2  
Old 04-09-2013
I remember one of the DB/2 admins i worked with had a "Query Analyzer" he used to assess the workload a specific query causes - for the database. As far as i have understood it, it is an add-on tool not normally delivered with DB/2 but available on request. How much it tells you in OS terms (like CPU utilization) i don't know, but to the DB guys it was very helpful in optimizing their queries.

Alas, i doubt that it is possible to tie a specific CPU utiilization pattern to a certain query. DB/2 is a "shared-nothing" architecture and even the processes on the same system communicate over RPC-calls. Typically an opened but otherwise idle DB instance has about 1500 ("ps" becomes really really useful when you have a system with several instances, *cough*) processes and i have no idea what these are doing - probably that is confidential information anyways. To identify the one running your query is nigh impossible, i'd suppose.

I hope this helps.

bakunin

/PS: found it: "Visual Explain", accessible from the "Command Center"
# 3  
Old 04-10-2013
Thanks bakunin. I checked for the Command Center on the server and it doesn't appear to be installed and I cannot install anything as my team doesn't have root privileges, although, we do have a back door if needed; which is OK'ed by the business. I also tried the ps approach, but unfortunately, it doesn't yield the necessary information I am looking for.

Last edited by savigabi; 04-10-2013 at 12:32 PM..
# 4  
Old 04-10-2013
Quote:
Originally Posted by savigabi
I checked for the Command Center on the server and it doesn't appear to be installed and I cannot install anything as my team doesn't have root privileges, although, we do have a back door if needed
I wouldn't rely on such tactics, if i were you. If it isn't you at least someone has to have root-privileges and this one can be made responsible to install the software you need - or pass over root privileges to you. If this takes some time, then so be it - if the organization structure is designed in a way that nothing can get done in time than this organization structure has to be changed instead of trying to work around the problem. If the company decides to not pay for the electricity necessary to operate the server you wouldn't bring a battery to work, but make clear that work is impossible. The same principle is applying here: don't rely on backdoors but make sure things are changed in a way that work is possible - officially.

Just my two cents.

bakunin
# 5  
Old 04-16-2013
Thanks for the info bakunin. I am working with the DBAs to determine how this can be done.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

DB2 Query modification to remove duplicate values using LISTAGG function

I am using DB2 v9 and trying to get country values in comma seperated format using below query SELECT distinct LISTAGG(COUNTRIES, ',') WITHIN GROUP(ORDER BY EMPLOYEE) FROM LOCATION ; Output Achieved MEXICO,UNITED STATES,INDIA,JAPAN,UNITED KINGDOM,MEXICO,UNITED STATES The table... (4 Replies)
Discussion started by: Perlbaby
4 Replies

2. Programming

DB2 Query to pick hierarchy values

Dear Team I am using DB2 v9 . I have a condition to check roles based on hierarchies like below example. 1.Ramesh has Roles as "Manager" and "Interviewer" 2.KITS has Roles as "Interviewer" 3.ANAND has Roles as "Manager" and "Interviewer" select * FROM TESTING NAME ... (6 Replies)
Discussion started by: Perlbaby
6 Replies

3. Programming

DB2 Query -Convert multi values from column to rows

Hi Team I am using DB2 artisan tool and struck to handle multi values present in columns that are comma(,) separated. I want to convert those column values in separate rows . For example : Column 1 Column2 Jan,Feb Hold,Sell,Buy Expected Result Column1 ... (3 Replies)
Discussion started by: Perlbaby
3 Replies

4. Shell Programming and Scripting

Db2 query on other host

Hello, i need some help with a script. I made a script, which connect to different hosts to get some informations. But i got now some problems with getting informations of a database (db2) which is on a other host. I tried something like var=$(rsh HOST su - db2adm -c "db2 connect to database;... (2 Replies)
Discussion started by: Cyver
2 Replies

5. Shell Programming and Scripting

Return db2 query value to shell script

Hi, Im new to DB2. I need to connect to DB2 from shell script and return the query output back to shell script variable. this is my code #!/bin/ksh db_name=db db_user=usr db_pwd=pwd db2 <<EOSQL connect to $db_name user $db_user using "$db_pwd" select count(1) from table quit EOSQL ... (3 Replies)
Discussion started by: sup
3 Replies

6. Shell Programming and Scripting

Printing the output of a db2 query on to an unix file

I want to print the output of a db2 query, on to an unix file in a manner that the columns are separated by 'commas'. Please help me out..thanx in advance (1 Reply)
Discussion started by: prasan_ven
1 Replies

7. Shell Programming and Scripting

Need Fix in Exporting a db2 query output

When I use export for sql query in a Script : Select '1',ModHist',count(*) from cc.mdhist; it was exporting the record to a file as: "1" "ModHist" 778201 Here 1 & ModHist are coming in Doublequotes. If I run the above query directly in Unix prompt it was displaying the output as... (1 Reply)
Discussion started by: karumudi7
1 Replies

8. Shell Programming and Scripting

How to put db2 query result into an array in shell script?

Hello, Can someone please advise me how to put the db2 query reult into an array? For example, the query reults are: string A string B string C Then how do I put them into array=string A array=string B ... (2 Replies)
Discussion started by: hanul
2 Replies

9. Shell Programming and Scripting

Db2 query with script

Hi All, I want to connect two tables in DB2 using shell script and then compare the contents of two tables field by field.and i should return on the screen the un matched records .. Could any one please help me in connecting database tables using Unix and retriving data from the same. (1 Reply)
Discussion started by: kanakaraju
1 Replies

10. Shell Programming and Scripting

pad db2 query result to 8 bits

Hi , I am using a db2 query to get the maximum sequence number from a field.Now this value is taking up only 2 places.(i.e its less than 100).It can grow up to 3 places later but me requirement is that when i write it in a text file, it should be padded upto 8 places. Please help (1 Reply)
Discussion started by: lifzgud
1 Replies
Login or Register to Ask a Question