The K\ensuremath{\alpha} and K\ensuremath{\beta} x-ray spectra of molybdenum bombarded by 5.5-MeV/amu $^{16}\mathrm{O}$ ions were measured with high resolution. In such heavy-ion--atom collisions, multiple ionization of the M and L shells of the target atoms is extremely likely to occur, resulting in a complex structure of the observed spectra. The ${\mathit{L}}^{\mathit{n}}$-satellite structure was resolved, whereas M vacancies produce only a shift and a broadening of the lines so that it is not possible to obtain in a direct way information about the M-hole distribution. We thus propose a method for the analysis of x-ray spectra of multiply ionized atoms. In this method the measured K\ensuremath{\alpha} and K\ensuremath{\beta} spectra are simultaneously analyzed as a sum of K\ensuremath{\alpha}${\mathit{L}}^{\mathit{n}}$${\mathit{M}}^{\mathit{m}}$ and K\ensuremath{\beta}${\mathit{L}}^{\mathit{n}}$${\mathit{M}}^{\mathit{m}}$ components, respectively, with theoretically determined profiles. A binomial distribution of holes in the M shell is assumed and the M-shell ionization probabilities are treated as adjustable parameters. The profiles are constructed as sums of Voigt functions, whose positions and heights are determined by extensive multiconfiguration Dirac-Fock method calculations. If, in a simultaneous fit to the K\ensuremath{\alpha}${\mathit{L}}^{0}$ and K${\mathrm{\ensuremath{\beta}}}_{1,3}$${\mathit{L}}^{0}$ lines, just one parameter ${\mathit{p}}_{\mathit{M}}^{\mathit{X}}$ describing the M-shell ionization at the moment of the K x-ray transition is used, the experimental data are not reproduced in an entirely satisfactory way (${\mathit{p}}_{\mathit{M}}^{\mathit{X}}$=0.19\ifmmode\pm\else\textpm\fi{}0.02). Therefore, two parameters, one common for the 3s and 3p subshells ${\mathit{p}}_{3\mathit{s}\mathit{p}}^{\mathit{X}}$ and the other for the 3d subshells, were introduced and a much better fit to both lines (${\mathit{p}}_{3\mathit{s}\mathit{p}}^{\mathit{X}}$=0.17\ifmmode\pm\else\textpm\fi{}0.02, ${\mathit{p}}_{3\mathit{d}}^{\mathit{X}}$=0.23\ifmmode\pm\else\textpm\fi{}0.02) was obtained.The importance and influence of alternative ionizing processes as electron-capture and rearrangement processes are discussed and the M-shell ionization probability at the moment of the collision (${\mathit{p}}_{\mathit{M}}$=0.18\ifmmode\pm\else\textpm\fi{}0.02) is deduced from the ${\mathit{p}}_{\mathit{M}}^{\mathit{X}}$ value. It is shown that the differences between ${\mathit{p}}_{3\mathit{s}\mathit{p}}^{\mathit{X}}$ and ${\mathit{p}}_{3\mathit{d}}^{\mathit{X}}$ are mainly due to Coster-Kronig transitions, rather than due to different subshell ionization probabilities. The spectra were also analyzed with respect to the L-shell ionization on the basis of the calculated K\ensuremath{\alpha}${\mathit{L}}^{\mathit{n}}$${\mathit{M}}^{0}$, K${\mathrm{\ensuremath{\beta}}}_{1,3}$${\mathit{L}}^{\mathit{n}}$${\mathit{M}}^{0}$, and K${\mathrm{\ensuremath{\beta}}}_{2}$${\mathit{L}}^{\mathit{n}}$${\mathit{M}}^{0}$ components. The M-shell ionization was taken into account by taking a larger Gaussian width and by shifting the positions of the lines. The intensity yields of the L satellites were determined, the primary vacancy distribution was deduced, and the results from K\ensuremath{\alpha} and K\ensuremath{\beta} spectra are compared.