On Thu, Jun 20, 2013 at 3:17 PM, Sameer Thakur <samthakur74@gmail.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