We present a detailed discussion on the doubly charmed baryon Ξcc production at the RHIC and LHC via the proton-nucleus (p-N) and nucleus-nucleus (N-N) collision modes. The extrinsic charm mechanism via the subprocesses g+c→(cc)[n]+cˉ and c+c→(cc)[n]+g together with the gluon-gluon fusion mechanism via the subprocess g+g→(cc)[n]+cˉ+cˉ have been taken into consideration, where the intermediate diquark is in [n]=[1S0]6-state or [3S1]3ˉ-state, respectively. Total and differential cross sections have been discussed under various collision energies. To compare with the Ξcc production via proton-proton collision mode at the LHC, we observe that sizable Ξcc events can also be generated via p-N and N-N collision modes at the RHIC and LHC. For examples, about 8.1×107 and 6.7×107Ξcc events can be accumulated in p-Pb and Pb-Pb collision modes at the LHC within one operation year.