Oxygen exhibits +2 oxidation state in the compound:
MgO
OF2
H2O
Na2O
Since fluorine is more electronegative than oxygen the oxidation state of oxygen is positive and is +2 in OF2.
Oxygen exhibits positive oxidation state in