Re: Archiving and recovering pg_stat_tmp

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Sameer Thakur <samthakur74(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Archiving and recovering pg_stat_tmp
Date: 2013-06-20 07:10:15
Message-ID: CA+HiwqFjxSzEWin24ptUyBP5u_uYw-KRfDwtBp2958MvNbZhEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 20, 2013 at 3:17 PM, Sameer Thakur <samthakur74(at)gmail(dot)com> wrote:
> Hello,
> I was trying to figure out how does one recover server statistics to the
> same snapshot to which a database is restored after PITR.
> The steps i had in mind were
> 1.Set up WAL archiving
> 2.On server shutdown one would need to backup pg_stat_tmp along with file
> system level back of database
> 3. On server crash setup configuration for recovery mode
> 4. Restart server, which replays WAL files and hen moves from recovery to
> normal mode
> What will be behavior be regarding pg_stat_tmp? Will it be deleted on
> startup? Is it possible to recover the same statistics as on last server
> shutdown? ICan the statistics recovered to the same PITR?

Documentation mentions following:

"When the server shuts down, a permanent copy of the statistics data
is stored in the global subdirectory, so that statistics can be
retained across server restarts."

http://www.postgresql.org/docs/9.2/static/monitoring-stats.html

Though, I wonder if it was recently changed to $PGDATA/pg_stat instead
of $PGDATA/global per patch submitted in discussion:

http://www.postgresql.org/message-id/1718942738eb65c8407fcd864883f4c8@fuzzy.cz

When I checked on my 9.4dev installation, I found $PGDATA/pg_stat and
there were per database .stat files.

--
Amit Langote

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2013-06-20 08:27:07 Re: variadic args to C functions
Previous Message James Sewell 2013-06-20 06:45:38 Snapshot backups