Sample Exam Questions

From the objective of OSS-DB Exam Silver
- Operation and Management - installation method (how to use database management command)

Sample Question

1.04

Choose three correct statements about the pg_ctl command.

  1. To create a new database cluster, execute pg_ctl initdb.
  2. Execute pg_ctl shutdown to stop the database.
  3. To restart the database, execute pg_ctl restart.
  4. Use the -D option to specify the name of the database to be started or stopped.
  5. Use the -m option to specify how to handle sessions during database connection when stopping. 

※This sample exam is different from those that appear in the actual OSS-DB Exam.
2018/04/06

Answer and Explanation

By using the pg_ctl command, you can perform various controls such as initializing the database cluster and ending/starting. You can write a subcommand that specifies what to execute immediately after pg_ctl, and then you can write various options.
It is possible to create a new database cluster without using pg_ctl or by directly executing the initdb command, but you can do the same by specifying init or initdb as pg_ctl as a subcommand.
To start the database cluster, specify start, stop to stop, restart to restart as a subcommand.
Specify the directory where the database cluster to be processed is in the -D option. If omitted, the directory specified by the environment variable PGDATA is used.
When shutting down the database cluster, you can specify the exit mode with the -m option depending on what you want to do with the session you are connected to. There are three types of exit modes, smart, fast, and immediate, and smart was the default until PostgreSQL 9.4, but fast is the default from 9.5.

Therefore, the correct answer is A, C, E.