DB2 is a relational database management system that runs on IBM mainframes. It uses SQL for data manipulation and definition. A COBOL program can use DB2 services by including host variables, a SQL communication area, and SQL statements. DB2 has major components including system services, locking services, database services, and distributed data facility. The database services component handles tasks like precompiling, binding, running SQL statements, data management, and buffer management.