High-level ab initio calculations, including variants of the Wn and G3 procedures, have been used to determine the structures and heats of formation of the alkali metal and alkaline earth metal oxides and hydroxides (M2O, MOH: M = Li, Na, and K; MO, M(OH)(2): M = Be, Mg, and Ca). Our best structures were obtained at the CCSD(T)(riv,rv)/aug'-cc-pWCVQZ level and are in uniformly close agreement with available experimental data, with a mean absolute deviation from experimental metal-oxygen bond lengths of just 0.007 Angstrom. Structures obtained with CCSD(T)/cc-pWCVQZ, B3-LYP/cc-pVTZ, B3-LYP/6-31 G(2df,p), and MP2(full)/6-311+G(3df,2p) are also in good agreement with experiment. Zero-point vibrational energies and enthalpy temperature corrections are found to be relatively insensitive to the various procedures employed. However, the heats of formation for these molecules are challenging targets for high-level ab initio procedures. In the Wn-type procedures, it is found that expanding the correlation space on the metal atoms from the normal relaxed valence (rv) (or frozen-core) specification to relaxed inner valence (riv) requires the use of newly developed core-valence basis sets (cc-pWCVnZ) in the extrapolation calculations to obtain reliable results. Our best calculated heats of formation (DeltaH(f) (298)) come from a procedure designated W2C//ACQ, while oG3[CC](dir,full) is the best of the G3-type procedures. Recommended DeltaH(f) (298) values, weighted toward the W2C//ACQ results, are -157 +/- 5 (Li2O), -25 +/- 5 (Na2O), -60 +/- 5 (K2O), +130 +/- 12 (BeO), +142 +/- 10 (MgO), +26 +/- 17 (CaO), -239 +/- 5 (LiOH), -189 +/- 5 (NaOH), -223 +/- 5 (KOH), -632 +/- 7 (Be(OH)(2)), -547 +/- 5 (Mg(OH)(2)), and -604 +/- 19 (Ca(OH)(2)) kJ mol(-1).