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 > DB2 > The db2 view problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-01-04, 03:53
chansteve1234 chansteve1234 is offline
Registered User
 
Join Date: Sep 2003
Posts: 27
The db2 view problem

Hi all
I am new to db2. Would any one help me on which view to check which users are connected to db2(just like V$session in oracle), and which view or tool have same function with logminer in oracle?
thx very much
Reply With Quote
  #2 (permalink)  
Old 03-01-04, 03:55
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: The db2 view problem

V$session's equivalent is the command 'db2 list applications show detail'

and AFAIK, there is not equivalent to logminer ..

I have assumed you are asking about db2 on unix

Cheers
Sathyaram

Quote:
Originally posted by chansteve1234
Hi all
I am new to db2. Would any one help me on which view to check which users are connected to db2(just like V$session in oracle), and which view or tool have same function with logminer in oracle?
thx very much
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 03-01-04, 04:06
chansteve1234 chansteve1234 is offline
Registered User
 
Join Date: Sep 2003
Posts: 27
Thx very much.
How can we check the user have issue which SQL statement and at which time ?
I have try syscat.statements. But seems i cant see the text of the SQL statement.
Reply With Quote
  #4 (permalink)  
Old 03-01-04, 04:24
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
That's a bit tricky ...

You will have to use event monitors and/or snapshot monitors ...

SYSCAT.STATEMENTS has one row for each statement in a package ...

HTH
Sathyaram

Quote:
Originally posted by chansteve1234
Thx very much.
How can we check the user have issue which SQL statement and at which time ?
I have try syscat.statements. But seems i cant see the text of the SQL statement.
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #5 (permalink)  
Old 03-02-04, 04:22
chansteve1234 chansteve1234 is offline
Registered User
 
Join Date: Sep 2003
Posts: 27
Thx , I can find the statement in the event monitor.
But, If i want to find specific a user 's statements.(e.g john have issue select * from employee at 6:00), it seems difficult. Cause I only can see the appl_id at connection tag in event monitor. The appl_id may be equal to some strange word like PE833BA.GD80. Can i have a more easy way to find the specific user 's statement??
I know there are "where auth_id clause" for create event monitor clause.
But it seems make the system overhead when we create 200 event monitor for 200 user.(if i have 200 user)
thx very much
Reply With Quote
  #6 (permalink)  
Old 03-02-04, 07:02
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
If your application id starts like AC100384 , it is the hex of ip address ...

AC.10.03.84 - 172.16.3.132 (use you windows calculator in scientific mode)

Sathayram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #7 (permalink)  
Old 03-02-04, 08:17
chansteve1234 chansteve1234 is offline
Registered User
 
Join Date: Sep 2003
Posts: 27
Thx very much.
Thx. The first part is the ip address in hex.
Can we "decrypt" the second part (GD80) also???
Reply With Quote
  #8 (permalink)  
Old 03-02-04, 08:22
chansteve1234 chansteve1234 is offline
Registered User
 
Join Date: Sep 2003
Posts: 27
When I log as db2inst1 at local of server, i found the appl_id local_db2inst1.321fe5tert something like that.
Is the second part (GD80) is auth_id or user name?
Reply With Quote
  #9 (permalink)  
Old 03-02-04, 08:33
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
The first is the ip address, second is the port number and third is the timestamp

Cheers
Sathyaram

Quote:
Originally posted by chansteve1234
When I log as db2inst1 at local of server, i found the appl_id local_db2inst1.321fe5tert something like that.
Is the second part (GD80) is auth_id or user name?
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #10 (permalink)  
Old 03-02-04, 22:24
chansteve1234 chansteve1234 is offline
Registered User
 
Join Date: Sep 2003
Posts: 27
Now i know the ip address and port , Can i know which user issue the SQL statement?
Reply With Quote
  #11 (permalink)  
Old 03-02-04, 22:40
chansteve1234 chansteve1234 is offline
Registered User
 
Join Date: Sep 2003
Posts: 27
First, I try to create 200 event monitor for 200 user using where auth_id clause. But seems there are limit on db2 of maximum of 32 event monitors can be active at a time.

Now i know the ip address and port , Can i know which user issue the SQL statement?
Reply With Quote
  #12 (permalink)  
Old 03-03-04, 01:19
chansteve1234 chansteve1234 is offline
Registered User
 
Join Date: Sep 2003
Posts: 27
The problem seems have been solved. Now we know the appll_id in the event monitor. We can use db2audit to find the binding of appl_id and auth_id.
First start the db2audit : db2audit start
get the information :
db2audit EXTRACTfile <file name> CATEGORY validate Database <dbname>
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