The acquisition will reshape the hi-tech landscape, with Oracle, the world's second-largest business software maker, moving into the hardware business.
Sun – which has more than 500 staff at Linlithgow in West Lothian – is the top player in the $17bn high-end computer-server market.
Competition authorities in China and Russia have yet to approve the takeover deal.
Oracle promised in December to keep the market open for others to make storage engine software for Sun's MySQL database and to boost investment in the unit after the European Commission began investigating the deal.
The company also pledged to set up a separate customer advisory board of MySQL users. Those concessions satisfied Europe's competition watchdog that the deal will not distort the market.
EU's competition commissioner Neelie Kroes said yesterday: "I am now satisfied that competition and innovation will be preserved on all the markets concerned. Oracle's acquisition of Sun has the potential to revitalise important assets and create new and innovative products."
The commission said its decision took into account Oracle's public pledges and that the company had already implemented some of its promises. The EU added there was a competitive alternative to MySQL.
But the decision did not satisfy some opponents.
Florian Mueller – a spokesman for the founder of MySQL, Michael Widenius, who is strongly opposed to the deal – said the EU executive's decision was wrong.
"It's not based on hard facts… It should not serve as the basis for decisions taken by other regulators because it would set an awful precedent for merger control in connection with open source and other IT business models," Mr Mueller said.