By Aaron Tilley

Oracle Corp. said quarterly sales rose 2% as the business software company navigates changing customer spending habits.

Businesses are broadly speeding up their shift to cloud-computing while curtailing spending on in-office tools.

The company on Thursday posted sales for the August quarter of $9.37 billion and earnings of 72 cents a share. Wall Street expected $9.17 billion in sales and earnings of 67 cents a share, according to analysts surveyed by FactSet.

Oracle, best known for its in-office database products, has been trying to remake itself after falling behind as many businesses embraced cloud-computing, the lucrative business where vendors offer remote hardware and software services.

The Silicon Valley veteran also has become part of the race to acquire at least parts of video-sharing app TikTok whose owner, Beijing-based ByteDance Ltd., has come under U.S. government pressure to sell. A deal would add a marque name to Oracle's cloud effort as it tries to catch up with market leaders Amazon.com Inc. and Microsoft Corp., which is also vying for TikTok.

"Our cloud applications businesses continued their rapid revenue growth, " Oracle Chief Executive Safra Catz said. "I have a high level of confidence that our revenue will accelerate as we move on past Covid-19."

The pandemic has driven many companies to embrace digital tools on an accelerated timeline. That has lifted the fortunes of cloud-service providers such as Amazon and Microsoft, as well as the companies that run on the cloud, such as Salesforce.com Inc., which last month raised its full-year outlook, and Zoom Video Communications Inc., which lifted its forecast last week.

Oracle has enjoyed some of the benefits, but remains weighed down by its legacy activity of selling databases that companies run in-house.

Oracle shares have risen around 8% this year, far less than its larger cloud-computing competitors. The stock rose more than 4% in after-hours trading following its earnings release.

Write to Aaron Tilley at aaron.tilley@wsj.com