In recent years, the decentralized development of ontologies has led to the generation of multiple ontologies of overlapping knowledge. This heterogeneity problem can be tackled by integrating existing ontologies to build a single coherent one. Ontology integration has been investigated during the last two decades, but it is still a challenging task. In this article, we provide a comprehensive survey of all ontology integration aspects. We discuss related notions and scrutinize existing techniques and literature approaches. We also detail the role of ontology matching in the ontology integration process. Indeed, the ontology community has adopted the splitting of the ontology integration problem into matching, merging and repairing sub-tasks, where matching is a necessary preceding step for merging, and repairing can be included in the matching process or performed separately. Ontology matching and merging systems have become quite proficient, however the trickiest part lies in the repairing step. We also focus on the case of a holistic integration of multiple heterogeneous ontologies, which needs further exploration. Finally, we investigate challenges, open issues, and future directions of the ontology integration and matching areas.