Catalyzes the interconversion of L-alanine and D-alanine. Provides the D-alanine required for cell wall biosynthesis. L-alanine = D-alanine Optimum pH is 8-10. Optimum temperature is 50 degrees Celsius. Amino-acid biosynthesis; D-alanine biosynthesis; D-alanine from L-alanine: step 1/1. Cell wall biogenesis; peptidoglycan biosynthesis. Monomer but homodimer in the presence of the substrate. Belongs to the alanine racemase family.