PostgreSQL归档日志配置

环境: windows sever 2003 , postgresql 8.4

在PostgreSQL的安装目录下找到postgresql.conf文件,将其中的archive_mode , archive_command 修改为如下:

# – Archiving –

archive_mode = on  # allows archiving to be done
# (change requires restart)

archive_command = ‘copy “%p” D:\\\\\\\\program\\\\\\\\postgresql_archivedlog\\\\\\\\”%f”‘  # command to use to archive a logfile segment

archive_timeout = 600  # force a logfile segment switch after this
# number of seconds; 0 disables

 

 

日志切换:

postgresql =# select pg_switch_xlog();

作者: hqiang1984

量化自我,极简主义