Oracle restructures its workforce, laying off thousands while shifting focus towards artificial intelligence and growing its cloud services.