We investigate the evolution of the Rieger periodicity at 152 – 156 days, the 27-day synodic rotation period as well as the 13.5- and 9-day harmonic periodicities in anomalous cosmic ray (ACR) oxygen (O) fluxes at the energy range between 8 – 25 MeV/n observed by the Advanced Composition Explorer (ACE) satellite during Solar Cycles 23 and 24. The ACR oxygen flux data is analysed using the Lomb–Scargle periodogram and Morlet wavelet spectral analysis techniques. Daily mean oxygen fluxes during solar quiet times are used to identify how the ACR oxygen at different energies varies with the Rieger periodicity and the solar rotation periodicities in each year. This is the first investigation of the periodicity evolution of ACR oxygen ions. Previous investigations have mostly concentrated on the spectral behaviour of GCR particles during various solar cycles of opposite polarities, in particular the 27-day and 13.5-day periodicities. Our analysis revealed a significant temporal and energy dependence in the spectral behaviour of ACR oxygen during both cycles. An important finding of this investigation, not reported before in the literature, is the significant increase in the power of the different ACR oxygen periodicities during the minimum of Cycle 24/25 (characterised by a positive solar polarity) in comparison to the minimum of Cycle 23/34 (dominated by a negative solar polarity).