Oracle Corp. agreed to purchase as much as 2.8 gigawatts of fuel-cell power from Bloom Energy Corp. to supply data centers for artificial intelligence work.