A microscopic mechanism for the unipolar resistive switching phenomenon in nickel oxides is proposed based on the thermal decomposition of oxygen ions from oxygen-rich clusters and their recombination with electron-depleted vacancies induced by local electric field in conductive filaments. The proposed physical feature is confirmed by x-ray photoelectron spectroscopy, transmission electron microscopy and electrical measurements in the as-deposited NiOx samples. The deduced formulae under reasonable approximations directly demonstrate the relationships of switching parameters that were widely observed and questioned in different material systems, indicating the universal validity of the proposed mechanism.