Context. Several energetic disturbances have been identified as triggers of large-amplitude oscillations (LAOs) in prominences. Observations show that Moreton or extreme ultraviolet waves excite prominence oscillations of the longitudinal, transverse, or mixed polarities. However, the mechanisms for the excitation of LAOs by these waves are not well understood. Aims. In this study, we aim to investigate mechanisms behind the triggering of LAOs via self-consistent perturbation produced by an eruption and via energetic waves coming from a distant energy source. Methods. We performed time-dependent numerical simulations in 2.5D and 2D setups, using the magnetohydrodynamic code MANCHA3D, involving a flux rope and dipped arcade magnetic configurations with an artificially loaded prominence mass in the magnetic dips. Two types of disturbances were applied to excite prominence oscillations. The first type involves perturbations produced self-consistently by an eruption, while the second type of perturbation is associated with the waves caused by an artificial energy release. Results. In the simulations of the eruption, we find that this eruption by itself does not produce LAOs in the prominence located in its vicinity. Its only effect is in inclining the magnetic configuration of the prominence. While the erupting flux rope rises, an elongated current sheet forms behind it. This current sheet becomes unstable and breaks into plasmoids. The downward-moving plasmoids cause perturbations in the velocity field by merging with the post-reconnection loops. This velocity perturbation propagates in the surroundings and enters the flux rope, causing the disturbance of the prominence mass. The analysis of the oscillatory motions of the prominence plasma reveals the excitation of small-amplitude oscillations (SAOs), which are a mixture of longitudinal and vertical oscillations with short and long periods. In the simulations with a distant artificial perturbation, a fast-mode shock wave is produced and it gradually reaches two flux rope prominences at different distances. This shock wave excites vertical LAOs as well as longitudinal SAOs with similar amplitudes, periods, and damping times in both prominences. Finally, in the experiment with the external triggering of LAOs of solar prominences by an artificial perturbation in a dipped arcade prominence model, we find that although the vector normal to the front of a fast-mode shock wave is parallel to the spine of the dipped arcade well before the contact, this wave does not excite longitudinal LAOs. When the wave front approaches the prominence, it pushes the dense plasma down, establishing vertical LAOs and motions due to compression and rarefaction along the magnetic field. Conclusions. The external triggering of prominence oscillations is a complex process that excites LAOs or SAOs of the longitudinal or transverse polarizations or a mix of both types. It is not an easy task to produce LAOs in prominences because the triggering event requires a sufficient amount of energy. The orientation of the prominence axis with respect to the driving event may play a crucial role in triggering a certain type of LAOs.