Instability of completed sand reservoirs reduces oil production rate and degrades production equipments. A major cause of such instability is plastic deformation of perforation tunnel, resulting in sand production. Influence of direction of maximum principal stress on perforation tunnel has not been investigated either experimentally or theoretically. Elastoplastic consolidation analysis is the foundation of sand production prediction of an oilwell. Three dimensional elastoplastic consolidation analyses were made numerically for the deformation of perforation tunnel of an oilwell coupled with oil flow within sand reservoir with ABAQUS-6.5 finite element software. The drilling processes of borehole and perforation tunnel were simulated in combination of rock deformation process which was regarded as a coupled multiphase problem. Mohr-Coulomb yielding criterion was adopted in the calculation. The designs with 4-perforation density and with 8-perforation density were numerically analyzed and compared. Influence of the direction of principal horizontal effective geostress on the instability of perforation tunnel and that of perforation density were investigated. Numerical results indicate that 1) there is rather large plastic zone occurs when the axis of perforation tunnel is alone the direction of the maximum principal horizontal direction. If the axis of perforation tunnel is alone the direction of the minimum principal horizontal direction, there will be no plastic zone under the same loading conditions. 2) When the density of perforation tunnel is reduced from 8-shots per foot to 4 shots per foot, the plastic zone around the perforation tunnels will be much smaller.