SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Downloaden Sie, um offline zu lesen
Database Dumps
and Backups
Karen Jex
February 2021
Who am I?
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
3
Agenda
• Why Take Backups?
• Why do we need to Recover?
• What are our Recovery Requirements?
• Backup Methods
• Backup Strategy
• Backup and Recovery Tools
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
4
Why Take Backups?
• Safeguard critical business data
• Recover from database failure
• Recovery strategy
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
5
Practice your disaster recovery
• The only way to be sure that a backup
can be restored is by restoring it
• If you need to restore a database,
it will be an emergency
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
6
Why do we need to Recover?
• Database server crash
• Storage array failure
• Batch process incorrectly modified data
• Human error (or willful destruction)
• Corrupted data file
• Creating development/test databases
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
7
What are our Recovery Requirements?
• Maximum Permitted Data Loss (RPO)
• Maximum Time to Recover (RTO)
• Backup Retention
Backups aren’t
the whole story
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
9
Physical Database Backup
• Offline
• Online
• Continuous archiving
• Storage snapshots
Backup Methods
Logical Database Backup
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
10
Physical Database Backups
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
11
Physical Database Backups
Advantages Disadvantages
• Generally faster to backup/restore from
than logical backup
• Allows PITR (if WALs are archived)
• Full or incremental backups
• Lack of flexibility
(backup/restore entire database cluster)
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
12
Offline Backups
(Physical Database Backups)
• Shut down database cluster
• Copy database files
• Start up database cluster
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
13
Advantages Disadvantages
• Any file copy tool can be used
• No need to back up associated WAL files
• Database unavailable during the backup
• PITR is not possible
Offline Backups
(Physical Database Backups)
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
14
• WAL = write-ahead log
• wal_level : minimal, replica (default) or logical
• archive_mode: off, on or always
• archive_command
WAL files
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
15
• Tell PostgreSQL you’re starting a backup
• Copy the database files
• Copy the WAL files
• Tell PostgreSQL you’ve finished the backup
Online Backups
(Physical Database Backups)
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
16
Advantages Disadvantages
• Database available during backup • WAL files must be backed up
• WAL parameters must be set correctly
Online Backups
(Physical Database Backups)
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
17
• All WAL files are backed up
• Allows PITR
Continuous Archiving
(Physical Database Backups)
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
18
Storage Snapshots
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
19
Storage Snapshots
• Consistent snapshot of the filesystem
• WAL files must be backed up
• Perform CHECKPOINT just before the snapshot
• Checkpoints of FS containing WAL and each tablespace must be simultaneous
• TEST
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
20
Logical Database Backups
my_db.dump
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
21
Logical Database Backups
Advantages Disadvantages
• Flexibility
• Cross-version compatibility
• Slower restore than from physical
backup
• No PITR
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
22
Comparison of Backup Methods
Allows point in
time recovery
Database available
during backup
Allows backup of
individual objects
Offline Backup
Online Backup ✔
Continuous archiving ✔ ✔
Logical Backup/Dump ✔ ✔
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
23
Backup Strategy
• Backup method
• Frequency of backups
• Full or incremental backups
• Retention period
Backup and
Recovery Tools
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
25
• Point in time recovery (PITR)
• Central backup architecture
• Scheduling
• Backup Catalogue
• Management of Backup and WAL files
Requirements of a Backup/Recovery Tool
• WAL archiving
• Monitoring and alerting
• Compression
• Incremental Backups
• Backup/restore of individual objects
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
26
Requirements of a Backup/Recovery Tool
Point in time recovery (PITR)
Sun Mon Tue Wed Thu Fri Sat
Backup 03:00 Batch 05:00 Backup 03:00 Backup 03:00 Batch 05:00
OLTP 09:00 - 18:00 OLTP 09:00 - 18:00 OLTP 09:00 - 18:00 OLTP 09:00 - 18:00 OLTP 09:00 - 18:00
Batch 22:00 Batch 22:00
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
27
Requirements of a Backup/Recovery Tool
Central Backup Architecture
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
28
Requirements of a Backup/Recovery Tool
Scheduling Backup
Catalogue
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
29
Requirements of a Backup/Recovery Tool
Management of Backup and WAL files WAL Archiving
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
30
Requirements of a Backup/Recovery Tool
Monitoring and Alerting Backup/Restore selected
objects
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
31
Requirements of a Backup/Recovery Tool
Compression Incremental Backups
Backup and
Recovery Tools
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
33
Backup and Recovery Tools
Physical Backups Logical Backups
• pg_basebackup
• BART
• Barman
• pgBackRest
• pg_dump
• pg_dumpall
• pg_restore
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
34
No Backup Tool?
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
35
Custom Scripts
https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADMIN-BACKUP
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
36
pg_basebackup 1/2
https://www.postgresql.org/docs/current/app-pgbasebackup.html
• Does not affect other clients to the database
• Can be used for point-in-time recovery
• makes a binary copy of the database cluster files
• Puts system in and out of backup mode
• Backs up entire database cluster
• does not manage a backup library
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
37
pg_basebackup 2/2
# pg_basebackup -h mydbserver -z -D /my/backup/location/data
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
38
BART (EDB Backup and Recovery Tool) 1/2
EDB BART 2.6.1 User Guide
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
39
BART
2/2
# bart backup -s <server_name>
# bart restore -s <server_name>
# bart show-backups -s <server_name>
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
40
Barman 1/2
http://docs.pgbarman.org
● Remote backup and restore of multiple servers
● backup catalogs
● incremental backup
● retention policies
● archiving and compression of WAL files and backups
● rsync or PostgreSQL protocol
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
41
Barman 2/2
# barman backup <server_name>
# barman recover <server_name>
# barman list-backup <server_name>
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
42
pgBackRest 1/2
https://pgbackrest.org/
• Parallel Backup & Restore
• Local or Remote Operation
• Full, Incremental, & Differential Backups
• Backup Rotation & Archive Expiration
• Delta Restore
• Parallel, Asynchronous WAL Push & Get
• Tablespace & Link Support
• Encryption
• Limit restore to specific databases
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
43
pgBackRest 2/2
# pgbackrest stanza=<server_name> backup
# pgbackrest stanza=<server_name> restore
# pgbackrest stanza=<server_name> info
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
44
BART/BARMAN/pgBackRest
Common Architecture/Setup
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
45
• Create DB superuser for backups
• Create OS user for backups
• Allow DB connections from the backup server (pg_hba.conf )
• Allow passwordless connections between DB server and backup server
• Allow passwordless connection to DB from backup server
BART/BARMAN/pgBackRest
Common Architecture/Setup
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
46
# backup_config_file
[global section]
backup location
database user
…
[server_name section]
hostname
data directory
…
BART/BARMAN/pgBackRest
Common Architecture/Setup
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
47
BART/BARMAN/pgBackRest
Common Architecture/Setup
/backup_home
server_name
archived_wals
backups
…
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
48
pg_dump
https://www.postgresql.org/docs/current/app-pgdump.html
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
49
pg_dump
https://www.postgresql.org/docs/current/app-pgdump.html
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
50
pg_dump
-F (--format)
c (custom)
d (directory)
t (tar)
-n schema
-t table
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
51
pg_dumpall
https://www.postgresql.org/docs/current/app-pg-dumpall.html
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
52
pg_restore
https://www.postgresql.org/docs/current/app-pgrestore.html
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
53
Comparison of Backup and Recovery Tools
PITR Scheduling
Management of
backup files
WAL archiving Monitoring
Centralised
architecture
BART ✔ via PEM ✔ ✔ via PEM ✔
Barman ✔ ✔ ✔ ✔ ✔ ✔
pgBackRest ✔ ✔ ✔ ✔
pg_dump
pg_dumpall
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
54
Comparison of Backup and Recovery Tools
Compression
Incremental
backups
Specific database /
schema / table
Global objects
Cross-version
compatibility
BART ✔ ✔ ✔
Barman ✔ ✔ ✔
pgBackRest ✔ ✔ Specific database ✔
pg_dump ✔ ✔ ✔
pg_dumpall ✔ ✔ ✔
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
55
Conclusions
• There is a vast array of different backup/export methods
and tools available but they all serve one main purpose,
and that is to support your recovery strategy.
• It is important to determine your recovery requirements
before implementing the backup strategy that fits your
specific needs.
• Your backup strategy may involve one or more of the
methods and tools that we have discussed.
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.
56
Questions

