  We combine stellar metallicity and stellar mass estimates for a large sample
of galaxies drawn from the SDSS DR2 spanning wide ranges in physical
properties, in order to derive an inventory of the total mass of metals and
baryons locked up in stars today. Physical parameter estimates are derived from
galaxy spectra with high S/N (>20). Coadded spectra of galaxies with similar
velocity dispersions, absolute r-band magnitudes and 4000\AA-break values are
used for those regions of parameter space where individual spectra have lower
S/N. We estimate the total density of metals and of baryons in stars and, from
these two quantities, we obtain a mass- and volume-averaged stellar metallicity
of <Z_star>=1.04+-0.14 Z_sun, i.e. consistent with solar. We also study how
metals are distributed in galaxies according to their mass, morphology and age,
and we then compare these distributions with the corresponding distributions of
stellar mass. We find that the bulk of metals locked up in stars in the local
Universe reside in massive, bulge-dominated galaxies, with red colours and high
4000\AA-break values corresponding to old stellar populations. Bulge-dominated
and disc-dominated galaxies contribute similar amounts to the total stellar
mass density, but have different fractional contributions to the mass density
of metals in stars, in agreement with the mass-metallicity relation.
Bulge-dominated galaxies contain roughly 40% of the total amount of metals in
stars, while disc-dominated galaxies less than 25%. Finally, at a given galaxy
stellar mass, we define two characteristic ages as the median of the
distributions of mass and metals as a function of age. These characteristic
ages decrease progressively from high-mass to low-mass galaxies, consistent
with the high formation epochs of stars in massive galaxies.
