Get the App
SLTechnology News&Howtos  ›  Database  › 

Postgres enables wal archiving

Shulou Source: shulou.com Published: 2022-06-01 04:16:55 10月03日 Update

1.postgres enables wal archiving:

a. Modify the wal_level parameters:

Alter system set wal_level= 'replica'

Postgres=# alter system set wal_level= 'replica'

ALTER SYSTEM

b. Modify the archive_mode parameters:

Alter system set archive_mode= 'on'

Postgres=# alter system set archive_mode= 'on'

ALTER SYSTEM

c. Modify the archive_command parameters:

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 commands to manually switch WAL logs:

Before PG10:

Select pg_switch_xlog ()

After PG10:

Select pg_switch_wal ()

Tags: Parameters commands manual logging a. toggle Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft OPPO Reno MySQL Linux Shulou Technology