Sample Exam Questions

From the objective of OSS-DB Exam Silver
S2.1 Installation (Usage of initdb command)

Sample Question


You want to use the initdb command to create a new database cluster. Select three options you can specify for the command.

  1. Name of the database cluster

  2. Directory where the database cluster is stored

  3. Port number for connecting over TCP/IP

  4. Encoding system for template database

  5. Locale of database cluster

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

Answer and Explanation

To create a new database cluster, you can use the initdb command. A typical example of the command for creating a database cluster with the ability to handle Japanese language is:

initdb --pgdata=/usr/local/pgsql/data --encoding=UTF8 --locale=C

This specifies the database cluster directory in /usr/local/pgsql/data with the --pgdata option (the -D option can also be used), the encoding of template database in UTF8 with the --encoding option (the -E option can also be used), and the locale of database cluster in the --locale option. It is important to understand that these three options greatly affect the behavior of the database.

PostgreSQL database clusters do not have a "name" concept, but rather are identified by a combination of the directory where they are stored and the port number where the server is running. However, the port number can be specified as an option in the program that starts the server (the postgres command), rather than as an attribute of the database cluster itself, so any port can be used.

So the correct answers are B, D, and E.