On the Ornstein-Uhlenbeck operator in L2 spaces with respect to invariant measures