1) If an oven designated for one class of food was inadvertently used to cook/bake a food of the opposite class, it can be Koshered by thoroughly cleaning it out [preferably with a caustic cleaner to remove the grease from the walls], waiting 24 hours and then turning the oven to the highest temperature(or self clean, in which case a caustic cleaner may not be necessary) for approximately an hour.
The grates on which the food were laying inside the oven, also require Koshering and should also be cleaned, and remain inside when the oven is turned on to the highest setting. (See Kovetz M'Beis Leivi Vol. 3 page 21:5)
2) It is important to note that Koshering ovens should be done only when necessary and in instances where they inadvertently were used wrongly. Constantly Koshering an oven from one food class to another should be avoided. (See Shu"t Chelkas Yaakov Vol. 2 Siman 136 and Shu"t Teshuvos V'Hanhagos Vol. 1 Siman 430)
Due to the many complications involved in Koshering ovens, and the fact that certain ovens coated with enamel or other materials cannot be koshered at all according to some Poskim, it is always advisable to consult a competent Rav before attempting to kosher an oven to discuss all the specific details. (See "Laws of Kashrus" by Rav Binyomin Forst Shlita page 229 for a more detailed treatment of Koshering ovens.)