This study investigates the effects of single-step and two-step annealing processes on the formation of oxygen precipitates and their impact on metal impurity gettering in gallium-doped monocrystalline silicon. The research focuses on the competitive relationship between internal gettering by oxygen precipitates and external gettering through phosphorus diffusion. Experimental results show that two-step annealing generates larger and more abundant oxygen precipitates, enhancing the internal gettering effect and reducing the recovery of minority carrier lifetime after phosphorus gettering. Despite this, phosphorus diffusion gettering remains effective in improving minority carrier lifetime, although the degree of improvement depends on the size and quantity of oxygen precipitates. These findings offer valuable insights for optimizing the fabrication process of silicon-based solar cells.