nerdexam
LPI

117-301 · Question #104

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. See the full explanation below for the reasoning.

Question

When two databases are defined in slapd.conf, which of the following commands will provide a full dump of the second database?

Options

  • Aslapcat -n 2
  • Bslapcat -2
  • Cslapcat -database 2
  • Dslap_dumpall -name nameofdatabase

How the community answered

(33 responses)
  • A
    82% (27)
  • B
    12% (4)
  • C
    3% (1)
  • D
    3% (1)

Community Discussion

7
Thiago A.Thiago A.Dec 27, 2025

Answer is A, slapcat -n 2. The -n flag selects the database by index number, and the indexing in OpenLDAP starts at 0 for the implicit frontend/config database, so the first explicitly defined database in slapd.conf is index 1 and the second is index 2. Check man slapcat section OPTIONS, the -n dbnum entry spells this out directly. Options B and C are fabricated syntax that slapcat does not recognize, and slap_dumpall in option D is not a real command on any OpenLDAP system you will ever touch.

9
Toby R.Toby R.Jan 14, 2026

Saw this exact scenario on mine, they worded it as "second database defined in slapd.conf" and I almost second-guessed myself into B because it looked cleaner, but the -n flag is the right switch for specifying the database number so A is the one. Slapcat -n 2 gets you that full LDIF dump of the second database, no tricks to it.

5
Devraj B.Devraj B.Jan 16, 2026

I almost went with C thinking slapcat took a long-form flag like -database, but then I remembered that slapcat uses -n to select the database by its zero-based or sequential index in slapd.conf, and -n 2 targets the second database definition, which locks in A as the only valid syntax here.

4
Bao N.Bao N.Jan 6, 2026

Burned this one on my first practice run, the -n flag is everything.

2
Thiago A.Thiago A.Jan 6, 2026

The -n flag saves you from those silent clobbers, but pair it with a test run using echo cp to see exactly what rsync would touch before you commit to anything.

0
Hiroshi T.Hiroshi T.Dec 31, 2025

I remember freezing on this one for a second because I kept confusing the -n flag with verbose levels from other tools, but the slapcat man page is clear: -n selects the database by number in the order they appear in slapd.conf, so -n 2 dumps the second database. Saw two or three people in my study group lose points on this because they guessed -database 2 thinking it followed a GNU long-option style, but that flag simply does not exist.

1
Devraj B.Devraj B.Jan 2, 2026

Worth adding for anyone drilling 202-450 objective 210.3: the safer habit on exam scenarios and in production is pairing your slapcat run with the -b flag and the actual suffix, because counting database positions in slapd.conf is fragile the moment someone inserts a new database entry above yours and your -n 2 now points somewhere unexpected.

0
Full 117-301 Practice