Coming off a first-round bye, the fourth-seeded Latvian Ostapenko thrashed the Kazakh qualifier 6-3 6-0, winning nine straight games.
However, it was a disappointing day for reigning champion Laura Siegemund and local favourite Angelique Kerber, who went out.
Siegemund was ousted 6-4 4-6 6-3 by American wildcard entry Coco Vandeweghe.
The 2016 winner Kerber retired with what appeared to be a right thigh injury as she trailed Estonian Anett Kontaveit 6-0 2-0.
"I am happy to be on clay again," Ostapenko said. "The first matches are tough but I think I played really well today and I'm just happy with the win."
Siegemund was playing in only her third tournament after 10 months on the sidelines with a ruptured cruciate knee ligament, and she had mixed feelings after going out to Vandeweghe who paved the way to victory with a quick 3-0 lead in the final set.
"Looking at where I am coming from I have to be satisfied. But of course I wanted to win," said the German who has slipped to 100 in the rankings during her absence.
World No.3 Garbine Muguruza was also forced to retire with a back injury during her round of 16 match against Anastasia Pavlyuchenkova.
Russian Pavlyuchenkova won the first set 7-5 before Spaniard Muguruza, the second seed, called it quits.
Caroline Garcia beat Ukrainian qualifier Marta Kostyuk 6-1 3-6 7-5 to book her place in the quarter-finals.
The French world No.7, who overcame Maria Sharapova in the first round, faced another stern test before taming the 15-year-old Kostyuk in an hour and 41 minutes.