The vortex formation in a two-dimensional Cartesian cavity, which their vertical walls move simultaneously with an oscillatory velocity and the horizontal walls are fixed pistons, is studied numerically.The governing equations were solved with a finite element method combined with an operator splitting scheme. We analyzed the behavior of vortical structures occurring inside a cavity with an aspect ratio of height to width of 1.5 for three different displacement amplitudes of the vertical oscillatory walls (amplitude/width= Y = 0.2, 0.4 and 0.8) and Reynolds numbers based on the cavity width of 50, 500 and 1000. Two vortex formation mechanisms are identified: a) the shear, oscillatory motion of the moving boundaries coupled with the fixed walls that provide a translational symmetry-breaking effect and b) the sharp changes in the flow motion when the flow meets the corners of the cavity. The vortices cores were identified using the Jeong-Hussain criterium and it is found that they occupy smaller areas as the Reynolds number increases. All flows studied are cyclic symmetric and for low Y and Re values they are also symmetric with respect to the vertical axis dividing the cavity in two sides. In asymmetric flows, the unbalance between the vortices on each side of the mid-vertical line generates a vortex that occupies the central part of the cavity. The breakdown of the axial symmetry was studied for a fixed value of the oscillation amplitude, Y = 0.8, taking Re as the bifurcation parameter. The results indicates that the symmetry is broken through a supercritical pitchfork bifurcation.