Oscillation and spectral properties of self-adjoint differential operators