Oracle shed about 21,000 roles globally in the last year as the US technology giant reshapes its business around artificial intelligence (AI), the firm’s latest annual report shows.