BENGALURU, Oct 5 (Reuters) - Indian shares were little changed on Tuesday after opening lower, as gains in energy and metal stocks offset losses in tech and pharma, with investors expecting global concerns over rising oil prices to keep markets volatile.

The NSE Nifty 50 index was down 0.02% at 17.688.6, while the S&P BSE Sensex was down 0.1% at 59,240.3 by 0506 GMT.

Energy stocks advanced 1.93%, led by Indian oil and gas explorer Oil and Natural Gas Corp, which rose as much as 8.2% - its highest since July 2019.

Oil prices hit their highest levels in at least three years, extending gains from the previous session, after the world's major producers decided to keep a cap on crude supplies

While higher oil prices are expected to stoke inflationary pressures, they will benefit crude producers like ONGC.

"Crude prices are going to remain elevated, and with the recent domestic price hike, the margins are improving for ONGC," said Sumit Pokharna, VP Research at Kotak Securities. He added the sector was relatively an underperformer and Tuesday's rally was a catch-up.

Nifty's IT and pharma indexes were down 0.86% each, falling the most among major sub-indexes.

IT's losses were led by Tech Mahindra, HCL and Mindtree, all down between 1.06% and 1.7%, ahead of the September-quarter earnings season.

Separately, a Reuters poll of economists expect elevated inflation to hold or accelerate, risking a further delay to India's economic recovery. Price pressures have soared thanks to rising fuel prices, but the Reserve Bank of India is not expected to raise interest rates until April-June 2022.

Asian shares suffered heavy losses early on Tuesday following a broad selloff on Wall Street, as investors worried about inflation due to supply chain disruptions and the rally in energy prices.

(Reporting by Vishwadha Chander in Bengaluru; Editing by Krishna Chandra Eluri)