After one false start, weeks of speculation and roller-coaster swings in its share price, the company once synonymous with the rise of the Internet has finally landed an attractive-looking buyer.

Faltering Sun Microsystems, pulling a rabbit out of a hat, rallied from the collapse of talks with International Business Machines Corp to hawk itself to Redwood City, California-based software giant Oracle Corp.

Many at the flagging server-and-software company were just glad it appears to be over. A deal with Oracle may be a better fit than IBM for the troops at Sun, which -- despite its roller-coaster history -- still inspires fierce loyalty among its own ranks and customers.

We're sort of relieved, said a 39-year-old hardware manager and 12-year veteran of the company. There was a lot of bad press with Sun being up for sale, desperately looking for a buyer. It hurt business and it hurt earnings.

Where IBM conjured up images of a mass of navy-blue suits, Sun employees see Oracle as a compatriot.

The employees run in the same social circles as Sun employees, the manager said.

Few companies embody the rise and fall of dot-com as much as Sun, whose name stands for Stanford University Network and whose campus resembles that of the college, with a palmtree-lined drive leading up to a grassy courtyard and clocktower.

If the $7 billion deal worth $9.50 a share is approved by shareholders and regulators, it could rescue Sun's earnings and bolster Oracle's position against rivals such as Cisco Systems, IBM, and Hewlett-Packard Co.

We're calling this the clash of the titans year, said Brent Bracelin, an analyst with Pacific Crest Securities.

By buying Sun at a sky-high premium, 10 cents more than what sources have said IBM offered and therefore likely to be attractive to shareholders, Oracle would bring an end to the go-it-alone warhorse identity of a company that shed virtually its entire stock value in under a decade.

THE END OF A BRILLIANT ERA

Sun has struggled since the dot-com bust in the early 2000s and in November said it would lay off up to 6,000 of its staff, or 15 to 18 percent of its workforce.

Its shares peaked in 2000 at just under $260, but were only at about $9 even after a 37 percent surge on Monday. They closed at $9.21 on Tuesday, up less than 1 percent.

But in headier days, the company -- led by firebrand co-founder and Harvard-Stanford alumnus Scott McNealy -- took on Microsoft.

McNealy -- who grew Sun from a Silicon Valley start-up to a globe-spanning firm with 38,000 employees -- called his rival's proprietary Windows software a giant hairball and touted his own open-software philosophy.

He lost. Windows went on to dominate the PC platform and Microsoft eclipsed the firm in size and market share. But that same fight bred comradeship between McNealy and Oracle Chief Executive Larry Ellison, as the two battled a common enemy.

Though acquisitions often mean layoffs, and this one will be compounded by one of the worst economic crises in history, many felt their jobs would be safer with Oracle than with IBM.

With IBM there was much more concern about layoffs because of the amount of overlap, said a 30-year-old hardware engineer who has been with the company 3-1/2 years.

But one 20-year veteran was more cautious, saying it was unclear what Ellison meant to do with Sun's hardware business.

The first question Oracle can ask is ... why not make everything Intel-compatible? he said, wondering aloud if Oracle might sell the hardware division.

Bracelin does not think that will happen.

The only way that Oracle would be able to generate that meaningful of a level of profitability is if they kept a portion of the hardware business and more importantly the three to four billion dollars in maintenance on that hardware.

(Reporting by Clare Baldwin; Editing by Edwin Chan, Gary Hill)