  Broadband spectral surveys of protostars offer a rich view of the physical,
chemical and dynamical structure and evolution of star-forming regions. The
Herschel Space Observatory opened up the terahertz regime to such surveys,
giving access to the fundamental transitions of many hydrides and to the
high-energy transitions of many other species. A comparative analysis of the
chemical inventories and physical processes and properties of protostars of
various masses and evolutionary states is the goal of the Herschel CHEmical
Surveys of Star forming regions (CHESS) key program. This paper focusses on the
intermediate-mass protostar, OMC-2 FIR 4. We obtained a spectrum of OMC-2 FIR 4
in the 480 to 1902 GHz range with the HIFI spectrometer onboard Herschel and
carried out the reduction, line identification, and a broad analysis of the
line profile components, excitation, and cooling. We detect 719 spectral lines
from 40 species and isotopologs. The line flux is dominated by CO, H2O, and
CH3OH. The line profiles are complex and vary with species and upper level
energy, but clearly contain signatures from quiescent gas, a broad component
likely due to an outflow, and a foreground cloud. We find abundant evidence for
warm, dense gas, as well as for an outflow in the field of view. Line flux
represents 2% of the 7 L_Sol luminosity detected with HIFI in the 480 to 1250
GHz range. Of the total line flux, 60% is from CO, 13% from H2O and 9% from
CH3OH. A comparison with similar HIFI spectra of other sources is set to
provide much new insight into star formation regions, a case in point being a
difference of two orders of magnitude in the relative contribution of sulphur
oxides to the line cooling of Orion KL and OMC-2 FIR 4.
