Login Register Actian.com  

Actian Community Forum


Go Back   Actian Community Forums > Ingres Forums > Database General
 

Reply
 
LinkBack Thread Tools Display Modes
Old 2012-02-17   #1 (permalink)
fba
Ingres Community
 
fba's Avatar
 
Join Date: Dec 2009
Location: Belgium/France
Posts: 196
Default Find clients connected through the DA Server

I'm would like to write a script to find the real client associated with JDBC connections.
For local and GCC connections this is the client host. But for sessions connected through the DA Server, the client host is the local server, and the client pid is the DA Server itself.

I could do this for instance by finding with which DA session a DBMS session is associated.
If I connect to the DBMS server with iimonitor, I get the DBMS session id's and if I connect to the DA server with iimonitor I get the DA session id's.
How can I find with which DA session a DBMS session is associated?
Is this information also exposed through IMA?
__________________
Frédéric Barbier
fba is online now   Reply With Quote
Old 2012-02-17   #2 (permalink)
Ingres Community
 
Join Date: Mar 2007
Posts: 82
Default

You could use the netstat utility to find out incoming connections on port 21071 (which is the JDBC / DAS standard port).

On a Windows machine:
netstat | find "21071"

I don't know exact syntax for Linux machines in the moment...

HTH
Gerhard
gerhard.hofmann@planat.de is offline   Reply With Quote
Old 2012-02-17   #3 (permalink)
fba
Ingres Community
 
fba's Avatar
 
Join Date: Dec 2009
Location: Belgium/France
Posts: 196
Default

Quote:
You could use the netstat utility to find out incoming connections on port 21071 (which is the JDBC / DAS standard port).
You can see that information already when you use iimonitor on the DASVR, at least in recent Ingres version. That's not the problem.

What I'm looking for is a way to know from which client the DBMS sessions are coming. Associating the DBMS session ids with the right JDBC session ids would help me out.

I've done some tests, and I'm afraid DASVR information is not exposed through IMA (yet), at least not in Ingres version 9.2.
__________________
Frédéric Barbier
fba is online now   Reply With Quote
Old 2012-02-22   #4 (permalink)
Ingres Corp
 
pickr01's Avatar
 
Join Date: Mar 2007
Location: Germany
Posts: 245
Default

As far as I know the DASSVR doesn't have any knowledge about the DBMS session number - so there is currently no way to figure this out.
Would be really useful though.

Kristoff

Quote:
Originally Posted by fba View Post
You can see that information already when you use iimonitor on the DASVR, at least in recent Ingres version. That's not the problem.

What I'm looking for is a way to know from which client the DBMS sessions are coming. Associating the DBMS session ids with the right JDBC session ids would help me out.

I've done some tests, and I'm afraid DASVR information is not exposed through IMA (yet), at least not in Ingres version 9.2.
pickr01 is offline   Reply With Quote
Old 2012-02-23   #5 (permalink)
Ingres Community
 
maspa05's Avatar
 
Join Date: Mar 2007
Location: UK, Sunny Slough!
Posts: 214
Default

Kristoff's right, there are some IMA classids you can register but that just gives you the same information in IMA you have with iimonitor on the DAS, but there isn't any DBMS session info.
__________________
Paul Mason
maspa05 is online now   Reply With Quote
Old 2012-02-26   #6 (permalink)
fba
Ingres Community
 
fba's Avatar
 
Join Date: Dec 2009
Location: Belgium/France
Posts: 196
Default

Quote:
there are some IMA classids you can register
Paul, could you elaborate a bit on that please?
__________________
Frédéric Barbier
fba is online now   Reply With Quote
Old 2012-02-27   #7 (permalink)
Ingres Community
 
maspa05's Avatar
 
Join Date: Mar 2007
Location: UK, Sunny Slough!
Posts: 214
Default

Are you asking what I mean by registering classids or are you looking for a list of relevant classids?

There's a very good explanation of IMA, classids and how to register tables in the Ingres 10 System Administrators Guide. The 9.2 version is not so good.

Actually I was sure when I tested this the other day that the classids I checked worked in 9.2 but I can't get it to work now, though it does in 10.0.

I tested using this register table:

Code:
register table ima_gcd_connections (
server varchar(64) not null not default is 'SERVER',
connection_id integer4 not null not default is 'exp.gcf.gcd.conn',
dbms integer4 not null not default is 'exp.gcf.gcd.conn.dbms',
client_user varchar(64) not null not default is 'exp.gcf.gcd.conn.client_user',
client_host varchar(64) not null not default is 'exp.gcf.gcd.conn.client_host',
client_addr varchar(64) not null not default is 'exp.gcf.gcd.conn.client_addr'
)
as import from 'tables' with dbms = IMA,
structure = unique sortkeyed,
key = (server, connection_id)
\p\g
I got the classids from looking in the source, see common/hdr/hdr/gcm.h. Unfortunately there's nothing in there that ties the DAS server session to a DBMS session.
__________________
Paul Mason
maspa05 is online now   Reply With Quote

Reply



Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© 2011 Actian Corporation. All Rights Reserved