Postgres enables wal archiving
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 ()