Oracle has been trying for years to shift from selling software installed on corporate customers’ gear the old way to delivering it over the internet. Yet in its most recent quarter, the company said the cloud division accounted for less than 10 percent of sales. Buying NetSuite, one of the first cloud-services companies, will help Oracle compete against the likes of Salesforce.com Inc., Microsoft Corp. and SAP SE.

“NetSuite is really pioneering cloud and this will certainly add to Oracle,” said Bill Kreher, an analyst at Edward Jones & Co. “I think acquisitions are certainly consistent with the company’s long-term pedigree and strategy. You’ve got to pay for that type of growth.”

The deal had been rumored for months, not just because of its inherent logic but because the relationship between Oracle and NetSuite goes back decades. Oracle co-founder Larry Ellison has been a NetSuite investor since he co-founded the company with Evan Goldberg in 1998. Ellison and his family own about 45.4 percent of NetSuite’s common stock, according to a recent company filing. Zach Nelson, NetSuite’s CEO, ran Oracle’s marketing operations in the 1990s.

Oracle is paying $109 a share, a 19 percent premium over NetSuite’s closing share price Wednesday. The merger is the latest in a slew of business software acquisitions. Earlier this year, Microsoft agreed to buy LinkedIn for $26.2 billion. Meanwhile, Salesforce spent more than $2.5 billion to buy Demandware, which sells cloud-based e-commerce software, and Symantec said it would purchase Blue Coat Systems Inc. for $4.65 billion.

The industry is ripe for deals as big companies, bolstered by strong balance sheets, search for growth -- and smaller companies look for new paths to expansion, according to Abhey Lamba, an analyst at Mizuho Securities USA Inc.

Salesforce could be an eventual target, said Anurag Rana, an analyst with Bloomberg Intelligence, though there are few buyers that are large enough to snap it up. Workday Inc., the cloud-based software company that provides tools for human resources could also be in play, Rana said, and Microsoft could be a buyer.

There was a time when Oracle executives came under fire for not doing enough to leverage the cloud’s potential-- even as Amazon.com Inc. embraced the technology wholesale. Yet the company has gotten cloud religion, revamping its product lineup in the past several years and stepping up acquisitions.

In May, Oracle announced a deal to buy Opower Inc., a cloud-services company that assists utilities, for $532 million, and in the same week it paid $663 million for Textura Corp., which targets the construction industry. The NetSuite acquisition represents a serious ramping up and is Oracle’s second largest after its hostile $10.3 billion takeover of PeopleSoft Inc. in 2005.

A group of independent Oracle directors -- excluding Ellison -- helped evaluate and negotiate the deal with NetSuite. For NetSuite, approving the deal will mean getting clearance that sidesteps the large stockholder. The company said a majority of shares not owned by Ellison and his family -- or by directors and executive officers -- must vote in favor of the deal for it to be acquired.

NetSuite was one of the first companies to distribute business applications over the internet. It had a market capitalization of $7.37 billion before the deal was announced. In May, NetSuite unveiled software that unifies various accounting functions -- for example, billing, revenue recognition, orders and subscriptions -- into one system. NetSuite has more than 30,000 customers, the bulk of which are small and mid-size companies.

The company’s sales growth has been consistently strong -- expanding at a rate of more than 30 percent for the past several quarters. In its last report, San Mateo, California-based NetSuite posted both sales and adjusted earnings that topped analysts estimates.

NetSuite’s shares surged 9.1 percent Wednesday amid rumors of an agreement. Oracle shares were up less than 1 percent at $41.41 at 2:06 p.m. in New York Thursday. NetSuite shares surged 18.1 percent to $108.13.