Oracle has agreed to buy medical-records systems provider Cerner for about $28.3 billion, a deal that would add a broad customer…

Oracle Corp. agreed to acquire medical-records systems provider Cerner Corp. for about $28.3 billion, a deal that would add a broad customer base in the health care industry to bolster the software maker’s cloud-computing and database businesses.

The all-cash transaction, Oracle’s biggest-ever deal, will see Oracle pay $95 a share, the companies announced Monday in a statement. The price represents a 20% premium over Cerner’s market value last Thursday, before the deal talks first became public. Oracle shares slid 4.3% at 1:40 p.m. Monday in New York, while Cerner shares gained less than 1% to $90.57.

Oracle Chief Executive Officer Safra Catz said the acquisition should be “immediately accretive to Oracle’s earnings” on an adjusted basis in the first full fiscal year after closing and contribute “substantially more to earnings in the second fiscal year and thereafter.” The transaction is expected to close next year, the companies said.