Overview v2.6
BART provides a simplified interface for the continuous archiving and point-in-time recovery method provided with Postgres database servers. This consists of the following processes:
- Capturing a complete image of a database cluster as a full base backup or referred to simply as a full backup.
- Capturing a modified image of a database cluster called a block-level incremental backup or referred as incremental backup, which is similar to a full backup, but contains the modified blocks of the relation files that have been changed since a previous backup.
- Archiving the
Write-Ahead Log segments
(WAL files), which continuously record changes to be made to the database files. - Performing Point-In-Time Recovery (PITR) to a specified transaction ID or timestamp with respect to a timeline using a full backup along with successive, block-level incremental backups that reside in the same backup chain, and the WAL files.
Detailed information regarding WAL files and point-in-time recovery is documented in the PostgreSQL Core Documentation.
The general term backup refers to both full backups and incremental backups.
When taking a full backup of a standby server, BART uses the PostgreSQL pg_basebackup
utility program. However, it must be noted that for standby servers, you can only take a full backup, but cannot take an incremental or parallel backups. For information about standby servers, see the PostgreSQL Documentation.
BART uses a centralized backup catalog, a single configuration file, and a command line interface controlling the necessary operations to simplify the management process. Reasonable defaults are automatically used for various backup and restore options. BART also performs the necessary recovery file configuration required for point-in-time recovery using its command line interface.
BART also provides the following features to enhance backup management:
- Automation of the WAL archiving command configuration.
- Usage of retention policies to evaluate, categorize, and delete obsolete backups.
- Compression of WAL files to conserve disk space.
- Customizable naming of backups to ease their usage.
- Easy access to comprehensive information about each backup.
The key components of a BART installation are:
- BART Host. The host system on which BART is installed. BART operations are invoked from this host system. The database server backups and archived WAL files are stored on this host as well.
- BART User Account. Linux operating system user account you choose to run BART. The BART user account owns the BART backup catalog directory.
- BART Configuration File. File in editable text format containing the configuration information that BART uses.
- BART Backup Catalog. File system directory structure containing all of the backups for the database servers that BART manages. It is also the default
archive_path
to store archived WAL files. - BART Backupinfo File. File in text format containing information for a BART backup. A
backupinfo
file resides in each backup subdirectory within the BART backup catalog. - BART Command Line Utility Program. Single, executable file named
bart
, which is used to manage all BART operations. - BART WAL Scanner Program. Single, executable file named
bart-scanner
, which is used to scan WAL files to locate and record the modified blocks for incremental backups.
Other concepts and terms referred to in this document include the following:
Postgres Database Cluster. Also commonly called the data directory, this is the file system directory where all of the data files related to a particular Postgres database server instance are stored. (Each specific running instance is identified by its host and port number when connecting to a database.) The database cluster is identified by the
–D
option when it is created, started, stopped, etc. by thePostgres initdb
andpg_ctl
commands. A full backup is a copy of a database cluster.The terms database cluster and database server are used somewhat interchangeably throughout this document, though a single database server can run multiple database clusters.
Postgres User Account. Linux operating system user account that runs the Advanced Server or PostgreSQL database server and owns the database cluster directory.
By default, the database user account is
enterprisedb
when Advanced Server is installed to support compatibility with Oracle databases.By default, the database user account is
postgres
when Advanced Server is installed in PostgreSQL compatible mode. For a PostgreSQL database server, the default database user account is alsopostgres
.The BART configuration parameter
cluster_owner
must be set to the database user account for each database server.
Replication Database User. For each database server that BART manages, a database superuser must be selected to act as the replication database user. This database user is used to connect to the database server when backups are taken. The database superusers created with an initial Postgres database server installation (
enterprisedb
orpostgres
) may be used for this purpose. The BART configuration parameteruser
must be set to this replication database user for each database server.Secure Shell (SSH)/Secure Copy (SCP). Linux utility programs used to log into hosts (SSH) and copy files (SCP) between hosts. A valid user account must be specified that exists on the target host and in fact is the user account under which the SSH or SCP operations occur.
For information on how all of these components are configured and used with BART, see the EDB Backup and Recovery Installation and Upgrade Guide available at the EDB website.
Supported BART Operations
The following tables are not a conclusive list of the scenarios supported by BART, but instead provides an overview of some of the most common scenarios in both pg_basebackup
(thread count=1) as well as parallel backup mode (thread count greater than 1).
-Fp-xlog-method=fetch | -Fp-xlog-method=stream | -Ft-xlog-method=fetch | -Ft-xlog-method=stream | |
---|---|---|---|---|
Primary Database Server/Full backup | Supported | Supported | Supported | Supported |
Primary Database Server/Incremental backup | Supported | Supported | Not Supported | Not Supported |
Standby Database Server/Full backup | Supported | Supported | Supported | Supported |
Standby Database Server/Incremental backup | Not Supported | Not Supported | Not Supported | Not Supported |
Backup
Wal compression by BART | WAL scanner | |
---|---|---|
Primary Database Server/Full backup | Supported | N/A |
Primary Database Server/Incremental backup | Not Supported | N/A |
Standby Database Server/Full backup | Supported | N/A |
Standby Database Server/Incremental backup | Not Supported | N/A |
Wal Archiving
Wal compression = enabled | Wal compression = disabled | |
---|---|---|
Restore | Supported | Supported |
Parallel restore | Supported | Supported |
Restore
block-level_incremental_backup creating_a_backup_chain