BACKUP v2.6
Use the BACKUP
subcommand to create a full or incremental backup.
Syntax for a Full Backup:
Syntax for an Incremental Backup:
Before performing an incremental backup, you must take a full backup. For more details about incremental backup, refer to Block-Level Incremental Backup in the EDB Backup and Recovery User Guide available at the EDB website.
The following table describes the BACKUP
options:
Options | Description |
---|---|
-s { <server_name> | all } --server { <server_name> | all } | Use this option to specify the database server to be backed up. Specify <server_name> to take a backup of the database server (as specified in the BART configuration file).Specify all to take a backup of all servers. |
-F { p | t } --format { p | t } | Use this option to specify the backup file format. Specify p option to take backup in plain text format and specify t option to take backup in tar format. If the p or t option is omitted, the default is tar format.Use p option with the BACKUP subcommand when streaming is used as a backup method.An incremental backup can only be taken in plain text format ( p ). |
-z (--gzip) | This option is applicable only for full backup and tar format. Use this option to enable gzip compression of tar files using the default compression level (typically 6). |
-c <compression_level> --compress-level <compression_level> | This is applicable only for full backup and tar format. Use this option to specify the gzip compression level on the tar file output. <compression_level> is a digit from 1 through 9, with 9 being the best compression. |
--backup-name <backup_name> | Use this option to assign a user-defined, alphanumeric friendly name to the backup. The maximum permitted length of backup name is 49 characters. For detailed information about this parameter, see the EDB Backup and Recovery User Guide available at the EDB website. If the option --backup-name is not specified and the backup_name parameter is not set for this database server in the BART configuration file, then the backup can only be referenced in other BART subcommands by the BART assigned backup identifier. |
--thread-count <number_of_threads> | Use this option to specify the number of worker threads to run in parallel to copy blocks for a backup. For detailed information about the --thread-count parameter, see the EDB Backup and Recovery Installation and Upgrade Guide available at the EDB website. |
--with-pg_basebackup | This is applicable only for full backup. Use this option to specify the use of pg_basebackup to take a full backup. The number of thread counts in effect is ignored as given by the thread_count parameter in the BART configuration file.When taking a full backup, if the thread count in effect is greater than 1 , then the pg_basebackup utility is not used to take the full backup (parallel worker threads are used) unless the --with-pg_basebackup option is specified with the BACKUP subcommand. |
--no-pg_basebackup | This is applicable only for full backup. Use this option to specify that pg_basebackup is not to be used to take a full backup.When taking a full backup, if the thread count in effect is only 1 , then the pg_basebackup utility is used to take the full backup unless the --no-pg_basebackup option is specified with the BACKUP subcommand. |
--parent { <backup_id> | <backup_name> } | Use this option to take an incremental backup. The parent backup is a backup taken prior to the incremental backup; it can be either a full backup or an incremental backup. <backup_id> is the backup identifier of a parent backup and <backup_name> is the user-defined alphanumeric name of a parent backup. |
--check | This is applicable only for incremental backup. Use this option to verify if the required MBM files are present in the BART backup catalog before taking an incremental backup. However, an actual incremental backup is not taken when the --check option is specified.The --parent option must be used along with the --check option. |
--checksum-algorithm | While taking a backup, you can specify one of the following values with the --checksum-algorithm option:--checksum-algorithm=MD5 (default) to generate MD5 checksum files.--checksum-algorithm=SHA256 to generate SHA256 checksum files.--checksum-algorithm=NONE to skip generating checksum files. |
Examples
The following code sample demonstrates using variables with the BACKUP
subcommand:
The following code sample displays the result of creating a full backup in the default tar format with gzip compression when the BACKUP
subcommand was invoked. Note that checksums are generated for the full backup and user-defined tablespaces for the tar format backup:
The following code sample displays information about the directory containing the full backup:
The following code sample displays information about the creation of a full backup while streaming the transaction log. Note that the -Fp
option must be specified with the BACKUP
subcommand when streaming is used as a backup method.
The following code sample displays the assignment of a user-defined backup name with the --backup-name
option:
The following code sample displays an incremental backup taken by specifying the --parent
option. The option -Fp
must be specified while taking an incremental backup as incremental backup can be taken only in plain text format.
The following code sample displays an incremental backup taken by specifying the --checksum-algorithm=NONE
option to skip generating checksum files.
First, the bart-scanner is started.
Then, an incremental backup is taken with the --checksum-algorithm=NONE
option to skip generating checksum files.
Note
To restore an incremental backup taken with the --checksum-algorithm=NONE
option, you must specify --disable-checksum while restoring.
Similarly, you can specify --checksum-algorithm=MD5
or --checksum-algorithm=SHA256
while taking an incremental backup if you want to generate MD5 or SHAD256 checksum files.