Skip to main content

All riemannian manifolds with holonomy contained in $SU(n) \subset SO(2n)$, $Sp(n) \subset SO(4n)$, $G_2 \subset SO(7)$ and $Spin(7) \subset SO(8)$ are Ricci-flat. There are plenty of non-flat examples; e.g., those with holonomy precisely those groups.

In the Lorentzian setting, you could consider a subclass of lorentzian symmetric spaces with solvable transvection group, the so-called Cahen-Wallach spacetimes. They are pp-waves with metric given in local coordinates by $$ 2 dudv + \sum_{i=1}^{n-2} dx_i^2 + \sum_{i,j=1}^{n-2} A_{ij} x^i x^j du^2 $$ where $A_{ij}$ are the entries of a symmetric matrix. If $A$ is traceless, the metric is Ricci-flat, but if $A \neq 0$ then it is non-flat.

Added (in response to the comment)

The riemannian result is classical. I learnt this from a book by Simon Salamon, “Riemannian Geometry and Holonomy Groups”, but there are some more recent lecture notes you might find useful: http://arxiv.org/abs/1206.3170. Concerning the lorentzian result, it is a simple calculation to determine the Riemann and Ricci tensors of the metric I wrote down. The metrics were introduced in the paper “Lorentzian symmetric spaces” by Michel Cahen and Nolan Wallach, Bull. Am. Math. Soc. 76 (1970), 585–591.