1) AGADAH: THE SIGNIFICANCE OF THE FIFTEEN PSALMS OF "SHIR HA'MA'ALOS"
QUESTION: The Gemara describes the source for David ha'Melech's composition of the fifteen psalms of "Shir ha'Ma'alos" (Tehilim 120-134). The Gemara relates that when David ha'Melech dug the Shisin (the hollow under the place where the Mizbe'ach of the Beis ha'Mikdash eventually would be built, into which the water and wine libations flowed), he inadvertently removed a potsherd that covered (and plugged) the hole of the Waters of the Deep. The waters arose and threatened to drown the world. David ha'Melech inquired whether he was permitted to write the name of Hash-m on the potsherd and to throw it back into the water in order to stop the deluge. No one gave him an answer, until he pronounced a curse on anyone who knew the ruling but would not reveal it to him. Achitofel told him that he was permitted to write the name of Hash-m on the potsherd and throw it into the water, even though Hash-m's name would be erased by the water. David ha'Melech followed Achitofel's ruling, and when he saw that the water descended too much as a result of the potsherd, he said fifteen psalms of Shir ha'Ma'alos in order to raise the water level.
What is unique about the fifteen psalms of Shir ha'Ma'alos that enabled them to have such control over the level of the water?
ANSWER: The KLI YAKAR (Bereishis 6:15) cites the Gemara in Sotah (17a) which states that when there is peace between a man and his wife, the Shechinah dwells among them. The letter Yud of the word "Ish" and the letter Heh of the word "Ishah" come together and form the name of Hash-m. If, G-d forbid, there is not peace between a man and his wife, the letters of the name of Hash-m, Yud and Heh, depart from the "Ish" and "Ishah" and leave two flames -- "Esh" -- which destroy each other.
We see that the letters Yud and Heh, and the name of Hash-m which they spell, are related to peace in marriage. Similarly, the fifteen rows of steps in the Beis ha'Mikdash which joined the Ezras Nashim with the Ezras Yisrael represented the name of Hash-m (the Gematriya of which is fifteen) which is formed when there is peace between man and wife. (The fifteen steps were comprised of two sets, one of ten and one of five, to correspond to the Yud and the Heh, as the Mishnah (51b) teaches.)
When there is a widespread problem with marital harmony among the people, and wives and husbands are involved in licentious activities, Hash-m punishes the people with water. The world was punished with the Great Flood in the times of Noach because of the sin of immoral relations (Arayos), as the Torah states (Bereishis 6:11-12). (This also may be why the Egyptians were punished by being drowned; the Torah (Vayikra 18:3) describes the people of Egypt as being exceedingly promiscuous.)
This explains why the waters of the Flood rose fifteen Amos above the highest mountain. The people sinned by abusing the Yud and Heh that spell Hash-m's name that dwells among the people when there is peace between man and wife, and therefore they were punished with water that rose fifteen Amos above the highest point. Similarly, the rain descended for 150 days, a multiple of fifteen. Each of the three levels of Noach's Teivah (the Ark) was 50 Amos wide, 300 Amos long, and 10 Amos high, or a total of 150,000 cubic Amos. This multiple of fifteen alludes to the fact that it was the name of Hash-m, Yud and Heh, which protected Noach and his family in the Teivah, for they were not involved in Arayos.
Similarly, the Gemara in Berachos (10a) relates that Chizkiyahu ha'Melech was threatened with death in this world and in the next because he refused to bear children, having foreseen that he would have wicked descendants. When he repented and agreed to bear children, he was granted fifteen extra years as a reward for restoring the honor to Hash-m's name of Yud and Heh.
The Gemara here relates that David ha'Melech wrote the name of Yud and Heh upon the potsherd in order to prevent the waters of the depth from flooding the world. By doing so, David ha'Melech called upon the merit of the people who guarded themselves from sins of immorality to protect the world from the water.
Perhaps this also explains why Achitofel initially did not want to permit David ha'Melech to cause the name of Hash-m to be erased in order to protect the world from the deluge. Achitofel was the grandfather of Bas Sheva (Sanhedrin 69b), and he was of the opinion that David ha'Melech was guilty of an impropriety with her. As a result, he felt that David ha'Melech did not have the power to protect the world from the flood waters with Hash-m's name of Yud and Heh. Hash-m, however, knew that David ha'Melech had sincerely repented and had the power to restore the peace of the world with the name of Yud and Heh.
Why are flood waters the punishment for sins that create disharmony between man and wife? The Gemara in Ta'anis (6b) compares rain to the male element and the earth to the female element -- "rain is the husband of the land." The rainwater irrigates the earth which then produces crops. When man and wife are unfaithful to each other, Hash-m punishes the world with water. The water floods the world instead of irrigating it, just as the man and wife betrayed each others faith to each other.
The Kal v'Chomer upon which Achitofel based his ruling involved the Halachah of erasing Hash-m's name for the sake of bringing peace between a man and his wife. Causing the waters to subside was a form of making peace between the water and the land, which represents the peace between man and wife. That is why the water descended 16,000 Amos below the ground level, which is 15,000 Amos (a multiple of fifteen) below the original water level. In order to bring the water back to a reasonable level and to restore peace to the world, David ha'Melech recited the fifteen psalms of Shir ha'Ma'alos, which restored the influence of Hash-m's name of Yud and Heh in the world.

