Context. Numerical simulations of starlight that is reflected by Earth-like exoplanets predict habitability signatures that can be searched for with future telescopes. Aims. We explore signatures of water oceans in the flux and polarization spectra of this reflected light. Methods. With an adding-doubling algorithm, we computed the total flux F, polarized flux Q, and degree of polarization Ps of starlight reflected by dry and ocean model planets with Earth-like atmospheres and patchy clouds. The oceans consist of Fresnel reflecting surfaces with wind-ruffled waves, foam, and wave shadows, above natural blue seawater. Our results are presented as functions of wavelength (from 300 to 2500 nm with 1 nm resolution) and as functions of the planetary phase angle from 90° to 170°. Results. The ocean glint increases F, |Q|, and Ps with increasing phase angle at nonabsorbing wavelengths, and causes the spectra of F and |Q| for the various phase angles to intersect. In the near-infrared, Q is negative, that is, the direction of polarization is perpendicular to the plane through the star, planet, and observer. In the Ps spectra, the glint leaves dips (instead of peaks) in gaseous absorption bands. All those signatures are missing in the spectra of dry planets. Conclusions. The dips in Ps and the negative Q in the near-infrared can be searched for at a phase angle of 90°, where the planet-star separation is largest. Those ocean signatures in polarized light do not suffer from false positive glint signals that could be due to clouds or reflecting dry surfaces. For heavily cloudy planets, ocean detection is possible when the glint is (partially) cloud-free. When modeling signals of planets with oceans, using horizontally inhomogeneous cloud covers is thus crucial. Observations spread over time would increase the probability of catching a cloud-free glint and detecting an ocean.