ABERDEEN, Scotland — This port city built of granite on the North Sea has taken a battering in recent years. Plunging oil prices hit the petroleum industry, which dominates the economy. Tens of thousands of jobs were slashed. Projects worth billions of dollars were sent back to the drawing board.

Oil executives here now speak with a relief similar to survivors of a fierce storm.

“I feel good about the North Sea, to tell you the truth,” Mark J. Thomas, North Sea regional president for the oil giant BP, said in an interview at the company’s offices near Aberdeen’s airport. “It is remarkably different than where we were even just a few years ago.”

The brighter mood masks what had been a difficult path for the energy sector around the world.

When oil prices fell, the industry scrambled to adjust. It initially relied on tried-and-true tactics: cutting jobs and investment. But then companies realized they had to go further, starting a far-reaching reworking of their businesses to embrace new technologies and construction methods to stretch each dollar just a little more.