Catalyzes the interconversion of D-lysine and L-lysine. Can also use arginine and ornithine, but not alanine. L-lysine = D-lysine kcat is 2.1 min(-1) for L-lysine. kcat is 1.7 min(-1) for D-lysine. kcat is 1.1 min(-1) for L-ornithine. kcat is 1.1 min(-1) for D-ornithine. Optimum pH is 9.0. Homodimer. Belongs to the alanine racemase family.