Memristive switching in materials attracts intensive attention due to its potential application for nonvolatile memories. The environmental effect on the switching stability is of crucial importance to the fabrication and performance of a real memory devices. In this work, a solid state electrochemical cell with Cu/Si/Pt sandwich structure has been investigated. The cell shows a forming-free and gradual memristive switching behavior. The environmental atmosphere has significant effect on the switching behavior. We suggest that Cu electrode is oxidized by the atmosphere, forming a CuOx layer at the Cu/Si interface. The memristive switching can be attributed to the redox reaction between the CuOx and Si layers with an equilibrium of oxygen exchange between the cell and the environment. By pre-fabricating a CuOx layer during the cell preparation, the oxygen exchange with the environmental atmosphere is avoided and the switching degradation in vacuum condition is improved. These results provide a fundamental insight into improvement of memristive devices close to a real service condition.