Absolute cross sections for the single and double K-shell photoionization of carbonlike O 2+ and nitrogenlike O + ions were measured in the 526-620-eV photon energy range by employing the ion-photon merged-beam technique at the SOLEIL synchrotron radiation facility. High-resolution spectroscopy up to E/ E ≈ 5300 was achieved. Rich resonance structures observed in the experimental spectra are analyzed and identified with the aid of R-matrix and multiconfiguration Dirac-Fock (MCDF) methods. For these two atomic oxygen ions of particular astrophysical interest we characterized the strong 1s → 2p and the weaker 1s → np (n > 2) resonances observed. A detailed comparison of the energies of the 1s → 2p resonances in the first members of the oxygen isonuclear sequence measured by synchrotron based experiments and the Chandra and XMM-Newton x-ray satellites is presented.