53b----------------------------------------53b

2) ERASING THE NAME OF HASH-M IN ORDER TO SAVE THE WORLD
QUESTION: The Gemara relates that when David ha'Melech dug the Shisin (the hollow under the place where the Mizbe'ach of the Beis ha'Mikdash eventually would be built, into which the water and wine libations flowed), he inadvertently removed a potsherd that covered (and plugged) the hole of the Waters of the Deep. The waters arose and threatened to drown the world. David ha'Melech inquired whether he was permitted to write the name of Hash-m on the potsherd and to throw it back into the water in order to stop the deluge. No one gave him an answer, until he pronounced a curse on anyone who knew the ruling but would not reveal it to him. Achitofel told him that he was permitted to write the name of Hash-m on the potsherd and throw it into the water, even though Hash-m's name would be erased by the water.
What was David ha'Melech's question? Any situation of Piku'ach Nefesh, where human life is in danger, overrides almost all prohibitions (except Avodah Zarah (idolatry), Shefichus Damim (murder), and Giluy Arayos (immorality)). The waters posed a mortal danger to the world, and thus David ha'Melech certainly was permitted to erase the name of Hash-m to save the world.
ANSWERS:
(a) The ARUCH LA'NER answers that David ha'Melech was concerned that his action might involve a Chilul Hash-m. The transgression of Chilul Hash-m does not override Piku'ach Nefesh.
(b) The RAMBAN in Sanhedrin (73a, as cited in He'oros b'Maseches Sukah) writes that the law that Piku'ach Nefesh does not override the prohibitions of Avodah Zarah, Giluy Arayos, and Shefichus Damim ("Yehareg v'Al Ya'avor"), includes any branch ("Abizraihu") of those prohibitions. Accordingly, David ha'Melech was unsure whether or not erasing the name of Hash-m is included in a subcategory of Avodah Zarah, and therefore he waited until he received a Halachic ruling in the matter.
(c) RAV YOSEF SHALOM ELYASHIV shlit'a (quoted in He'oros b'Maseches Sukah) suggests that the water posed no actual mortal danger to the world. Rather, the rising water threatened to disrupt the normal lifestyle and routine of the world's inhabitants. There was no question of Piku'ach Nefesh, and therefore David ha'Melech waited until he received a Halachic ruling in the matter.
(d) Perhaps David ha'Melech's doubt can be understood based on the words of the RAMBAM (in MOREH NEVUCHIM, cited by the RASHBA in Teshuvos 1:413; see Insights to Shabbos 67:2:b). The Rambam rules that one may not desecrate Shabbos in order to heal a person in a manner that is not medically proven and accepted. David ha'Melech's doubt was whether this ruling also applies to violating any Torah prohibition in an unconventional manner in order to save a life, such as by erasing Hash-m's name in order to stop a flood.

OTHER D.A.F. RESOURCES
ON THIS DAF