Catalyzes the interconversion of D-lysine and L-lysine. Has also high activity toward ornithine, and weaker activity toward alanine. Contributes to production of D-lysine and D-alanine for use as peptidoglycan components. L-lysine = D-lysine L-ornithine = D-ornithine kcat is 693 sec(-1) with L-lysine as substrate. kcat is 669 sec(-1) with D-lysine as substrate. kcat is 537 sec(-1) with L-ornithine as substrate. kcat is 447 sec(-1) with D-ornithine as substrate. kcat is 965 sec(-1) with L-alanine as substrate. kcat is 725 sec(-1) with D-alanine as substrate. Optimum pH is 9.0-10.0. Optimum temperature is 85-95 degrees Celsius. Cell wall biogenesis; peptidoglycan biosynthesis. Homodimer. Belongs to the alanine racemase family.