Catalyzes the interconversion of L-alanine and D-alanine. Likely plays an important role in supplying D-alanine, which is an indispensable constituent in the biosynthesis of bacterial cell-wall peptidoglycan. L-alanine = D-alanine Amino-acid biosynthesis; D-alanine biosynthesis; D-alanine from L-alanine: step 1/1. Belongs to the alanine racemase family.