Just to specific answer the question of what did Oracle gain, I believe they made back all of their investment across their Exadata line of products which were sold to large commercial enterprises, running on custom SPARC silicon.
Yeah, this. Larry bought SUN to complete his vertically-integrated stack: "You want Enterprisey Business App X? We sell you the whole server! No more worrying about hardware requirements, just roll this box in your datacentre and configure away; we guarantee it will work great." That, and ensuring their beloved Java stack (on which they had bet the farm) would survive. Everything else (MySQL, OpenOffice, VirtualBox, etc etc) was just bonus.
The acquisition made a lot of sense. I was a lowly minion in Oracle when talks between SUN and IBM fell apart, and I told everyone I met "it would be great if we bought them"... After the acquisition, I expected MySQL to die a horrible death and actually it kinda survived (although barely), which I thought was somewhat magnanimous. I was hoping they would just offload some of the stuff that simply didn't make sense (Oracle selling word-processors and chat clients, really...?), but sadly some busybody repackaged them into embarrassing products. And for years they went "business as usual" for Java, actually re-igniting development in a suspiciously proactive manner, which was great... until the day the license changed.
You sure about that SPARC bit? According to [0] v1 ran on HP commodity hardware, and the subsequent history repeatedly mentions intel xeon processors...
"it depends". The v2 box we had back in ~2009 was Intel and Linux on the compute side but SPARC and Solaris for the storage side. It had horrible throughput though for the 1st year or so that we owned it, but it eventually got better after some software upgrades. All the equipment was Sun branded though (except for the Infiniband switches, I think those were Mellanox, but it's been more than a decade so don't quote me)