Narrative:

During climb out from ZZZ the #2 engine had a severe compressor stall climbing through 12000 ft MSL. The aircraft was climbing at 320 KTS in a steady climb. The thrust lever was retarded to the 'closed' position. Flight crew could feel a slight vibration from the left side of the aircraft and did a precautionary shutdown of the #2 engine by selecting the start lever to 'cutoff' (fuel chop). Emergency was declared. Fuel was dumped to landing weight and an uneventful return to ZZZ was made.

Google
 

Original NASA ASRS Text

Title: A B747-200 FLT CREW EXPERIENCED COMPRESSOR STALL IN #2 ENG ON TKOF. THEY DECLARED AN EMER AND RETURNED TO DEP ARPT.

Narrative: DURING CLBOUT FROM ZZZ THE #2 ENG HAD A SEVERE COMPRESSOR STALL CLBING THROUGH 12000 FT MSL. THE ACFT WAS CLBING AT 320 KTS IN A STEADY CLB. THE THRUST LEVER WAS RETARDED TO THE 'CLOSED' POS. FLT CREW COULD FEEL A SLIGHT VIBRATION FROM THE L SIDE OF THE ACFT AND DID A PRECAUTIONARY SHUTDOWN OF THE #2 ENG BY SELECTING THE START LEVER TO 'CUTOFF' (FUEL CHOP). EMER WAS DECLARED. FUEL WAS DUMPED TO LNDG WT AND AN UNEVENTFUL RETURN TO ZZZ WAS MADE.

Data retrieved from NASA's ASRS site as of January 2009 and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.