The shutout is Pettitte's first with Houston and his first since June 30, 2002, with the New York Yankees against the New York Mets. It was the left-hander's first complete game since Aug. 9, 2003, against Seattle.
"I think he's been throwing with better velocity this year, but his location hasn't always been as good," Astros manager Phil Garner said. "Today we saw the velocity and the location.
"I think this was the Andy Pettitte of old."
It's the fourth complete-game shutout of Pettitte's career and his 23rd complete game.
Pettitte, who went 17-9 last season with a career-best 2.39 ERA to help Houston reach its first World Series, lost four of his first five decisions this year and had said he didn't feel like himself.
"I don't expect to get shutouts, but that was nice to get," Pettitte said. "I just think I ought to have been doing better all this year than I have been."
The victory gives Houston a 2-1 series win over the Rockies after being swept in Colorado last week.
Pettitte (3-4) struck out seven and walked one. He zipped through the first two innings, retiring the first six batters he faced, including striking out the last two. Brad Hawpe got a single to open the third before Pettitte struck out the next two batters.
He had elbow surgery in 2004 and took a longer break this offseason to rest his arm.
"This is the best I've seen him with that velocity and that control," Garner said. "His arm strength is back. I think you're just going to see him get stronger and stronger."
Pettitte agreed and said past problems with his elbow have been "frustrating."
"I let it be known I didn't feel great last year," Pettitte said. "I'm just extremely happy that it feels good this year. No doubt my arm's stronger and my elbow's stronger, so everything's sharper."
Berkman had a solo homer to left field in his first at-bat after sitting out a game with tightness in his hamstring. It was his 13th homer of the season. His 40 RBI this season are second in the majors to Albert Pujols.
Ensberg hit his 12th home run of the season and his second in seven at-bats on a shot that landed about three rows into the lower level of right field in the fourth.
Pettitte said inconsistency has been his biggest problem this season.
"I haven't been in the counts I've wanted," he said. "But I felt I got ahead a lot today and I was throwing my curve for strikes and my fastball to both sides of the plate. I was doing a lot of things I haven't been doing this year."
In his first career appearance against Houston, Jeff Francis (2-3) allowed six hits and three runs while striking out five in seven innings.
Even he enjoyed watching Pettitte's performance.
"He was awesome," Francis said. "It was my first time to see him. We have a pretty good offense and for him to shut us down today like he did shows a lot."
Sunday marked 40-year-old Craig Biggio's 2,600th career game, making him the first Astros player to reach the milestone. He is second behind Barry Bonds in games played by National League players since 1970. Biggio was 1-for-4.
- Astros shortstop Adam Everett hasn't had an error this season. He is the only shortstop in the majors who has played more than 12 games at the position this season without committing an error.
- Sunday's appearance against Houston leaves Washington as the only team Francis hasn't faced.