04 February 2011

How to know the no of connection to the server?

Postgres
select count(*) from pg_stat_activity--Along with dbname and no of Connections

No of Connections
select count(*) from pg_stat_activity

Sql server

SELECT DB_NAME(dbid) as 'DbNAme', COUNT(dbid) as 'Connections' from master.dbo.sysprocesses with (nolock)
where dbid >0 group by dbid

No comments:

Post a Comment

Friends