Sample Exam Questions

From the objective of OSS-DB Exam Silver
- Operation management - backup method

Sample Question

1.47

Choose the most appropriate description about PostgreSQL backup methods.

  1. The pg_dumpall command executes the pg_dump command internally.
  2. The pg_basebackup command executes the pg_dump command internally.

  3. Backup created with the pg_dump command can be used as a base backup for point-in-time recovery (PITR).
  4.  When setting up streaming replication, first obtain a backup of the entire database cluster with the pg_dumpall command.

  5. Depending on the option, backups created by the pg_dump command have multiple output files.

※This sample exam is different from those that appear in the actual OSS-DB Exam.
2019/05/30

Answer and Explanation

Depending on the purpose, there are several ways to perform backups of databases with PostgreSQL.

pg_dump and pg_dumpall are commands to obtain a logical backup of the database, that is, output in a SQL format. pg_dump backs up only one specific database in the database cluster, but pg_dumpall gets a backup of the entire database cluster. Internally, pg_dumpall executes the pg_dump command for each individual database.

pg_dump has various output formats and can be specified with the -F option. The default p option is text format, t option is TAR format, c option is compressed archive format. With these three options, one output file is created for one database, but with the d option added in PostgreSQL 9.1, one compressed file is created for each table.

Both point-in-time recovery and streaming replication need to make a backup of the entire database cluster at the start, but in this case we will get a physical copy of the database's file, not a logical backup by pg_dump.

pg_basebackup is a command added in PostgreSQL 9.1. This creates a physical copy of the files in the directory under the database cluster and can be used as a base backup for PITR or streaming replication. Because it creates a physical copy, it does not execute pg_dump internally.

 

Therefore, the correct answers are A and E.