"A good name is better than good oil" (Ecclesiastes 7:1). Good oil goes down, a good name goes up, as it is said, "(And I will make your name great) and I will make you a great nation [and I will make your name great]" (Genesis 12:2). Good oil comes to an end, a good name does not come to an end, [as it is said,] "an everlasting name I will give him, that shall not be cut off" (Isaiah 56:5). Good oil is by money, a good name is for nothing. Good oil is for the rich, a good name is for the poor and for the rich. Good oil travels from the chamber to the hall, a good name travels from one end of the world to its other end. Good oil falls upon the dead and it makes a stench, [as it is said,] "dead flies make the perfumer's oil stink and ferment" (Ecclesiastes 10:1). A good name falls upon the dead and it does not make a stench, [as it is said,] "and he went up and bent over him and the lad sneezed (until) seven times (and the flesh of the child grew warm)" (II Kings 4:33). Good oil falls upon the water and it is washed away, a good name falls upon the water and it is not washed away, [as it is said,] "And the LORD spoke to the fish" (Jonah 2:1). Good oil falls upon the fire and it is burned up, a good name falls upon the fire and it is not burned up, [as it is said,] "Then came forth Shadrach, Meshach, and Abed-nego out of the midst of the fire" (Daniel 3:26). Rabbi Yehuda b'Rabbi Simon said: [We find that] the possessors of good oil entered a place of the living and came out dead; the possessors of a good name entered a place of the dead and came out alive.
A Good Name Outlasts Good Oil in Midrash Shmuel
Midrash Shmuel 23:2
טוב שם משמן טוב וגו' (קהלת ז' א'), שמן טוב יורד שם טוב עולה, שנאמר (ואגדלה שמך) ואעשך לגוי גדול [ואגדלה שמך] (בראשית י"ב ב'), שמן טוב כלה שם טוב אינו כלה, [שנאמר] שם עולם אתן לו אשר לא יכרת (ישעי' נ"ו ה'), שמן טוב בדמים, שם טוב בחנם, שמן טוב לעשירים, שם טוב לעניים ולעשירים, שמן טוב מהלך מקיטון לטרקלין, שם טוב מהלך מסוף העולם ועד סופו, שמן טוב נופל על המת והוא מבאיש, [שנאמר] זבובי מות יבאיש יביע שמן רוקח (קהלת י' א'), שם טוב נופל על המת ואינה מבאיש, [שנאמר] ויעל ויגהר עליו ויזורר (על) הנער [עד] שבע פעמים (ויחם בשר הילד) (מלכים ב' ד' ל"ג), שמן טוב נופל על המים והוא נדוח, שם טוב נופל על המים ואינו נדוח, [שנאמר] ויאמר ה' לדג וגו' (יונה ב' א'), שמן טוב נופל על האור והוא נשרף, שם טוב נופל על האור ואינו נשרף, [שנאמר] באדין נפקין שדרך מישך ועבד נגו מן גו נורא (דניאל ג' כ"ו), אמר רבי יהודה ברבי סימון [מצינו] בעלי שמן טוב נכנסו למקום החיים ויצאו מתים, בעלי שם טוב נכנסו למקום המתים ויצאו חיים.