For each activity in a course, as well as a row in the specific table like forum or quiz, there is also a generic row in the course_modules table. There is then also a list of course_module ids in the course_sections.sequence column (I am guessing that column name sequence, but it is something like that.) Finally, there is some cached information in the course.modinfo column, but if you set that to an empty string, it will be rebuilt the next time the course is viewed.