Weitere ähnliche Inhalte

Was ist angesagt?

Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLEDB
 
Best Practices & Lessons Learned from Deployment of PostgreSQL
 Best Practices & Lessons Learned from Deployment of PostgreSQL Best Practices & Lessons Learned from Deployment of PostgreSQL
Best Practices & Lessons Learned from Deployment of PostgreSQLEDB
 
EDB & ELOS Technologies - Break Free from Oracle
EDB & ELOS Technologies - Break Free from OracleEDB & ELOS Technologies - Break Free from Oracle
EDB & ELOS Technologies - Break Free from OracleEDB
 
How to Design for Database High Availability
How to Design for Database High AvailabilityHow to Design for Database High Availability
How to Design for Database High AvailabilityEDB
 
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...EDB
 
PostgreSQL as a Strategic Tool
PostgreSQL as a Strategic ToolPostgreSQL as a Strategic Tool
PostgreSQL as a Strategic ToolEDB
 
Public Sector Virtual Town Hall: High Availability for PostgreSQL
Public Sector Virtual Town Hall: High Availability for PostgreSQLPublic Sector Virtual Town Hall: High Availability for PostgreSQL
Public Sector Virtual Town Hall: High Availability for PostgreSQLEDB
 
An overview of reference architectures for Postgres
An overview of reference architectures for PostgresAn overview of reference architectures for Postgres
An overview of reference architectures for PostgresEDB
 
