pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Monitor what command is executing at the backend
4+ messages / 2 participants
[nested] [flat]

* Monitor what command is executing at the backend
@ 2007-03-21 21:49  Karthikeyan Sundaram <skarthi98@hotmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Karthikeyan Sundaram @ 2007-03-21 21:49 UTC (permalink / raw)
  To: pgsql-admin@postgresql.org; pgsql-sql

Hi everybody,

   Is there a way to see from the log files on what sql statement is 
currently by which user?  In other words, I want to monitor the DB activity.


    How can I find it?

Regards
skarthi

_________________________________________________________________
Get a FREE Web site, company branded e-mail and more from Microsoft Office 
Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [SQL] Monitor what command is executing at the backend
@ 2007-03-21 21:56  George Pavlov <gpavlov@mynewplace.com>
  parent: Karthikeyan Sundaram <skarthi98@hotmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: George Pavlov @ 2007-03-21 21:56 UTC (permalink / raw)
  To: Karthikeyan Sundaram <skarthi98@hotmail.com>; pgsql-admin@postgresql.org; pgsql-sql

>    Is there a way to see from the log files on what sql statement is 
> currently by which user?  In other words, I want to monitor 
> the DB activity.

for a current snapshot you don't need the logs, try:

  select * from pg_stat_activity;

(command string needs to be enabled for your database.)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [SQL] Monitor what command is executing at the backend
@ 2007-03-21 22:16  Karthikeyan Sundaram <skarthi98@hotmail.com>
  parent: George Pavlov <gpavlov@mynewplace.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Karthikeyan Sundaram @ 2007-03-21 22:16 UTC (permalink / raw)
  To: gpavlov@mynewplace.com; pgsql-admin@postgresql.org; pgsql-sql

George,

  How will I enable command string to see the commands?

Regards
skarthi


>From: "George Pavlov" <gpavlov@mynewplace.com>
>To: "Karthikeyan Sundaram" 
><skarthi98@hotmail.com>,<pgsql-admin@postgresql.org>,<pgsql-sql@postgresql.org>
>Subject: Re: [SQL] Monitor what command is executing at the backend
>Date: Wed, 21 Mar 2007 14:56:50 -0700
>
> >    Is there a way to see from the log files on what sql statement is
> > currently by which user?  In other words, I want to monitor
> > the DB activity.
>
>for a current snapshot you don't need the logs, try:
>
>   select * from pg_stat_activity;
>
>(command string needs to be enabled for your database.)
>
>---------------------------(end of broadcast)---------------------------
>TIP 7: You can help support the PostgreSQL project by donating at
>
>                 http://www.postgresql.org/about/donate

_________________________________________________________________
ItÂ’s tax season, make sure to follow these few simple tips 
http://articles.moneycentral.msn.com/Taxes/PreparationTips/PreparationTips.aspx?icid=HMMartagline




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [SQL] Monitor what command is executing at the backend
@ 2007-03-21 22:25  George Pavlov <gpavlov@mynewplace.com>
  parent: Karthikeyan Sundaram <skarthi98@hotmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: George Pavlov @ 2007-03-21 22:25 UTC (permalink / raw)
  To: Karthikeyan Sundaram <skarthi98@hotmail.com>; pgsql-admin@postgresql.org; pgsql-sql

>   How will I enable command string to see the commands?

in your postgresql.conf set stats_command_string = true

read
http://www.postgresql.org/docs/8.2/interactive/monitoring-stats.html for
details



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2007-03-21 22:25 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-03-21 21:49 Monitor what command is executing at the backend Karthikeyan Sundaram <skarthi98@hotmail.com>
2007-03-21 21:56 ` George Pavlov <gpavlov@mynewplace.com>
2007-03-21 22:16   ` Karthikeyan Sundaram <skarthi98@hotmail.com>
2007-03-21 22:25     ` George Pavlov <gpavlov@mynewplace.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox