It's no secret that Oracle (NASDAQ:ORCL) isn't buying Sun Microsystems because it wants Sun's bread-and-butter server and storage hardware business. Rather, Oracle's interest has everything to do with Sun's valuable software assets. These include the Java programming language, the MySQL database platform, and the Solaris operating system used in Sun's servers, among many other products.

Not only could these software assets add to the reach of Oracle's software empire, which has grown by leaps and bounds thanks to a massive buying spree, a lot of them could be packaged with Oracle's database software. Seen in that light, the $5.6 billion that Oracle is spending on Sun (net of cash and debt) doesn't sound like too much, even if the hardware business isn't a great asset.

Hardware headaches
Only problem is, based on Sun's latest earnings report (released on Friday), hardware doesn't look like an asset at all, but a big-time liability. While Sun's overall revenue decline of 31% from the year-ago period was bad enough, product sales fell by 38% -- and this number includes a software business (17% of product billings) that actually showed modest growth. Considering that hardware carries lower gross margins than the better-performing software and services businesses, it was clearly the biggest culprit behind the $147 million loss reported by Sun for the quarter.

Can this weakness be chalked up to the economy? Not really. Sun's competitors in the server and storage markets are dealing with the same issues, yet none of them fared as poorly. HP (NYSE:HPQ) saw a 23% annual decline in its Enterprise Storage and Servers division last quarter, while IBM (NYSE:IBM) saw a 26% decline in its Systems and Technology division (dominated by server and storage sales). Storage giant EMC (NYSE:EMC) reported a 19% decline in hardware revenue, while Dell (NASDAQ:DELL) reported a 19% drop in its server and networking sales, and a 20% drop in storage sales. Among IT hardware giants, Sun's performance puts it in a league of its own … and not in a good way.

And if you take a closer look at Sun's competitive standing, the story gets even worse. During the current downturn, IDC has reported that sales of servers running the UNIX operating system -- of which Sun's Solaris is a type -- have actually been outperforming the overall server market, as have sales of systems running processors other than the x86 chips offered by Intel  (NASDAQ:INTC) and AMD  (NYSE:AMD) -- and most of Sun's servers use the company's own UltraSPARC processors instead of Intel or AMD gear. Based on those facts, Sun should be outperforming the broader server market. Yet the exact opposite is happening.

The one explanation for this is that Sun's UNIX server market share has been taking a nosedive … and a culprit's easy to find. During its latest earnings report, IBM claimed that they gained UNIX market share for the fifth straight quarter and doubled their "competitive displacements" of Sun hardware from Q1. With IBM's System product line, which competes head-on with Sun in the UNIX space, showing only a 13% revenue decline, I'd say it's not hard to believe them.

Could a white knight emerge?
Fortune reported last week that Oracle might end up dealing Sun's hardware business to HP. But looking at the awful shape that the former is in, and the product-line conflicts it would cause with HP's existing products, HP might just decide to hold off. And if Oracle wants to keep Solaris, which CEO Larry Ellison called "the heart" of Sun's business, then it'll be even tougher for HP to pull the trigger. The same issues would apply to a deal with IBM. Dell might be a better fit in some ways, but selling the kind of high-end, proprietary equipment that Sun offers isn't a historical strength of theirs.

Oracle may hope that its days as a server and storage manufacturer end quickly, but it's quite possible that any attempts to sell Sun's hardware business will end up looking like Motorola's failed attempts to sell its handset division last year. If that's the case, Oracle will be stuck with a business that's been bleeding cash and losing market share, and which alienates hardware partners such as HP and Dell, who are now competitors.

All of a sudden, that $5.6 billion investment looks pretty costly.

Fool contributor Eric Jhonsa wouldn't mind borrowing Larry Ellison's yacht for a few days, but he has no position in any of the companies mentioned. Dell and Intel are Motley Fool Inside Value selections. Try any of our Foolish newsletters today, free for 30 days. The Fool's disclosure policy would also be open to a pleasure cruise on Ellison's yacht