Money talks, so if big investors start pouring money into alternative energy, the oil industry will become history. One can only hope...
They have been doing it for a long time, they have poured a lot of money and effort into finding alternative energy sources over the past decades and as a result, we have wind power, solar power, or electric cars. But the problem is that they are too expensive and the technology is still too limited. So I don't think the era of crude energy like oil and gas will be a thing of the past anytime soon, maybe even ever.
The human world has depended on these primitive energy sources for thousands of years, not just a few hundred. Therefore, it would probably take millennia to replace them, not centuries or decades.