Why Care Risk Choose PostgreSQL
Why Care Risk Choose PostgreSQLWhy Care Risk Choose PostgreSQL
Why Care Risk Choose PostgreSQLEDB
 
Overcoming write availability challenges of PostgreSQL
Overcoming write availability challenges of PostgreSQLOvercoming write availability challenges of PostgreSQL
Overcoming write availability challenges of PostgreSQLEDB
 
Migration DB2 to EDB - Project Experience
 Migration DB2 to EDB - Project Experience Migration DB2 to EDB - Project Experience
Migration DB2 to EDB - Project ExperienceEDB
 
Replacing Oracle with EDB Postgres
Replacing Oracle with EDB PostgresReplacing Oracle with EDB Postgres
Replacing Oracle with EDB PostgresEDB
 
Migrate Today: Proactive Steps to Unhook from Oracle
Migrate Today: Proactive Steps to Unhook from OracleMigrate Today: Proactive Steps to Unhook from Oracle
Migrate Today: Proactive Steps to Unhook from OracleEDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLEDB
 
Making your PostgreSQL Database Highly Available
Making your PostgreSQL Database Highly AvailableMaking your PostgreSQL Database Highly Available
Making your PostgreSQL Database Highly AvailableEDB
 
PostgreSQL as a Strategic Tool
PostgreSQL as a Strategic ToolPostgreSQL as a Strategic Tool
PostgreSQL as a Strategic ToolEDB
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJCloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJEDB
 
Webinar: Managing Postgres at Scale
Webinar: Managing Postgres at ScaleWebinar: Managing Postgres at Scale
Webinar: Managing Postgres at ScaleEDB
 
New and Improved Features in PostgreSQL 13
New and Improved Features in PostgreSQL 13New and Improved Features in PostgreSQL 13
New and Improved Features in PostgreSQL 13EDB
 
PostgreSQL to Accelerate Innovation
PostgreSQL to Accelerate InnovationPostgreSQL to Accelerate Innovation
PostgreSQL to Accelerate InnovationEDB
 

Was ist angesagt? (20)

Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 
Best Practices & Lessons Learned from Deployment of PostgreSQL
 Best Practices & Lessons Learned from Deployment of PostgreSQL Best Practices & Lessons Learned from Deployment of PostgreSQL
Best Practices & Lessons Learned from Deployment of PostgreSQL
 
EDB & ELOS Technologies - Break Free from Oracle
EDB & ELOS Technologies - Break Free from OracleEDB & ELOS Technologies - Break Free from Oracle
EDB & ELOS Technologies - Break Free from Oracle
 
