"Mizmor Shir Chanukat HaBayit L'David"
"A Song, with Musical Accompaniment,
I will exalt You, HASHEM, for You have raised me up from the depths, and not let my foes rejoice over me. HASHEM, my God, I cried out to You and You healed me. HASHEM, You have raised up my soul from the lower world, You have preserved me lest I descend to the Pit. Sing to HASHEM, His devoted ones, and give thanks to His holy Name. For His anger endures but a moment; but life results from His pleasure; in the evening one lies down weeping, but with dawn -- a cry of joy!
I had said in my serenity, 'I would never falter'. But, HASHEM, it was Your good will alone that supported my greatness with might. Should You but conceal Your face, I would be terrified. To You, HASHEM, I would call and to my Lord I would appeal. What gain is there in my death, in my descent to the Pit? Will the dust acknowledge You? Will it tell of Your Truth?
Hear, HASHEM, and favor me; HASHEM, be my helper! You have changed for me my lament into dancing; You undid my sackcloth and girded me with joy. So that my soul might sing to You and not be stilled, HASHEM my God, forever will I thank You.
King David composed this Psalm to be sung when his son, Shlomo, dedicated the Temple. In the Talmud, Masechet Soferim, this Psalm is designated as the Daily Psalm of Chanukah.
Radak explains that the eventual inauguration of the Temple by Shlomo represented David's vindication against the taunts and charges of his enemies. If David were really a doomed sinner, as they claimed, his offspring could not have gained the privilege of realizing David's dream of building the Temple.
The Psalm captures the attitude of gratitude towards the Master of the Universe by concluding "that my soul might sing to You, and not be stilled; Hashem, my G-d, forever will I thank You."