Microsoft Corp.’s Web-based computing service will start offering Oracle Corp.’s database as an option as the companies cast aside a longstanding rivalry to attract businesses moving their software online.

Microsoft (Nasdaq: MSFT) will offer businesses using its Windows Azure cloud-computing service the ability to run Oracle’s (Nasdaq: ORCL) widely used database software, application-connecting middleware and Java programming tools, Microsoft Chief Executive Officer Steve Ballmer and Oracle co-President Mark Hurd said in a statement Monday.

Both companies are facing competition from nimbler rivals delivering computing over the Internet, including Google Inc., Amazon.com Inc. and Salesforce.com Inc. Microsoft is seeking new sources of revenue from online services as demand for personal computers slumps, and Oracle is shifting its focus to business software sold through online subscriptions rather than installed on customers’ own computer servers.

“Now our customers will be able to take advantage of the flexibility our unique hybrid cloud solutions offer for their Oracle applications, middleware and databases, just like they have been able to do on Windows Server for years,” Ballmer said in the statement. Ballmer and Hurd are hosting a conference call today to unveil the alliance.

The executives said the collaboration would lure customers seeking more technical compatibility between Microsoft and Oracle products. Oracle’s database, which will be upgraded later this year as a new version called 12c, competes with Microsoft’s own SQL Server. Companies using Microsoft’s Azure cloud service, which lets companies build and run programs online, will be able to put information into Oracle’s database.

Online Software

Oracle controlled 45 percent of the $28.2 billion worldwide database market in 2012, compared with 20 percent for International Business Machines Corp. and 18 percent for Microsoft, according to IDC.

Azure’s main competitor is Amazon Web Services, in a growing area called infrastructure as a service, which lets companies rent computing power, storage and database software via the Internet. That’s the fastest-growing part of the cloud market, according to Gartner Inc., which estimates sales in the market segment to surge by an average of 38 percent annually to $30.6 billion by 2017, from $6.17 billion last year.

Microsoft, which said in April that revenue from Azure and related software sales topped $1 billion annually, has pledged to match Amazon Web Services’ prices.

Oracle plans to support the software sold through Microsoft’s service and also will make its version of the open- source Linux operating system available through Azure.

Trash Talk

The alliance with Microsoft lets Oracle offer its customers the option of sticking with its database and application- connecting middleware at a time when businesses are moving more of their software to cloud-computing services. Oracle reported on June 20 that fiscal fourth-quarter software license and subscription sales grew just 1 percent, less than analysts had projected.

The two companies have a long history of competition stretching back to the dawn of personal computers in the 1970s. Oracle CEO Larry Ellison, who first publicized the alliance on his company’s earnings conference call last week, used to deride Redmond,

Washington-based Microsoft as a “convicted monopolist” after it was found guilty in federal court of illegally defending its Windows monopoly to squelch competition.

In 2000, Redwood City, California- based Oracle said it hired detectives to comb the trash of two organizations supporting Microsoft in its antitrust trial. Ellison added that he’d be happy to ship his garbage to Redmond for inspection.

Still, Microsoft and Oracle have cooperated before. Oracle’s database also runs on Windows, and developers using Microsoft’s Web services software can build applications using Oracle’s software tools.

Mending Fences

Ellison is mending fences with other rivals too. He said last week that Oracle would also announce deals with Salesforce.com and NetSuite Inc. — of which he’s a partial owner — to use the 12c database. Salesforce and NetSuite already run Oracle’s database to power their applications.

Oracle’s deal with Salesforce that Ellison mentioned last week comes after CEO Marc Benioff was scratched from a speaking spot at Oracle’s OpenWorld conference in 2011, leading Benioff to stage a mock protest before speaking at a nearby hotel.