Optical Feshbach resonances of alkaline-earth-metal atoms in a one-or two-dimensional optical lattice