A measure of Oracle Corp.’s credit risk climbed on Wednesday after the database company posted a jump in spending on data centers and other equipment, raising fresh doubts about how quickly it can generate profit from its huge investments in artificial intelligence.

