This study deals with the analytical investigation of oscillatory squeeze film flow through a Brinkman viscoelastic Oldroyd-B fluid-saturated porous layer subject to two vertically harmonically oscillatory disks. The validity of the present proposed analytical solutions is first demonstrated for the Newtonian fluids when both Λ1 and Λ2 tend to zero by comparison with the previous literature. Results demonstrate that an increase in the elasticity parameter Λ1 correlates with a rise in axial velocities, indicating that the relaxation time Λ1 facilitates enhanced squeeze flow. In the case of squeeze film flow in porous layers, low oscillating frequencies exert minimal effects on axial velocities, independent of variations in the viscoelasticity parameter Λ1. However, at higher oscillating frequencies, axial velocities escalate with increasing the viscoelasticity parameter Λ1. Furthermore, the retardation time Λ2 of the viscoelastic fluid shows no significant effect on the axial velocity, regardless of oscillating frequency changes in both pure fluids and porous layers.