Private equity firm TPG and the Canada Pension Plan struck on Thursday the biggest leveraged buyout deal of this year, worth $4 billion, to buy prescription drug sales data provider IMS Health Inc.

The deal shows how much the financing markets and general optimism have improved. Private equity firms were shut off from striking traditional LBOs after the credit crisis limited access to cheap debt, but in the past few months, deal flow has been picking up again.

Excluding debt, the $22-a-share cash deal is the biggest leveraged buyout since Bristol-Myers Squibb Co sold its ConvaTec unit to Avista Capital and Nordic Capital in August 2008 for $4.1 billion, according to data from Thomson Reuters.

The deal has fully committed financing, consisting of equity to be invested by TPG and the Canada Pension Plan, and debt financing from Goldman Sachs Group Inc.

Shares of IMS, which last month confirmed it was exploring strategic alternatives, soared almost 24 percent to $20.82 in midday trading.

The deal represents a 31 percent premium on the share price on Wednesday, and a 50 percent premium on the closing share price on Oct. 16, the day before IMS said it was considering its strategic alternatives.

IMS attracted interest from a number of rival private equity firms including Silver Lake and BC Partners, which submitted a joint bid, a source previously told Reuters.

Nielsen Co, the market research firm formerly known as VNU NV, had tried to buy IMS in 2005, but walked away from the deal amid pressure from shareholders.

It had been expected that the company would not be sold to a healthcare firm, sources previously said. IMS provides sensitive market data to many competing health care companies, so IMS feared it would lose customers if it aligned with one corporate buyer, sources said.

The deal follows a spate of deals in the wider healthcare and pharmaceuticals industry, such as Wyeth's $68 billion union with Pfizer Inc.

IMS was advised by Deutsche Bank while the private equity buyers were advised by Goldman, Sachs & Co., Bank of America Corp's BofA Merrill Lynch, Barclays Plc's Barclays Capital, Evercore Partners, and JPMorgan Chase & Co.

(Reporting by Megan Davies, additional reporting by Paritosh Bansal, Pav Jordan and Jessica Hall; Editing by Gerald E. McCormick and Maureen Bavdek)