Oracle Corp reported quarterly profit above Street expectations as the world's No. 2 business software maker posted an unexpected increase in sales of its programs, sending its shares up more than 4 percent.

The company, led by billionaire Larry Ellison, also said it expects to win unconditional European Union clearance to close its $7 billion acquisition of Sun Microsystems Inc in January. EU regulators this week warmed to the deal after months of scrutiny.

Thursday's earnings report by the world's biggest maker of database software stoked hopes that technology spending by businesses is on the mend after it collapsed a year ago in the recession. Oracle, which reports earnings a month ahead of its peers, is seen as an industry bellwether because of its size.

The environment is gradually getting better. I don't think this means we are back to the races, but it's more predictable, said ISI Group analyst Heather Bellini.

Oracle's earnings report lifted its stock by as much as $1, or 4.3 percent, to $23.88 after hours.

The news came as smartphone maker Research in Motion Ltd posted better-than-expected results, and followed strong earnings from design software maker Adobe Systems Inc on Wednesday. The reports stoked hopes that technology spending is on the mend after collapsing a year ago in the recession.

Global Equity Research analyst Trip Chowdhry said companies are starting to invest in new projects that they had abandoned during a 1-1/2-year rough patch for the IT sector.

We have reached a point where they cannot cut any further, Chowdhry said.

The Redwood City, California software maker posted a second-quarter profit, excluding items, of 39 cents per share, above the average Wall Street forecast of 36 cents, according to Thomson Reuters I/B/E/S.

Sales of new software licenses during the second quarter ended November 30 rose 2 percent from a year earlier. Three months ago, the company forecast that they would be flat to down 10 percent.

Investors focus on new software sales because they are a forward indicator of Oracle's profit. Customers generally sign maintenance contracts when they buy software, which locks in predictable, recurring revenue.

Its adjusted operating margin was 49 percent, the highest ever for its second quarter, up from 46 percent a year earlier.

Oracle said in a statement that it was winning share from rival SAP AG in every region of the world where the two companies compete in the market for business management software.

Kim Caughey, senior analyst with Fort Pitt Capital Group, said that Oracle's growth may not be coming at SAP's expense.

Higher revenues lead you to believe they are holding their own at a minimum and maybe taking share, she said.

Oracle's net income rose 12 percent to $1.5 billion, or 29 cents per share, from $1.3 billion, or 25 cents per share, a year earlier.

(Reporting by Jim Finkle; Additional reporting by Bill Rigby; Reporting by Jim Finkle; Editing by Gary Hill and Richard Chang)