Обсуждение: User info?

Поиск
Список
Период
Сортировка

User info?

От
Carol Walter
Дата:
Is there a way to tell when the last time a database in a cluster was
accessed?  I have a large number of student databases that are
probably inactive, but I don't want to just destroy.  I'd like to
archive these, but I need to be able to tell when they were last
accessed?

Carol

Re: User info?

От
"Scott Marlowe"
Дата:
On Wed, Dec 3, 2008 at 8:30 AM, Carol Walter <walterc@indiana.edu> wrote:
> Is there a way to tell when the last time a database in a cluster was
> accessed?  I have a large number of student databases that are probably
> inactive, but I don't want to just destroy.  I'd like to archive these, but
> I need to be able to tell when they were last accessed?

No direct method from within the db I know of, but you could use
oid2name / a list of db relids then go into the data/base directory
and see when the last time the files in the individual db directories
had been updated.  That won't tell you the last time they were
ACCESSED, but will give you an idea if they're being updated or not.
Note that vacuum may change the last update times so it's not
foolproof by any means.

The other method is to log connections and then scrape the logs.

Re: User info?

От
Fabricio
Дата:
In postgresql.conf you can enable connections logs. log_connections = on


> From: walterc@indiana.edu
> To: pgsql-admin@postgresql.org
> Subject: [ADMIN] User info?
> Date: Wed, 3 Dec 2008 10:30:22 -0500
>
> Is there a way to tell when the last time a database in a cluster was
> accessed? I have a large number of student databases that are
> probably inactive, but I don't want to just destroy. I'd like to
> archive these, but I need to be able to tell when they were last
> accessed?
>
> Carol
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin



Conoce el perfil completo de todos tus amigos de Windows Live Messenger justo aquí: Windows Live Spaces