How to Design for Database High Availability
How to Design for Database High AvailabilityHow to Design for Database High Availability
How to Design for Database High Availability
 
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
 
PostgreSQL as a Strategic Tool
PostgreSQL as a Strategic ToolPostgreSQL as a Strategic Tool
PostgreSQL as a Strategic Tool
 
Public Sector Virtual Town Hall: High Availability for PostgreSQL
Public Sector Virtual Town Hall: High Availability for PostgreSQLPublic Sector Virtual Town Hall: High Availability for PostgreSQL
Public Sector Virtual Town Hall: High Availability for PostgreSQL
 
An overview of reference architectures for Postgres
An overview of reference architectures for PostgresAn overview of reference architectures for Postgres
An overview of reference architectures for Postgres
 
Why Care Risk Choose PostgreSQL
Why Care Risk Choose PostgreSQLWhy Care Risk Choose PostgreSQL
Why Care Risk Choose PostgreSQL
 
Overcoming write availability challenges of PostgreSQL
Overcoming write availability challenges of PostgreSQLOvercoming write availability challenges of PostgreSQL
Overcoming write availability challenges of PostgreSQL
 
Migration DB2 to EDB - Project Experience
 Migration DB2 to EDB - Project Experience Migration DB2 to EDB - Project Experience
Migration DB2 to EDB - Project Experience
 
Replacing Oracle with EDB Postgres
Replacing Oracle with EDB PostgresReplacing Oracle with EDB Postgres
Replacing Oracle with EDB Postgres
 
Migrate Today: Proactive Steps to Unhook from Oracle
Migrate Today: Proactive Steps to Unhook from OracleMigrate Today: Proactive Steps to Unhook from Oracle
Migrate Today: Proactive Steps to Unhook from Oracle
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 
Making your PostgreSQL Database Highly Available
Making your PostgreSQL Database Highly AvailableMaking your PostgreSQL Database Highly Available
Making your PostgreSQL Database Highly Available
 
PostgreSQL as a Strategic Tool
PostgreSQL as a Strategic ToolPostgreSQL as a Strategic Tool
PostgreSQL as a Strategic Tool
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJCloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ
 
Webinar: Managing Postgres at Scale
Webinar: Managing Postgres at ScaleWebinar: Managing Postgres at Scale
Webinar: Managing Postgres at Scale
 
New and Improved Features in PostgreSQL 13
New and Improved Features in PostgreSQL 13New and Improved Features in PostgreSQL 13
New and Improved Features in PostgreSQL 13
 
PostgreSQL to Accelerate Innovation
PostgreSQL to Accelerate InnovationPostgreSQL to Accelerate Innovation
PostgreSQL to Accelerate Innovation
 

Ähnlich wie Database Dumps and Backups

Postgres Point-in-Time Recovery
Postgres Point-in-Time RecoveryPostgres Point-in-Time Recovery
Postgres Point-in-Time RecoveryEDB
 
Beginners Guide to High Availability for Postgres
Beginners Guide to High Availability for PostgresBeginners Guide to High Availability for Postgres
Beginners Guide to High Availability for PostgresEDB
 
An overview of reference architectures for Postgres
An overview of reference architectures for PostgresAn overview of reference architectures for Postgres
An overview of reference architectures for PostgresEDB
 
PostgreSQL continuous backup and PITR with Barman
 PostgreSQL continuous backup and PITR with Barman PostgreSQL continuous backup and PITR with Barman
PostgreSQL continuous backup and PITR with BarmanEDB
 
Be Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERA
Be Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERABe Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERA
Be Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERAIDERA Software
 
Beginner's Guide to High Availability for Postgres
Beginner's Guide to High Availability for PostgresBeginner's Guide to High Availability for Postgres
Beginner's Guide to High Availability for PostgresEDB
 
C7 engineered data_protection_for_oracle_databases
C7 engineered data_protection_for_oracle_databasesC7 engineered data_protection_for_oracle_databases
C7 engineered data_protection_for_oracle_databasesDr. Wilfred Lin (Ph.D.)
 
9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdfsreedb2
 
