In shale gas production, secondary fracturing technology is often used to improve shale gas production capacity. However, the toughness of cement stone used in Class G oil wells is poor, and the cement sheath is easily damaged by impact load during fracturing, resulting in cement sheath sealing failure. To solve this problem, this paper proposes to improve the strength and toughness of cement paste by optimizing the mineral composition of Class G oil well cement. The cement clinker is burned in the laboratory, and the microstructure differences of clinker under different mineral composition ratios are observed by reflection microscope. The mechanical properties of cement paste before and after optimization are analyzed, and the best mineral composition ratio is obtained. The petrographic structure, hydration products and microstructure of high ferrite oil well cement were analyzed by petrography, X-ray diffraction analysis (XRD), thermal analysis (TG/DTG) and scanning electron microscopy (SEM), analyzed and explored its enhancement mechanism. The results show that the best mineral composition mass ratios of C3S, C2S, C3A and C4AF in high ferrite oil well cement are 58.34%, 16.39%, 1.51% and 17.94% respectively. Compared with grade G oil well cement, the compressive strength and flexural strength of curing 28 days are increased by 14.11% and 19.51%, respectively. The stress-strain results show that high ferrite oil well cement has better toughness. The petrographic results show that the lithofacies structure of high ferrite oil well cement is evenly distributed and the particle size is moderate; XRD, TG/DTG and microanalysis show that there are more hydration products in high ferrite oil well cement, the hydration products are closely combined, the hydration degree is more thorough, and the structure of cement paste is more compact. High ferrite oil well cement has the advantages of high strength and good toughness, which has potential advantages for shale gas cementing.