The suppression and compensation effect of oxygen on heavily boron doping behaviors and characteristics in microwave plasma chemical vapor deposition (MPCVD) diamond films are investigated. The suppression on boron incorporation is observed with crystal quality improved when oxygen added into diamond doping process. A relatively low hole concentration is expected and verified by the Hall effects measurements due to the compensation effect of oxygen as a deep donor in diamond. Low acceptor concentration, high compensation donor concentration, and relatively larger acceptor ionization energy are then induced by oxygen addition, however, heavily boron-doped diamond film with high crystal quality can also be expected. The formation of oxygen-boron complex structure instead of oxygen substitution as indicated by X-ray photoelectron spectroscopy (XPS) results is suggested to be more responsible for the observed enhanced compensation effect due to its predicted low formation energy. Meanwhile, density functional theory (DFT) calculations show that the B-O complex structure are easily formed in diamond with a formation energy of -0.83 eV. This work provides a comprehensive understanding on the compensation of oxygen on the heavily boron-doped diamond.