Corbin gave up a single and walk in the first, then retired 12 in a row and 20 out of 21 before Herrera's home run. He joins Randy Johnson, Curt Schilling and Brandon Webb as the only Arizona pitchers with 10 wins before the All-Star break.
The Rockies, playing the first three of 10 straight road games against NL West foes before the break, came to Arizona 2½ games behind the first-place Diamondbacks and left 5½ out. Colorado has lost six of seven.
Gonzalez, who sat out the series opener with a sore back, took a swing at the first pitch he saw in the ninth and hurt a finger. The trainer came out to look at it and after a tentative practice swing, Gonzalez left the game.
Eric Chavez led off the Arizona second with a double and took third on a groundout. Miguel Montero struck out, then with Jason Kubel at the plate, Oswalt spiked a pitch that bounced past catcher Wilin Rosario. Oswalt ran to the plate to cover as Chavez scored but came down awkwardly and immediately had trouble walking as he went to the dugout.
"I never had a hamstring pull in my life. I don't know the timetable on it," Oswalt said. "I felt it when I was trying to slow down. They got it so wet around the plate I kind of slipped. I was trying to change direction a bit. He threw the ball up a little bit. I don't really know exactly when it popped. I just felt it pop and knew right away that there was no way I was going to be able to go back on the mound."
Reliever Edgmer Escalona came on and got in trouble in the second.
He walked Corbin to start the inning, then Gerardo Parra hit his second single of the game. Hill hit a two-run double into the left-field corner, then stole third before Goldschmidt doubled.
Goldschmidt, like Corbin headed to his first All-Star game, leads the NL with 74 RBIs.
Corbin was helped by some big defensive plays. Goldschmidt made a leaping grab at first base to rob Herrera and end the second, and Chavez backhanded Rosario's sizzler to third and threw to first for the final out of the fourth.
NOTES: The Diamondbacks announced a makeup game at Texas for Aug. 1. ... As expected, LHP Tyler Skaggs will start for Arizona on Wednesday night against the Los Angeles Dodgers. ... The Dodgers send Zack Greinke (6-2, 4.30 ERA) against Arizona's Randall Delgado (1-2, 3.67) in Monday night's series opener. ... The Rockies go to San Diego, where Tyler Chatwood (4-2, 2.75) starts against Edinson Volquez (6-6, 5.26) in Monday night's opener. ... Arizona has seven left in a 10-game homestand leading to the break.