Root on A string
no fifthx5465x
Dmaj9 is the D major 9 chord. Its notes are D, F♯, A, C♯ and E. A major seventh plus a ninth. The compact grip omits the fifth.
x5465x
Numbers show frets from the low E string to the high e string; x means don't play that string.
Every D, F♯, A, C♯ and E on the first 12 frets. The filled dots are the root, D. Build your own shape from any nearby group.
Other D chords
Other major 9 chords