LFCS · Question #142
When two databases are defined in slapd.conf, which of the following commands will provide a full dump of the second database?
The correct answer is A. slapcat -n 2. To dump a specific database in OpenLDAP when multiple are configured, the slapcat command is used with the -n option followed by the database number.
Question
Options
- Aslapcat -n 2
- Bslapcat -2
- Cslapcat -database 2
- Dslap_dumpall -name nameofdatabase
How the community answered
(25 responses)- A92% (23)
- B4% (1)
- D4% (1)
Why each option
To dump a specific database in OpenLDAP when multiple are configured, the `slapcat` command is used with the `-n` option followed by the database number.
The `slapcat -n <number>` command is used to dump the contents of a specific database instance identified by its index number as defined in the `slapd.conf` file, where '2' refers to the second database configured.
The `-2` option is not a valid or standard way to specify the second database with `slapcat`; the correct option for database number is `-n`.
The `-database` option is not a recognized argument for `slapcat` to specify a database by number; the `-n` option is used for this purpose.
`slap_dumpall` is not a standard OpenLDAP command for dumping databases, and the syntax `-name nameofdatabase` is incorrect for this context.
Concept tested: OpenLDAP database dump by number
Source: https://www.openldap.org/software/man.cgi?query=slapcat&apropos=0&sektion=8&manpath=OpenLDAP+2.4-Release
Topics
Community Discussion
No community discussion yet for this question.