Sample Exam Questions

From the objective of OSS-DB Exam Silver
- Operation and Management - Installation method
(How to use initdb command)

Sample Question

1.07

Choose three correct statements regarding the initdb command.

  1. It should be run as root user on Linux /UNIX.
  2. If the database cluster exists in the specified directory, it will be initialized, so extra care is required when being executed.
  3. You can specify the default character set of the database.
  4. You can specify the default locale for the database.
  5. The password of the superuser for the database can be set.

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

Answer and Explanation

To create a new database cluster use the initdb command. Only the user who executed initdb will have access rights to the database cluster to be created, so the user who is the administrator of the database must execute it, but it can not be executed as the root user, even if you try, you will be rejected.

The database cluster is created in the directory specified by the -D option, the - pgdata option, or the PGDATA environment variable. If the specified directory does not exist, it will be created, but if the directory already exists, the contents must be empty. If there is even one file, an error will occur.

The default character set of the database is specified with the -E option or the --encoding option, and the default locale is specified with the - local option.

With the --pwfile option, you can specify the file in which the password of the superuser is described, or you can set it by inputting the password of the superuser by the -W option and - pwprompt option.

Therefore, the correct answer is C, D and E.