Best Practices for Becoming an Exceptional Postgres DBA
Best Practices for Becoming an Exceptional Postgres DBA Best Practices for Becoming an Exceptional Postgres DBA
Best Practices for Becoming an Exceptional Postgres DBA EDB
 
Oracle Backup Solutions Overview August 2018
Oracle Backup Solutions Overview August 2018Oracle Backup Solutions Overview August 2018
Oracle Backup Solutions Overview August 2018Dan Glasscock
 
How to use postgresql.conf to configure and tune the PostgreSQL server
How to use postgresql.conf to configure and tune the PostgreSQL serverHow to use postgresql.conf to configure and tune the PostgreSQL server
How to use postgresql.conf to configure and tune the PostgreSQL serverEDB
 
Oracle Database 12c para la comunidad GeneXus - Engineered for clouds
Oracle Database 12c para la comunidad GeneXus - Engineered for cloudsOracle Database 12c para la comunidad GeneXus - Engineered for clouds
Oracle Database 12c para la comunidad GeneXus - Engineered for cloudsGeneXus
 
Postgres in production.2014
Postgres in production.2014Postgres in production.2014
Postgres in production.2014EDB
 
Database backup and recovery basics
Database backup and recovery basicsDatabase backup and recovery basics
Database backup and recovery basicsShahed Mohamed
 
AUSPC 2013 - Business Continuity Management in SharePoint
AUSPC 2013 - Business Continuity Management in SharePointAUSPC 2013 - Business Continuity Management in SharePoint
AUSPC 2013 - Business Continuity Management in SharePointMichael Noel
 
