We study how the coherence of noisy oscillations can be optimally enhanced by
external locking. Basing on the condition of minimizing the phase diffusion
constant, we find the optimal forcing explicitly in the limits of small and
large noise, in dependence of phase sensitivity of the oscillator. We show that
the form of the optimal force bifurcates with the noise intensity. In the limit
of small noise, the results are compared with purely deterministic conditions
of optimal locking