Oracle and Microsoft stocks declined amid AI infrastructure spending and exposure to OpenAI.