Module11_Backup_PITR Flashcards

1
Q

what are these PG_DUMP options
-a
-s
-n
-t
-f
-j njobs
-B

A

-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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how to zip dump during creation

A

pg_dump DBNAME | gzip > FILENAME.gz

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

how to take a logical backup of all cluster

A

pg_dumpall > filename.backup

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

when to use pg_restore

A

when dump is not plain text or you want more features like import a single table only or only objects from 1 schema.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how to configure continues archiving of wall files

A

WAL_LEVEL must be replica
Archive_mode must be ON
archive_command must be set
restart the server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

why would you use streaming wall

A

you don’t have to wait for the switch of the wall it automatically writes the change to file right away

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how to take offline backup from server

A

stop PG Services and copy data directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is prefrerred methode for online backup

A

pg_basebackup -h localhost -D /DATA_DIR/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how to check if pg_basebackup is correct

A

with pg_verifybackup tool.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how to peform a PITR

A
  • 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly