Mayor Marion Barry, three days after winning nomination for a second term, yesterday asked all of his department heads to turn in resignations so he would have a free hand in reshaping the city government over the next four years.

Annette Samuels, the mayor's press secretary, said Barry asked his 48 department heads and cabinet officers for their resignations at a regularly scheduled morning cabinet meeting at the District Building. The resignations would be effective Jan. 2, inauguration day.

Barry, a Democrat, expects to be an easy winner in the Nov. 2 election. Three-fourths of the city's registered voters are Democrats.

"It allows an incoming person the opportunity to choose who he wants to do what he wants," said Samuels. "It affords a newly elected official the opportunity to make changes and do what he feels needs to be done."

Barry said Wednesday that he intended to shake up his administration to improve the city's law enforcement activities and to do more to encourage commercial and economic development.

Ten of the city's nearly three dozen department heads are now in acting positions. Barry came under attack during the campaign for have so many acting department heads, but said he was not going to be forced to appoint permanent directors until he had the best person for the job.

Elijah B. Rogers, the city administrator and a trusted Barry aide, has refused for months to say whether he would stay on for another four years if Barry is reelected Nov. 2.

Samuels said Barry made no mention of plans for Ivanhoe Donaldson, his campaign manager who was the acting director of the Department of Employment Services before leaving this spring to direct Barry's reelection campaign.

Barry is scheduled to leave tomorrow on a seven-day vacation at an undisclosed location with his wife, Effi, his mother and his mother-in-law, Samuels said. Barry is scheduled to return to work Sept. 27.