Presentation backup and recovery best practices for very large databases (v...
Presentation   backup and recovery best practices for very large databases (v...Presentation   backup and recovery best practices for very large databases (v...
Presentation backup and recovery best practices for very large databases (v...xKinAnx
 
Managing Postgres at Scale With Postgres Enterprise Manager
Managing Postgres at Scale With Postgres Enterprise ManagerManaging Postgres at Scale With Postgres Enterprise Manager
Managing Postgres at Scale With Postgres Enterprise ManagerEDB
 
20618782218718364253 emea12 vldb
20618782218718364253 emea12 vldb20618782218718364253 emea12 vldb
20618782218718364253 emea12 vldbLocuto Riorama
 
EDB: Power to Postgres
EDB: Power to PostgresEDB: Power to Postgres
EDB: Power to PostgresAshnikbiz
 

Ähnlich wie Database Dumps and Backups (20)

Postgres Point-in-Time Recovery
Postgres Point-in-Time RecoveryPostgres Point-in-Time Recovery
Postgres Point-in-Time Recovery
 
Beginners Guide to High Availability for Postgres
Beginners Guide to High Availability for PostgresBeginners Guide to High Availability for Postgres
Beginners Guide to High Availability for Postgres
 
An overview of reference architectures for Postgres
An overview of reference architectures for PostgresAn overview of reference architectures for Postgres
An overview of reference architectures for Postgres
 
PostgreSQL continuous backup and PITR with Barman
 PostgreSQL continuous backup and PITR with Barman PostgreSQL continuous backup and PITR with Barman
PostgreSQL continuous backup and PITR with Barman
 
Be Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERA
Be Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERABe Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERA
Be Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERA
 
Beginner's Guide to High Availability for Postgres
Beginner's Guide to High Availability for PostgresBeginner's Guide to High Availability for Postgres
Beginner's Guide to High Availability for Postgres
 
C7 engineered data_protection_for_oracle_databases
C7 engineered data_protection_for_oracle_databasesC7 engineered data_protection_for_oracle_databases
C7 engineered data_protection_for_oracle_databases
 
9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf
 
Best Practices for Becoming an Exceptional Postgres DBA
Best Practices for Becoming an Exceptional Postgres DBA Best Practices for Becoming an Exceptional Postgres DBA
Best Practices for Becoming an Exceptional Postgres DBA
 
Oracle Backup Solutions Overview August 2018
Oracle Backup Solutions Overview August 2018Oracle Backup Solutions Overview August 2018
Oracle Backup Solutions Overview August 2018
 
How to use postgresql.conf to configure and tune the PostgreSQL server
How to use postgresql.conf to configure and tune the PostgreSQL serverHow to use postgresql.conf to configure and tune the PostgreSQL server
How to use postgresql.conf to configure and tune the PostgreSQL server
 
Oracle Database 12c para la comunidad GeneXus - Engineered for clouds
Oracle Database 12c para la comunidad GeneXus - Engineered for cloudsOracle Database 12c para la comunidad GeneXus - Engineered for clouds
Oracle Database 12c para la comunidad GeneXus - Engineered for clouds
 
Postgres in production.2014
Postgres in production.2014Postgres in production.2014
Postgres in production.2014
 
Oracle Storage a ochrana dat
Oracle Storage a ochrana datOracle Storage a ochrana dat
Oracle Storage a ochrana dat
 
Database backup and recovery basics
Database backup and recovery basicsDatabase backup and recovery basics
Database backup and recovery basics
 
AUSPC 2013 - Business Continuity Management in SharePoint
AUSPC 2013 - Business Continuity Management in SharePointAUSPC 2013 - Business Continuity Management in SharePoint
AUSPC 2013 - Business Continuity Management in SharePoint
 
Presentation backup and recovery best practices for very large databases (v...
Presentation   backup and recovery best practices for very large databases (v...Presentation   backup and recovery best practices for very large databases (v...
Presentation backup and recovery best practices for very large databases (v...
 
Managing Postgres at Scale With Postgres Enterprise Manager
Managing Postgres at Scale With Postgres Enterprise ManagerManaging Postgres at Scale With Postgres Enterprise Manager
Managing Postgres at Scale With Postgres Enterprise Manager
 
20618782218718364253 emea12 vldb
20618782218718364253 emea12 vldb20618782218718364253 emea12 vldb
20618782218718364253 emea12 vldb
 
EDB: Power to Postgres
EDB: Power to PostgresEDB: Power to Postgres
EDB: Power to Postgres
 

Mehr von EDB

Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSEDB
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenEDB
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube EDB
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EDB
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLBenchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLEDB
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLLas Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLEDB
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLEDB
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?EDB
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLEDB
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresEDB
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINA Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINEDB
 
IOT with PostgreSQL
IOT with PostgreSQLIOT with PostgreSQL
IOT with PostgreSQLEDB
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLA Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLEDB
 
Psql is awesome!
Psql is awesome!Psql is awesome!
Psql is awesome!EDB
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesComment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesEDB
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoCloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoEDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLEDB
 
EDB Postgres & Tools in a Smart City Project
EDB Postgres & Tools in a Smart City ProjectEDB Postgres & Tools in a Smart City Project
EDB Postgres & Tools in a Smart City ProjectEDB
 
All you need to know about CREATE STATISTICS
All you need to know about CREATE STATISTICSAll you need to know about CREATE STATISTICS
All you need to know about CREATE STATISTICSEDB
 

Mehr von EDB (20)

Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLBenchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQL
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLLas Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQL
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINA Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
 
IOT with PostgreSQL
IOT with PostgreSQLIOT with PostgreSQL
IOT with PostgreSQL
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLA Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL
 
Psql is awesome!
Psql is awesome!Psql is awesome!
Psql is awesome!
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesComment sauvegarder correctement vos données
Comment sauvegarder correctement vos données
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoCloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - Italiano
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 
EDB Postgres & Tools in a Smart City Project
EDB Postgres & Tools in a Smart City ProjectEDB Postgres & Tools in a Smart City Project
EDB Postgres & Tools in a Smart City Project
 
All you need to know about CREATE STATISTICS
All you need to know about CREATE STATISTICSAll you need to know about CREATE STATISTICS
All you need to know about CREATE STATISTICS
 

Kürzlich hochgeladen

Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfROWELL MARQUINA
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneUiPathCommunity
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 

Kürzlich hochgeladen (20)

Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
How Tech Giants Cut Corners to Harvest Data for A.I.
How Tech Giants Cut Corners to Harvest Data for A.I.How Tech Giants Cut Corners to Harvest Data for A.I.
How Tech Giants Cut Corners to Harvest Data for A.I.
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyone
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 

Database Dumps and Backups

  • 3. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 3 Agenda • Why Take Backups? • Why do we need to Recover? • What are our Recovery Requirements? • Backup Methods • Backup Strategy • Backup and Recovery Tools
  • 4. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 4 Why Take Backups? • Safeguard critical business data • Recover from database failure • Recovery strategy
  • 5. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 5 Practice your disaster recovery • The only way to be sure that a backup can be restored is by restoring it • If you need to restore a database, it will be an emergency
  • 6. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 6 Why do we need to Recover? • Database server crash • Storage array failure • Batch process incorrectly modified data • Human error (or willful destruction) • Corrupted data file • Creating development/test databases
  • 7. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 7 What are our Recovery Requirements? • Maximum Permitted Data Loss (RPO) • Maximum Time to Recover (RTO) • Backup Retention
  • 9. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 9 Physical Database Backup • Offline • Online • Continuous archiving • Storage snapshots Backup Methods Logical Database Backup
  • 10. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 10 Physical Database Backups
  • 11. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 11 Physical Database Backups Advantages Disadvantages • Generally faster to backup/restore from than logical backup • Allows PITR (if WALs are archived) • Full or incremental backups • Lack of flexibility (backup/restore entire database cluster)
  • 12. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 12 Offline Backups (Physical Database Backups) • Shut down database cluster • Copy database files • Start up database cluster
  • 13. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 13 Advantages Disadvantages • Any file copy tool can be used • No need to back up associated WAL files • Database unavailable during the backup • PITR is not possible Offline Backups (Physical Database Backups)
  • 14. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 14 • WAL = write-ahead log • wal_level : minimal, replica (default) or logical • archive_mode: off, on or always • archive_command WAL files
  • 15. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 15 • Tell PostgreSQL you’re starting a backup • Copy the database files • Copy the WAL files • Tell PostgreSQL you’ve finished the backup Online Backups (Physical Database Backups)
  • 16. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 16 Advantages Disadvantages • Database available during backup • WAL files must be backed up • WAL parameters must be set correctly Online Backups (Physical Database Backups)
  • 17. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 17 • All WAL files are backed up • Allows PITR Continuous Archiving (Physical Database Backups)
  • 18. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 18 Storage Snapshots
  • 19. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 19 Storage Snapshots • Consistent snapshot of the filesystem • WAL files must be backed up • Perform CHECKPOINT just before the snapshot • Checkpoints of FS containing WAL and each tablespace must be simultaneous • TEST
  • 20. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 20 Logical Database Backups my_db.dump
  • 21. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 21 Logical Database Backups Advantages Disadvantages • Flexibility • Cross-version compatibility • Slower restore than from physical backup • No PITR
  • 22. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 22 Comparison of Backup Methods Allows point in time recovery Database available during backup Allows backup of individual objects Offline Backup Online Backup ✔ Continuous archiving ✔ ✔ Logical Backup/Dump ✔ ✔
  • 23. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 23 Backup Strategy • Backup method • Frequency of backups • Full or incremental backups • Retention period
  • 25. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 25 • Point in time recovery (PITR) • Central backup architecture • Scheduling • Backup Catalogue • Management of Backup and WAL files Requirements of a Backup/Recovery Tool • WAL archiving • Monitoring and alerting • Compression • Incremental Backups • Backup/restore of individual objects
  • 26. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 26 Requirements of a Backup/Recovery Tool Point in time recovery (PITR) Sun Mon Tue Wed Thu Fri Sat Backup 03:00 Batch 05:00 Backup 03:00 Backup 03:00 Batch 05:00 OLTP 09:00 - 18:00 OLTP 09:00 - 18:00 OLTP 09:00 - 18:00 OLTP 09:00 - 18:00 OLTP 09:00 - 18:00 Batch 22:00 Batch 22:00
  • 27. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 27 Requirements of a Backup/Recovery Tool Central Backup Architecture
  • 28. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 28 Requirements of a Backup/Recovery Tool Scheduling Backup Catalogue
  • 29. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 29 Requirements of a Backup/Recovery Tool Management of Backup and WAL files WAL Archiving
  • 30. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 30 Requirements of a Backup/Recovery Tool Monitoring and Alerting Backup/Restore selected objects
  • 31. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 31 Requirements of a Backup/Recovery Tool Compression Incremental Backups
  • 33. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 33 Backup and Recovery Tools Physical Backups Logical Backups • pg_basebackup • BART • Barman • pgBackRest • pg_dump • pg_dumpall • pg_restore
  • 34. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 34 No Backup Tool?
  • 35. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 35 Custom Scripts https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADMIN-BACKUP
  • 36. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 36 pg_basebackup 1/2 https://www.postgresql.org/docs/current/app-pgbasebackup.html • Does not affect other clients to the database • Can be used for point-in-time recovery • makes a binary copy of the database cluster files • Puts system in and out of backup mode • Backs up entire database cluster • does not manage a backup library
  • 37. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 37 pg_basebackup 2/2 # pg_basebackup -h mydbserver -z -D /my/backup/location/data
  • 38. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 38 BART (EDB Backup and Recovery Tool) 1/2 EDB BART 2.6.1 User Guide
  • 39. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 39 BART 2/2 # bart backup -s <server_name> # bart restore -s <server_name> # bart show-backups -s <server_name>
  • 40. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 40 Barman 1/2 http://docs.pgbarman.org ● Remote backup and restore of multiple servers ● backup catalogs ● incremental backup ● retention policies ● archiving and compression of WAL files and backups ● rsync or PostgreSQL protocol
  • 41. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 41 Barman 2/2 # barman backup <server_name> # barman recover <server_name> # barman list-backup <server_name>
  • 42. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 42 pgBackRest 1/2 https://pgbackrest.org/ • Parallel Backup & Restore • Local or Remote Operation • Full, Incremental, & Differential Backups • Backup Rotation & Archive Expiration • Delta Restore • Parallel, Asynchronous WAL Push & Get • Tablespace & Link Support • Encryption • Limit restore to specific databases
  • 43. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 43 pgBackRest 2/2 # pgbackrest stanza=<server_name> backup # pgbackrest stanza=<server_name> restore # pgbackrest stanza=<server_name> info
  • 44. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 44 BART/BARMAN/pgBackRest Common Architecture/Setup
  • 45. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 45 • Create DB superuser for backups • Create OS user for backups • Allow DB connections from the backup server (pg_hba.conf ) • Allow passwordless connections between DB server and backup server • Allow passwordless connection to DB from backup server BART/BARMAN/pgBackRest Common Architecture/Setup
  • 46. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 46 # backup_config_file [global section] backup location database user … [server_name section] hostname data directory … BART/BARMAN/pgBackRest Common Architecture/Setup
  • 47. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 47 BART/BARMAN/pgBackRest Common Architecture/Setup /backup_home server_name archived_wals backups …
  • 48. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 48 pg_dump https://www.postgresql.org/docs/current/app-pgdump.html
  • 49. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 49 pg_dump https://www.postgresql.org/docs/current/app-pgdump.html
  • 50. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 50 pg_dump -F (--format) c (custom) d (directory) t (tar) -n schema -t table
  • 51. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 51 pg_dumpall https://www.postgresql.org/docs/current/app-pg-dumpall.html
  • 52. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 52 pg_restore https://www.postgresql.org/docs/current/app-pgrestore.html
  • 53. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 53 Comparison of Backup and Recovery Tools PITR Scheduling Management of backup files WAL archiving Monitoring Centralised architecture BART ✔ via PEM ✔ ✔ via PEM ✔ Barman ✔ ✔ ✔ ✔ ✔ ✔ pgBackRest ✔ ✔ ✔ ✔ pg_dump pg_dumpall
  • 54. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 54 Comparison of Backup and Recovery Tools Compression Incremental backups Specific database / schema / table Global objects Cross-version compatibility BART ✔ ✔ ✔ Barman ✔ ✔ ✔ pgBackRest ✔ ✔ Specific database ✔ pg_dump ✔ ✔ ✔ pg_dumpall ✔ ✔ ✔
  • 55. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 55 Conclusions • There is a vast array of different backup/export methods and tools available but they all serve one main purpose, and that is to support your recovery strategy. • It is important to determine your recovery requirements before implementing the backup strategy that fits your specific needs. • Your backup strategy may involve one or more of the methods and tools that we have discussed.
  • 56. © Copyright EnterpriseDB Corporation, 2020. All rights reserved. 56 Questions