Module11_Backup_PITR Flashcards
what are these PG_DUMP options
-a
-s
-n
-t
-f
-j njobs
-B
-a DATA ONLY (no schema deffintions)
-s NO DATA only schema
-n Specific schema only
-t Specific table only
-f FILE_NAME
-j njobs: parallel dumps
-B exclude blobs
how to zip dump during creation
pg_dump DBNAME | gzip > FILENAME.gz
how to take a logical backup of all cluster
pg_dumpall > filename.backup
when to use pg_restore
when dump is not plain text or you want more features like import a single table only or only objects from 1 schema.
how to configure continues archiving of wall files
WAL_LEVEL must be replica
Archive_mode must be ON
archive_command must be set
restart the server
why would you use streaming wall
you don’t have to wait for the switch of the wall it automatically writes the change to file right away
how to take offline backup from server
stop PG Services and copy data directory
what is prefrerred methode for online backup
pg_basebackup -h localhost -D /DATA_DIR/
how to check if pg_basebackup is correct
with pg_verifybackup tool.
how to peform a PITR
- Stop the server and take a filesystem backup and clean the data directory
- copy files from backup to data directory with cp -rp
- configure recovery setting to postgresql.conf and create recovery.signal
- start server
Recovery settings that must be configured are:
Restore_command
maybe also:
Recovery_target_time