I went to the disaster zone last year. It had been 12 years since the tragedy had happened.
Is this "had" – the one just after the word tragedy – necessary?
I went to the disaster zone last year. It had been 12 years since the tragedy had happened.
Is this "had" – the one just after the word tragedy – necessary?
Had been creates a past perfect construction which accomplishes at least two things:
It establishes clearly that the tragedy occurred 12 years before you went to the disaster zone, not twelve years before the present.
It establishes the "Reference Time" for your discourse—the time where your discourse will be "anchored"— at the time you went to the disaster area, rather than in the present, while permitting you to move coherently between the two past events, the tragedy and your visit.
Had happened is not strictly necessary to establish the sequence—you may, and in conversation probably would, use a simple past, or simply omit the verb altogether—but it reinforces location of Reference Time at the time of your visit. This will not be a discourse about the tragedy or about your present experience, but about the impact of the tragedy on what you saw and experienced when you visited.
You may read a great deal more about the meaning and use of perfect constructions at Canonical Post #2: What is the perfect, and how should I use it?, particularly sections 3.1 (What does the perfect mean?—Grammatical Meaning), 3.2 (What does the perfect mean?—Pragmatic Meaning), and 4 (How and when should I use the perfect?).
The second instance of had is unnecessary. Happened communicates a past event, making it redundant.
Words should improve communication. Density, specificity, and readability are the important characteristics. Eliminate the word and test the result, if it doesn't increase one of those characteristics, eliminate it. For example:
It had been 12 years since the tragedy happened.
Did the sentence lose density, specificity, or readability? The density was increased, readability improved, and specificity unchanged, so the result is an improvement.
Furthermore, since communicates that the 12 years is referring to a period of time between two events. Since and tragedy are therefore both event based, rendering the information in the word happened redundant. Let's try a further reduction:
It had been 12 years since the tragedy.
Even better.
It communicates that 12 years elapsed between the tragedy and the event. All of the information using fewer words equals improved communication.