Users connected to a database
Posted in 2005
Topics: General Discussion
Hi folks, is there a way to find out which user is connected to which database? For a long time I have used a SQL command that queries several tables (syslocks, sysdatabases and syssessions) to to find out which user uses which database. ut with IDS 10 this didn't work. The syssessions table within sysmaster only shows who is connected, but no way to find out who is using which database. Any suggestions are highly welcome Kind regards Andre
Andre
onstat -g sql
will give you what you want.
Parse the output if you want just the user and db name
esteban.-
--- akoppel <akoppel@akso.de> escribis:
> Hi folks,
> is there a way to find out which user is connected
> to which database? For a
> long time I have used a SQL command that queries
> several tables (syslocks,
> sysdatabases and syssessions) to to find out which
> user uses which database.
> ut with IDS 10 this didn't work. The syssessions
> table within sysmaster only
> shows who is connected, but no way to find out who
> is using which database.
> Any suggestions are highly welcome
> Kind regards
> Andre
>
>
___________________________________________________________
1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar
Andre,
You can use followning query show the details required :
select a.sid, a.username, a.uid, a.hostname, a.tty, b.sqc_currdb
from syssessions a, syssqlcurall b
where a.sid=b.sqc_sessionid
and a.connected<>0
This works on XPS 8.32. Try it on your environment.
_______________
Bien ` vous
Manish K Gupta
+60-12-314 9871
On 10/10/05, Esteban Cas.... <estebanc00@yahoo.com.ar> wrote:
>
> Andre
>
> onstat -g sql>
> will give you what you want.
> Parse the output if you want just the user and db name
>
> esteban.-
>
> --- akoppel <akoppel@akso.de> escribis:
>
> > Hi folks,
> > is there a way to find out which user is connected
> > to which database? For a
> > long time I have used a SQL command that queries
> > several tables (syslocks,
> > sysdatabases and syssessions) to to find out which
> > user uses which database.
> > ut with IDS 10 this didn't work. The syssessions
> > table within sysmaster only
> > shows who is connected, but no way to find out who
> > is using which database.
> > Any suggestions are highly welcome
> > Kind regards
> > Andre
> >
> >
>
>
>
>
>
>
>
>
> ___________________________________________________________
> 1GB gratis, Antivirus y Antispam
> Correo Yahoo!, el mejor correo web del mundo
> http://correo.yahoo.com.ar
Related threads
- Posting from the Informix-list
- Migrating from IDS 9.40.UC6 to 11.50.UC3
- Ip for a network session
- questions onstat -g