1.postgres 開啟wal歸檔:
網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)!專注于網(wǎng)頁設(shè)計、網(wǎng)站建設(shè)、微信開發(fā)、成都小程序開發(fā)、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項(xiàng)目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了古塔免費(fèi)建站歡迎大家使用!
a.修改wal_level參數(shù):
alter system set wal_level= 'replica';
postgres=# alter system set wal_level= 'replica';
ALTER SYSTEM
b.修改archive_mode參數(shù):
alter system set archive_mode= 'on';
postgres=# alter system set archive_mode= 'on';
ALTER SYSTEM
c.修改archive_command 參數(shù):
alter system set archive_command = '/bin/cp -i %p /pgdata/10/archive_wal/%f';
postgres=# alter system set archive_command = '/bin/cp -i %p /pgdata/10/archive_wal/%f';
ALTER SYSTEM
2.PostgreSQL手動切換WAL日志的命令:
PG10之前:
select pg_switch_xlog();
PG10之后:
select pg_switch_wal();