Oracle is to buy BEA Systems after the database company raised its previous bid.

The middleware vendor was sold for about US$8.5 billion (£4.34 billion), a substantial increase on Oracle's previous offer of $6.7 billion (£3.42 billion).

Oracle hopes that acquiring middleware vendor BEA will allow it to improve its own middleware suite, Fusion.

That middleware is key to helping customers migrate their systems to SOA, Oracle CEO Larry Ellison said last month.

With Fusion already able to link to BEA's WebLogic Java application server, the deal is likely to speed Oracle's adoption of Java-based middleware, the company claimed. Oracle's customers have been telling it for years to buy BEA, it added.

However the members of BEA's board were less sold on the idea: They turned down an offer from Oracle of $17 per BEA share in October, saying it "significantly undervalues BEA." Oracle in turn dismissed the BEA board's counter-offer of $21 per share as "impossibly high."

But on Wednesday the companies split the difference, and BEA's board announced it had unanimously approved Oracle's latest offer of $19.375 in cash per BEA share.

The board accepted only after spending several months looking for other ways to maximise shareholder value, said BEA's chairman and CEO Alfred Chuang.

The companies expect to close the deal by mid-year, subject to the approval of regulators and BEA shareholders.