Context. Water maser emission is often found in the circumstellar envelopes of evolved stars, that is, asymptotic giant branch stars and red supergiants with oxygen-rich chemistry. The H2O emission shows strong variability in evolved stars of both of these types. Aims. We wish to understand the reasons for the strong variability of water masers emitted at 22 GHz. In this paper, we study U Her and RR Aql as representatives of Mira variable stars. Methods. We monitored U Her and RR Aql in the 22 GHz maser line of water vapour with single-dish telescopes. The monitoring period covered about two decades between 1990 and 2011, with a gap between 1997 and 2000 in the case of RR Aql. Observations were also made in 1987 and 2015 before and after the period of contiguous monitoring. In addition, maps of U Her were obtained in the period 1990–1992 with the Very Large Array. Results. We find that the strongest emission in U Her is located in a shell with boundaries of 11–25 AU. The gas-crossing time is 8.5 yr. We derive lifetimes for individual maser clouds of ≤4 yr based on the absence of detectable line-of-sight velocity drifts of the maser emission. The shell is not evenly filled, and its structure is maintained over much longer timescales than those of individual maser clouds. Both stars show brightness variability on several timescales. The prevalent variation is periodic, following the optical variability of the stars with a lag of 2–3 months. Superposed are irregular fluctuations of a few months in duration, with increased or decreased excitation at particular locations, and long-term systematic variations on timescales of a decade or more. Conclusions. The properties of the maser emission are governed by those of the stellar wind while traversing the H2O maser shell. Inhomogeneities in the wind affecting the excitation conditions and prevalent beaming directions likely cause the variations seen on timescales of longer than the stellar pulsation period. We propose the existence of long-living regions in the shells, which maintain favourable excitation conditions on timescales of the wind-crossing times through the shells or orbital periods of (sub)stellar companions. The H2O maser properties in these two Mira variables are remarkably similar to those in the semiregular variables studied in our previous papers regarding shell location, outflow velocity, and lifetime. The only difference is the regular brightness variations of the Mira variables caused by the periodic pulsation of the stars.