Oracle Corp. agreed to buy Micros Systems Inc. for $5.3 billion as Chief Executive Officer Larry Ellison seeks to reignite slowing growth by adding software for hotels and restaurants.

Micros stockholders will get $68 a share in cash, 18 percent more than the closing price on June 16, a day before Bloomberg reported the companies were near a deal. Net of Micros’s cash, the value is $4.6 billion, Redwood City, California-based Oracle said in a statement today. Oracle came close to acquiring Micros six years ago only for the deal to fall through at the last minute.

Oracle, which has acquired about 100 companies in the last decade, has had the incremental revenue gains accrued through those deals dry up. With that and the company’s late entry to the cloud-computing market, sales have declined or gained less than 5 percent in each of the past 11 quarters as customers gravitate to rivals selling Internet-based software. Last week, Oracle posted fiscal fourth-quarter profit and sales that missed analysts’ estimates.

“Such an acquisition would be a net positive for Oracle, as the company continues to round out its commerce platform by adding high quality, growth assets at reasonable valuations,” said Raimo Lenschow, an analyst at Barclays Capital Inc., in a June 17 note to clients.

Micros shares closed at $65.77 in New York on June 20, and Oracle fell 4 percent to $40.82.

The deal is expected to close in the second half, the companies said. The acquisition would be Oracle’s largest since the $5.7 billion takeover of Sun Microsystems Inc. in 2010, data compiled by Bloomberg show.

Based in Columbia, Maryland, Micros sells point-of-sale systems for hotels, restaurants, and retailers.

Six years ago, Micros Chairman Tom Giannopoulos, who was CEO at the time, flew from Maryland to California to sign a deal, only to have the transaction fall through, according to one person with knowledge of the matter.

Dealmaking in the technology space is accelerating as established software companies try to navigate the shift to cloud computing and fend off challenges from new competitors. This month, SanDisk Corp. agreed to buy Fusion-io Inc., which provides storage to Facebook Inc. and Apple Inc., for about $1.1 billion.

Oracle has long been an acquisition machine under Ellison, who is worth $46.6 billion and ranks eighth on the Bloomberg Billionaires Index. He led Oracle Team USA to victory in the America’s Cup last year and agreed in 2012 to buy most of the Hawaiian island of Lanai for an undisclosed sum.

As rivals including Salesforce.com Inc. that specialize in cloud computing have risen to the fore, Oraclehas turned to purchasing firms that make software for specific industries, such as retail and hospitality, to diversify its offerings.

Oracle has spent $50 billion to acquire about 100 companies in the past decade. Of those, more than 20 have been geared at specific industries, including the 2010 acquisition of clinical- trial software maker Phase Forward Inc., and purchases of retailer-software makers ProfitLogic Inc. and Retek Inc. in 2005. In December, Oracle agreed to buy marketing-software maker Responsys Inc. for about $1.5 billion to court chief marketing officers.

Micros’s revenue totaled $1.29 billion in its fiscal 2013 and it has been growing in the low double-digit range for the past three years. The company is projected to generate $1.37 billion in fiscal 2014, which ends late this month, according to data compiled by Bloomberg.

Micros, which had more than 6,300 employees as of 2012, said on its website that more than 330,000 of its systems are installed in table and quick service restaurants, motels, hotels, casinos and other locations in more than 180 countries. Peter Altabef, a former Dell Inc. executive, has been CEO of Micros since January 2013 and Giannopoulos is now the chairman.