Editor’s note: Matt Marshall is editor of VentureBeat.

SILICON VALLEY – Oracle Corporation (Nasdaq" ORCL), the large software database company company, said Monday it will acquire the server company Sun Microsystems (Nasdaq: JAVA) for $9.50 a share, or about $7.4 billion. It brings together two iconic Silicon Valley powerhouse tech companies which have long shared a spiritual alliance, initially to resist dominance by Microsoft during the 1990s.

The marriage comes after speculation increased last week that such a deal might in the works, because it makes a lot of sense. Sun is struggling to find direction, and initial talks between Sun and I.B.M. fell through two weeks ago, when Sun rejected an offer from IBM to buy it for $9.40 a share. For Oracle, which has grown through acquisitions to have major offerings across the spectrum of enterprise software applications, an acquisition of Sun gives it a way to actually serve these applications seamlessly to companies through their data centers. As application delivery moves to the cloud, Oracle could also use technology Sun is developing in this area.

It raises big challenges for IBM and others. Oracle will compete in server hardware with IBM head-to-head, and Oracle probably prioritize Sun servers over competing products, including those from HP and Dell products. It may also favor Sun support for Oracle’s database products, and may neglect competing products from IBM.

It’s difficult not to see the imprint of Sun co-founder Scott McNealy on this deal. Reports two weeks ago suggested there was a split within Sun’s board about whether or not to take IBM’s offer, with McNealy reportedly taking a stance against the deal, and Sun CEO Jonathan Schwartz apparently favoring it. IBM, which has long been a fierce rival of Sun, may have looked less appealing as a partner than Oracle. McNealy, a Silicon Valley veteran, befriended Oracle’s leader Larry Ellison in the 1990s when the two waged a multi-year campaign against Microsoft, in which they accused it of being a predatory monopolist, and argued that it should be broken apart. And the relationship has continued: The image above, taken in 2005, shows Ellison showcasing a Sun server in an image peering over McNealy giving a speech.

This is also likely to be bloody. Some see this as a a cost-synergy play, where Oracle will slash most of the cost out of Sun and scoop up some of its dwindling revenue to boost its margins. Headcount reduction is likely.

“The acquisition of Sun transforms the IT industry, combining best-in-class enterprise software and mission-critical computing systems,” said Oracle CEO Larry Ellison. “Oracle will be the only company that can engineer an integrated system – applications to disk – where all the pieces fit and work together so customers do not have to do it themselves. Our customers benefit as their systems integration costs go down while system performance, reliability and security go up.”

Oracle’s offer is a 42 percent premium over Sun’s closing price of $6.69 on Friday. The deal values Sun at $5.6 billion, net of Sun’s cash and debt, the companies said in a statement.

Oracle pointed to two key software assets that will give it an advantage in serving customers: Java and Solaris. It said Sun’s programming language and software Java will be the most important software Oracle has ever acquired. Oracle Fusion Middleware, Oracle’s fastest growing business, is built on Java, and Oracle can now continue to invest in Java technology for the benefit of its customers, it said. Java is used by million of businesses. It powers billions of mobile phones and consumer electronics.

The Sun Solaris operating system, meanwhile, is the leading platform for the Oracle database, Oracle’s largest business. With Solaris, Oracle taps into a high-end server platform that enjoys a reputation for quality.

Oracle estimated Sun would contribute more than $1.5 billion to Oracle’s adjusted profit in the first year and more than $2 billion in the second year.

Sun said the board has unanimously approved the transaction. It is anticipated to close this summer, subject to Sun stockholder approval, certain regulatory approvals and customary closing conditions, the company said.