The Senate yesterday crushed, 62 to 30, an attempt to keep major oil and gas companies from expanding their coal and uranium holdings, as a way of insuring price compeition.

Sen. Edward M. Kennedy (D-Mass.) offered the provision as an amendment to the first part of President Carter's omnbous energy bill to reach the Senate floor - legislation giving the government some powers, though less than approved by the House, to force electric utilities and industry to shift from use of oil and natural gas to more abundant coal as boiler fuel.

Opponents called the Kennedy amendment a first step toward divestiture, a proposal greatly feared by the oil companies, under which they would have to sell holdings in other fields such as coal or uranium. An alternative would force oil producers to divest "vertically" by dropping out of the oil refining, distribution and retail business.

The vote was not a clear test of Senate sentiment on divestiture. The administration opposed the amendment. Sen Henry M. Jackson (D-Wash.), chairman of the Energy Committee, said he questioned the desirability of permitting oil companies to own other energy holdings, but he opposed attaching it to an energy bill for fear it might prevent final action this year.

Kennedy said major oil and gas companies have rapidly bought up coal and other energy properties during the past decade, to the point where they now hold nearly half the nation's total coal and uranium reserves. If coal mines and oil wells were owned by competing companies the price of both might be held down, but that's not likely when both are owned by one company, he said.

Opponents of the amendment said it will require large amounts of capital to increase coal production 60 per cent by 1985 as Carter proposed and the big oil companies have the capital to develop the mines.

Kennedy replied that the oil companies can't have it both ways. They say they have plenty of money when they want to buy up coal companies, he said, yet they claim they don't have enough money to explore for more oil when they are arguing to increase the price of oil.

The oil industry contended that Kennedy's amendment actually amounts to divestiture because of the checkerboard nature of much of their coal holdings. Herb Schmertz, Mobil Oil vice president for public affairs, said two-thirds of Mobil's coal holdings consist of a piece of land here and another unconnected piece over there which must be connected by a future purcase to make it economically feasible to mine. Kennedy's amendment would prevent filling in the checkerboard and would head away from Carter's goal of increasing coal production, said Schmertz.