The computational analysis was performed of self-sustained oscillatory flow over the open cavity driven by a shear layer at flight Mach 5.0 condition with the solution of the Reynolds-averaged Navier-Stokes equations with a two-equation turbulence model. The self-sustained oscillation cycle of the open ramp cavity was got by simulation. It is found that the self-sustained oscillation feature of the cavity was complex flow. The shear layer rolls up and forms a vortex that grows in strength as the fluid enters the cavity. The amplitude of the pressure oscillation on the aft wall is much higher than that at the other wall due to the mass entrainment and ejection mechanism along the aft wall. This periodic mass addition and expulsion could be critical to the fuel and air mixing and flame-holding in the scramjet engine applications.