The oxidation state of O is -2, except in the alkaline fluorine compounds, the peroxides, where it is -1, in the superoxides, it is -1/2 and in oxygen fluoride (OF2), where it is +2.
As the metal does not meet any of the exceptions the oxidation state of the oxygen will be -2.
We are told that the metal has a charge of +2, therefore we will need:
We will need one ion of oxygen and one ion of metal.