  We used the APEX telescope to observe the 372 GHz
o-H$_2$D$^+(J_{K_a,\,K_c}=1_{1,\,0}-1_{1,\,1})$ line towards three prestellar
cores and three protostellar cores in Orion B9. We also employed our previous
APEX observations of C$^{17}$O, C$^{18}$O, N$_2$H$^+$, and N$_2$D$^+$ line
emission, and 870 $\mu$m dust continuum emission towards the target sources.
The o-H$_2$D$^+$ line was detected in all three prestellar cores, but in only
one of the protostellar cores. The corresponding o-H$_2$D$^+$ abundances were
derived to be $\sim(12-30)\times10^{-11}$ and $6\times10^{-11}$. Two additional
spectral lines, DCO$^+(5-4)$ and N$_2$H$^+(4-3)$, were detected in the observed
frequency bands with high detection rates of $100\%$ and $83\%$, respectively.
The Orion B9 cores were found to be consistent with the relationship between
the o-H$_2$D$^+$ abundance and gas temperature obeyed by other low-mass dense
cores. The o-H$_2$D$^+$ abundance was found to decrease as the core evolves.
The o-H$_2$D$^+$ abundances in the Orion B9 cores are in line with those found
in other low-mass cores and larger than derived for high-mass star-forming
regions. The higher o-H$_2$D$^+$ abundance in prestellar cores compared to that
in cores hosting protostars is to be expected from chemical reactions where
higher concentrations of gas-phase CO and elevated gas temperature accelerate
the destruction of H$_2$D$^+$. The validity of using the
[o-H$_2$D$^+$]/[N$_2$D$^+$] ratio as an evolutionary indicator, which has been
proposed for massive clumps, remains to be determined when applied to these
target cores. Overall, as located in a dynamic environment of Orion B, the
Orion B9 filament provides an interesting target system to investigate the
deuterium-based chemistry, and further observations of species like
para-H$_2$D$^+$ and D$_2$H$^+$ would be of particular interest.
