In the last episode (Jun 03), Ana Leite said:
> I'm new to MySQL and I'm trying to write a program that among other
> things monitors database usage. I would like to write an SQL query to
> retrieve info like session id, user name, cpu usage. Is there any
> MySQL system tables that gives me this sort of information?
>  
> To be more precise, I'm trying to get the MySQL equivalent of the
> following Oracle SQL:
>  
> select 
>    sesstat.sid as sid, 
>    sess.username user, 
>    sess.status as status, 
>    sess.program as program, 
>    aud.name as command, 
>    sesstat.value / 100 as cpu, 

Try "SHOW PROCESSLIST".  that will get you all the above info except
CPU usage.  You can't get that, since MySQL uses threads and getrusage
only gives you the process total.  Oracle creates a separate process
for each connection, which is why it can give you CPU.

-- 
        Dan Nelson
        [EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to