Oracle has laid off nearly 20 per cent of its workforce to free up billions of dollars in cash for AI.